diff options
| author | Young-Flash <dongyang@apache.org> | 2024-01-26 20:12:13 +0800 |
|---|---|---|
| committer | Young-Flash <dongyang@apache.org> | 2024-01-26 20:12:13 +0800 |
| commit | 96ebad0409f513ea60fb9bd2564247f6bbec30cc (patch) | |
| tree | 39ab0acaf3c4f9a96d85e078fde6321ac0ca8b4c | |
| parent | 56f54c87e7ef1bca036d76974a6bc1ccfd593249 (diff) | |
| download | rust-96ebad0409f513ea60fb9bd2564247f6bbec30cc.tar.gz rust-96ebad0409f513ea60fb9bd2564247f6bbec30cc.zip | |
minor: update conflict extension detect logic
| -rw-r--r-- | editors/code/src/main.ts | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index f532a0ae1af..6935d529aad 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts @@ -25,7 +25,7 @@ export async function deactivate() { export async function activate( context: vscode.ExtensionContext, ): Promise<RustAnalyzerExtensionApi> { - conflictExtDetect(); + checkConflictingExtensions(); const ctx = new Ctx(context, createCommands(), fetchWorkspace()); // VS Code doesn't show a notification when an extension fails to activate @@ -192,7 +192,7 @@ function createCommands(): Record<string, CommandFactory> { }; } -function conflictExtDetect() { +function checkConflictingExtensions() { if (vscode.extensions.getExtension("rust-lang.rust")) { vscode.window .showWarningMessage( @@ -205,20 +205,12 @@ function conflictExtDetect() { } if (vscode.extensions.getExtension("panicbit.cargo")) { - const isRustAnalyzerCheckOnSave = vscode.workspace - .getConfiguration("rust-analyzer") - .get("checkOnSave"); - const isCargoAutomaticCheck = vscode.workspace - .getConfiguration("cargo") - .get("automaticCheck"); - if (isRustAnalyzerCheckOnSave && isCargoAutomaticCheck) { - vscode.window - .showWarningMessage( - `You have Cargo (panicbit.cargo) enabled with 'cargo.automaticCheck' set to true(default), ` + - 'you can disable it or set {"cargo.automaticCheck": false} in settings.json to avoid invoke cargo twice', - "Got it", - ) - .then(() => {}, console.error); - } + vscode.window + .showWarningMessage( + `You have both the rust-analyzer (rust-lang.rust-analyzer) and Cargo (panicbit.cargo) ` + + 'you can disable it or set {"cargo.automaticCheck": false} in settings.json to avoid invoking cargo twice', + "Got it", + ) + .then(() => {}, console.error); } } |
