From 4d49b82f9bc7ad6e2c2475b711f50a4a90ac3f72 Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Wed, 19 Jun 2019 23:36:25 -0700 Subject: [PATCH 1/3] add machine scope --- package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index bbe7443bba..c724095c08 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,12 +545,14 @@ "powershell.powerShellExePath": { "type": "string", "default": "", + "scope": "machine", "isExecutable": true, "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.", + "scope": "machine", "isExecutable": true, "uniqueItems": true, "items": { @@ -755,6 +757,7 @@ "powershell.developer.powerShellExePath": { "type": "string", "default": "", + "scope": "machine", "isExecutable": true, "description": "Deprecated. Please use the 'powershell.powerShellExePath' setting instead" } From 94827a042bf3ea623e1a14f2e77c1ba36b657db6 Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Tue, 25 Jun 2019 16:14:33 -0700 Subject: [PATCH 2/3] use a different setting for test and add user setting test --- test/settings.test.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) 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"); }); }); From 48771b9eb15829b9e24f08042c4decd04e7b6be6 Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Wed, 26 Jun 2019 10:25:47 -0700 Subject: [PATCH 3/3] remove isExecutable and remove powershell.developer.powerShellExePath --- package.json | 9 --------- 1 file changed, 9 deletions(-) diff --git a/package.json b/package.json index c724095c08..c9b94aa394 100644 --- a/package.json +++ b/package.json @@ -546,14 +546,12 @@ "type": "string", "default": "", "scope": "machine", - "isExecutable": true, "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.", "scope": "machine", - "isExecutable": true, "uniqueItems": true, "items": { "type": "object", @@ -753,13 +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": "", - "scope": "machine", - "isExecutable": true, - "description": "Deprecated. Please use the 'powershell.powerShellExePath' setting instead" } } },