Skip to content

add machine scope #2039

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
}
},
Expand Down
17 changes: 13 additions & 4 deletions test/settings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
});