Skip to content

Conversation

michaelgruenewald
Copy link

@michaelgruenewald michaelgruenewald commented Oct 13, 2025

This adds an exported API for other extensions to add rust-analyzer-specific configurations for #18476. It provides a simple API where an extension can just call something like

const rustAnalyzer = await vscode.extensions.getExtension("rust-lang.rust-analyzer")?.activate();
await rustAnalyzer?.addConfiguration(ctx.extension.id, {
    "cargo.cfgs": ["foo", "bar"],
});

to configure aspects. The extension configurations are persisted in the workspace, but only configurations from extensions are are actually present are used, so that uninstalled extensions, etc. aren't causing any trouble.

This does pull in lodash as a dependency, but IMO this is neither very heavy nor critical, and it was already in the dev closure anyway.

Also cf. the discussion in https://rust-lang.zulipchat.com/#narrow/channel/185405-t-compiler.2Frust-analyzer/topic/VSCode.20extension.20config.20feature.20contribution

Fixes #18476

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 13, 2025
@rustbot

This comment has been minimized.

@rustbot rustbot added has-merge-commits S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 13, 2025
@rustbot rustbot removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. has-merge-commits labels Oct 13, 2025
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.

VS Code Extension Config API

2 participants