diff options
| author | bors <bors@rust-lang.org> | 2024-02-01 13:00:05 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-02-01 13:00:05 +0000 |
| commit | 135a8d98418e979e96630048b398afdb7443336b (patch) | |
| tree | 4e4781fab28f6957f024ee5bdbd38c57801e8156 | |
| parent | 3afa6b13c2566836eef2b29baa60b02fe5188db3 (diff) | |
| parent | 4facb6253e38d36a09212ea20374a98b84071819 (diff) | |
| download | rust-135a8d98418e979e96630048b398afdb7443336b.tar.gz rust-135a8d98418e979e96630048b398afdb7443336b.zip | |
Auto merge of #16416 - Young-Flash:cargo_ext_detect, r=lnicola
internal: VS Code: report conflict with `panicbit.cargo` <img width="359" alt="notification" src="https://github.com/rust-lang/rust-analyzer/assets/71162630/420b9f34-ba73-4436-b868-6cd87c62287d"> related to https://github.com/rust-lang/rust-analyzer/issues/16392
| -rw-r--r-- | editors/code/src/main.ts | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 599cfb4ff77..c386b9e5d8f 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts @@ -25,16 +25,7 @@ export async function deactivate() { export async function activate( context: vscode.ExtensionContext, ): Promise<RustAnalyzerExtensionApi> { - if (vscode.extensions.getExtension("rust-lang.rust")) { - vscode.window - .showWarningMessage( - `You have both the rust-analyzer (rust-lang.rust-analyzer) and Rust (rust-lang.rust) ` + - "plugins enabled. These are known to conflict and cause various functions of " + - "both plugins to not work correctly. You should disable one of them.", - "Got it", - ) - .then(() => {}, console.error); - } + checkConflictingExtensions(); const ctx = new Ctx(context, createCommands(), fetchWorkspace()); // VS Code doesn't show a notification when an extension fails to activate @@ -200,3 +191,26 @@ function createCommands(): Record<string, CommandFactory> { revealDependency: { enabled: commands.revealDependency }, }; } + +function checkConflictingExtensions() { + if (vscode.extensions.getExtension("rust-lang.rust")) { + vscode.window + .showWarningMessage( + `You have both the rust-analyzer (rust-lang.rust-analyzer) and Rust (rust-lang.rust) ` + + "plugins enabled. These are known to conflict and cause various functions of " + + "both plugins to not work correctly. You should disable one of them.", + "Got it", + ) + .then(() => {}, console.error); + } + + if (vscode.extensions.getExtension("panicbit.cargo")) { + vscode.window + .showWarningMessage( + `You have both the rust-analyzer (rust-lang.rust-analyzer) and Cargo (panicbit.cargo) plugins enabled` + + 'you can disable it or set {"cargo.automaticCheck": false} in settings.json to avoid invoking cargo twice', + "Got it", + ) + .then(() => {}, console.error); + } +} |
