Skip to content
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

feat: leverage workspace trust to support all settings in workspace #2089

Merged
merged 1 commit into from
Jul 11, 2023
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
7 changes: 3 additions & 4 deletions packages/svelte-vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,9 @@ Settings to toggle specific features of the extension. The full list of all sett
### Usage with Yarn 2 PnP

1. Run `yarn add -D svelte-language-server` to install svelte-language-server as a dev dependency
2. Run `yarn dlx @yarnpkg/sdks vscode` to generate or update the VSCode/Yarn integration SDKs.
3. Set the `svelte.language-server.ls-path` setting in your user configuration, pointing it to the workspace-installed language server.
4. Restart VSCode.
5. Commit the changes to `.yarn/sdks`
2. Run `yarn dlx @yarnpkg/sdks vscode` to generate or update the VSCode/Yarn integration SDKs. This also sets the `svelte.language-server.ls-path` setting for the workspace, pointing it to the workspace-installed language server. Note that this requires workspace trust - else set the `svelte.language-server.ls-path` setting in your user configuration.
3. Restart VSCode.
4. Commit the changes to `.yarn/sdks`

### Credits

Expand Down
6 changes: 4 additions & 2 deletions packages/svelte-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
"capabilities": {
"untrustedWorkspaces": {
"supported": "limited",
"restrictedConfigurations": [
"svelte.language-server.runtime",
"svelte.language-server.ls-path"
],
"description": "The extension requires workspace trust because it executes code specified by the workspace. Loading the user's node_modules and loading svelte config files is disabled when untrusted"
}
},
Expand Down Expand Up @@ -75,13 +79,11 @@
"description": "Ask on startup to enable the TypeScript plugin."
},
"svelte.language-server.runtime": {
"scope": "application",
"type": "string",
"title": "Language Server Runtime",
"description": "- You normally don't need this - Path to the node executable to use to spawn the language server. This is useful when you depend on native modules such as node-sass as without this they will run in the context of vscode, meaning node version mismatch is likely. Minimum required node version is 12.17. This setting can only be changed in user settings for security reasons."
},
"svelte.language-server.ls-path": {
"scope": "application",
"type": "string",
"title": "Language Server Path",
"description": "- You normally don't set this - Path to the language server executable. If you installed the \"svelte-language-server\" npm package, it's within there at \"bin/server.js\". Path can be either relative to your workspace root or absolute. Set this only if you want to use a custom version of the language server. This will then also use the workspace version of TypeScript. This setting can only be changed in user settings for security reasons."
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte-vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export function activateSvelteLanguageServer(context: ExtensionContext) {
html: workspace.getConfiguration('html')
},
dontFilterIncompleteCompletions: true, // VSCode filters client side and is smarter at it than us
isTrusted: (workspace as any).isTrusted
isTrusted: workspace.isTrusted
}
};

Expand Down
Loading