fix: Set VS Code extension kind explicitly#21923
Open
Wilfred wants to merge 1 commit intorust-lang:masterfrom
Open
fix: Set VS Code extension kind explicitly#21923Wilfred wants to merge 1 commit intorust-lang:masterfrom
Wilfred wants to merge 1 commit intorust-lang:masterfrom
Conversation
The VS Code extension needs to be a `workspace` extension, because it relies on access to the workspace. The rust-analyzer binary needs to run on the same machine as the checkout of the code it's working on. https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds https://code.visualstudio.com/api/advanced-topics/extension-host#preferred-extension-location If an extension doesn't set extensionKind, VS Code will try to deduce the kind based on the presence of various fields in the package.json, such as a `main`. https://github.com/microsoft/vscode/blob/fc23f2d26631c6a2c4bf9f69506ea74c90a32804/src/vs/workbench/services/extensions/common/extensionManifestPropertiesService.ts#L222 Instead, mark the extension kind as explicitly `workspace`. This is more explicit and prevents future changes to package.json accidentally making it run in the wrong environment. It's also helpful when debugging startup bugs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The VS Code extension needs to be a
workspaceextension, because it relies on access to the workspace. The rust-analyzer binary needs to run on the same machine as the checkout of the code it's working on.https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds https://code.visualstudio.com/api/advanced-topics/extension-host#preferred-extension-location
If an extension doesn't set extensionKind, VS Code will try to deduce the kind based on the presence of various fields in the package.json, such as a
main.https://github.com/microsoft/vscode/blob/fc23f2d26631c6a2c4bf9f69506ea74c90a32804/src/vs/workbench/services/extensions/common/extensionManifestPropertiesService.ts#L222
Instead, mark the extension kind as explicitly
workspace. This is more explicit and prevents future changes to package.json accidentally making it run in the wrong environment. It's also helpful when debugging startup bugs.