@@ -131,7 +131,7 @@ async function tryActivate(context: vscode.ExtensionContext) {
131131 ctx . pushCleanup ( activateTaskProvider ( workspaceFolder , ctx . config ) ) ;
132132
133133 activateInlayHints ( ctx ) ;
134- warnAboutRustLangExtensionConflict ( ) ;
134+ warnAboutExtensionConflicts ( ) ;
135135
136136 vscode . workspace . onDidChangeConfiguration (
137137 _ => ctx ?. client ?. sendNotification ( 'workspace/didChangeConfiguration' , { settings : "" } ) ,
@@ -411,11 +411,21 @@ async function queryForGithubToken(state: PersistentState): Promise<void> {
411411 }
412412}
413413
414- function warnAboutRustLangExtensionConflict ( ) {
415- const rustLangExt = vscode . extensions . getExtension ( "rust-lang.rust" ) ;
416- if ( rustLangExt !== undefined ) {
414+ function warnAboutExtensionConflicts ( ) {
415+ const conflicting = [
416+ [ "rust-analyzer" , "matklad.rust-analyzer" ] ,
417+ [ "Rust" , "rust-lang.rust" ] ,
418+ [ "Rust" , "kalitaalexey.vscode-rust" ] ,
419+ ] ;
420+
421+ const found = conflicting . filter (
422+ nameId => vscode . extensions . getExtension ( nameId [ 1 ] ) !== undefined ) ;
423+
424+ if ( found . length > 1 ) {
425+ const fst = found [ 0 ] ;
426+ const sec = found [ 1 ] ;
417427 vscode . window . showWarningMessage (
418- " You have both rust-analyzer (matklad.rust-analyzer ) and Rust (rust-lang.rust) " +
428+ ` You have both ${ fst [ 0 ] } ( ${ fst [ 1 ] } ) and ${ sec [ 0 ] } ( ${ sec [ 1 ] } ) ` +
419429 "plugins enabled. These are known to conflict and cause various functions of " +
420430 "both plugins to not work correctly. You should disable one of them." , "Got it" ) ;
421431 } ;
0 commit comments