Skip to content

Commit ddbf324

Browse files
add machine scope (#2039)
* add machine scope * use a different setting for test and add user setting test * remove isExecutable and remove powershell.developer.powerShellExePath
1 parent 83970e3 commit ddbf324

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

package.json

+3-9
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"publisher": "ms-vscode",
77
"description": "(Preview) Develop PowerShell scripts in Visual Studio Code!",
88
"engines": {
9-
"vscode": "^1.31.0"
9+
"vscode": "^1.34.0"
1010
},
1111
"license": "SEE LICENSE IN LICENSE.txt",
1212
"homepage": "https://github.com/PowerShell/vscode-powershell/blob/master/README.md",
@@ -545,13 +545,13 @@
545545
"powershell.powerShellExePath": {
546546
"type": "string",
547547
"default": "",
548-
"isExecutable": true,
548+
"scope": "machine",
549549
"description": "Specifies the full path to a PowerShell executable. Changes the installation of PowerShell used for language and debugging services."
550550
},
551551
"powershell.powerShellAdditionalExePaths": {
552552
"type": "array",
553553
"description": "Specifies an array of versionName / exePath pairs where exePath points to a non-standard install location for PowerShell and versionName can be used to reference this path with the powershell.powerShellDefaultVersion setting.",
554-
"isExecutable": true,
554+
"scope": "machine",
555555
"uniqueItems": true,
556556
"items": {
557557
"type": "object",
@@ -751,12 +751,6 @@
751751
"type": "boolean",
752752
"default": false,
753753
"description": "Indicates that the powerShellExePath points to a developer build of Windows PowerShell and configures it for development."
754-
},
755-
"powershell.developer.powerShellExePath": {
756-
"type": "string",
757-
"default": "",
758-
"isExecutable": true,
759-
"description": "Deprecated. Please use the 'powershell.powerShellExePath' setting instead"
760754
}
761755
}
762756
},

test/settings.test.ts

+13-4
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,20 @@ suite("Settings module", () => {
2222

2323
test("Settings update correctly", async () => {
2424
// then syntax
25-
Settings.change("powerShellExePath", "dummypath1", false).then(() =>
26-
assert.strictEqual(Settings.load().powerShellExePath, "dummypath1"));
25+
Settings.change("helpCompletion", "BlockComment", false).then(() =>
26+
assert.strictEqual(Settings.load().helpCompletion, "BlockComment"));
2727

2828
// async/await syntax
29-
await Settings.change("powerShellExePath", "dummypath2", false);
30-
assert.strictEqual(Settings.load().powerShellExePath, "dummypath2");
29+
await Settings.change("helpCompletion", "LineComment", false);
30+
assert.strictEqual(Settings.load().helpCompletion, "LineComment");
31+
});
32+
33+
test("Settings that can only be user settings update correctly", async () => {
34+
// set to false means it's set as a workspace-level setting so this should throw.
35+
assert.rejects(async () => await Settings.change("powerShellExePath", "dummyPath", false));
36+
37+
// set to true means it's a user-level setting so this should not throw.
38+
await Settings.change("powerShellExePath", "dummyPath", true);
39+
assert.strictEqual(Settings.load().powerShellExePath, "dummyPath");
3140
});
3241
});

0 commit comments

Comments
 (0)