Skip to content

fix: Set VS Code extension kind explicitly#21923

Open
Wilfred wants to merge 1 commit intorust-lang:masterfrom
Wilfred:vscode_extension_kind
Open

fix: Set VS Code extension kind explicitly#21923
Wilfred wants to merge 1 commit intorust-lang:masterfrom
Wilfred:vscode_extension_kind

Conversation

@Wilfred
Copy link
Copy Markdown
Contributor

@Wilfred Wilfred commented Mar 31, 2026

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.

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.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants