diff --git a/package.json b/package.json index 5439dc96c5..b2fca99db9 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "publisher": "ms-vscode", "description": "(Preview) Develop PowerShell scripts in Visual Studio Code!", "engines": { - "vscode": "^1.31.0" + "vscode": "^1.34.0" }, "license": "SEE LICENSE IN LICENSE.txt", "homepage": "https://github.com/PowerShell/vscode-powershell/blob/master/README.md", @@ -545,13 +545,13 @@ "powershell.powerShellExePath": { "type": "string", "default": "", - "isExecutable": true, + "scope": "machine", "description": "Specifies the full path to a PowerShell executable. Changes the installation of PowerShell used for language and debugging services." }, "powershell.powerShellAdditionalExePaths": { "type": "array", "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.", - "isExecutable": true, + "scope": "machine", "uniqueItems": true, "items": { "type": "object", @@ -751,12 +751,6 @@ "type": "boolean", "default": false, "description": "Indicates that the powerShellExePath points to a developer build of Windows PowerShell and configures it for development." - }, - "powershell.developer.powerShellExePath": { - "type": "string", - "default": "", - "isExecutable": true, - "description": "Deprecated. Please use the 'powershell.powerShellExePath' setting instead" } } }, diff --git a/test/settings.test.ts b/test/settings.test.ts index 819cfd8bbd..ecbaedfb48 100644 --- a/test/settings.test.ts +++ b/test/settings.test.ts @@ -22,11 +22,20 @@ suite("Settings module", () => { test("Settings update correctly", async () => { // then syntax - Settings.change("powerShellExePath", "dummypath1", false).then(() => - assert.strictEqual(Settings.load().powerShellExePath, "dummypath1")); + Settings.change("helpCompletion", "BlockComment", false).then(() => + assert.strictEqual(Settings.load().helpCompletion, "BlockComment")); // async/await syntax - await Settings.change("powerShellExePath", "dummypath2", false); - assert.strictEqual(Settings.load().powerShellExePath, "dummypath2"); + await Settings.change("helpCompletion", "LineComment", false); + assert.strictEqual(Settings.load().helpCompletion, "LineComment"); + }); + + test("Settings that can only be user settings update correctly", async () => { + // set to false means it's set as a workspace-level setting so this should throw. + assert.rejects(async () => await Settings.change("powerShellExePath", "dummyPath", false)); + + // set to true means it's a user-level setting so this should not throw. + await Settings.change("powerShellExePath", "dummyPath", true); + assert.strictEqual(Settings.load().powerShellExePath, "dummyPath"); }); });