mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-12 21:28:51 +00:00
Extension conflict check detests more combinations
This commit is contained in:
parent
e1acb0ca5c
commit
a8b60afc2a
1 changed files with 15 additions and 5 deletions
|
@ -131,7 +131,7 @@ async function tryActivate(context: vscode.ExtensionContext) {
|
||||||
ctx.pushCleanup(activateTaskProvider(workspaceFolder, ctx.config));
|
ctx.pushCleanup(activateTaskProvider(workspaceFolder, ctx.config));
|
||||||
|
|
||||||
activateInlayHints(ctx);
|
activateInlayHints(ctx);
|
||||||
warnAboutRustLangExtensionConflict();
|
warnAboutExtensionConflicts();
|
||||||
|
|
||||||
vscode.workspace.onDidChangeConfiguration(
|
vscode.workspace.onDidChangeConfiguration(
|
||||||
_ => ctx?.client?.sendNotification('workspace/didChangeConfiguration', { settings: "" }),
|
_ => ctx?.client?.sendNotification('workspace/didChangeConfiguration', { settings: "" }),
|
||||||
|
@ -411,11 +411,21 @@ async function queryForGithubToken(state: PersistentState): Promise<void> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function warnAboutRustLangExtensionConflict() {
|
function warnAboutExtensionConflicts() {
|
||||||
const rustLangExt = vscode.extensions.getExtension("rust-lang.rust");
|
const conflicting = [
|
||||||
if (rustLangExt !== undefined) {
|
["rust-analyzer", "matklad.rust-analyzer"],
|
||||||
|
["Rust", "rust-lang.rust"],
|
||||||
|
["Rust", "kalitaalexey.vscode-rust"],
|
||||||
|
];
|
||||||
|
|
||||||
|
const found = conflicting.filter(
|
||||||
|
nameId => vscode.extensions.getExtension(nameId[1]) !== undefined);
|
||||||
|
|
||||||
|
if (found.length > 1) {
|
||||||
|
const fst = found[0];
|
||||||
|
const sec = found[1];
|
||||||
vscode.window.showWarningMessage(
|
vscode.window.showWarningMessage(
|
||||||
"You have both rust-analyzer (matklad.rust-analyzer) and Rust (rust-lang.rust) " +
|
`You have both ${fst[0]} (${fst[1]}) and ${sec[0]} (${sec[1]}) ` +
|
||||||
"plugins enabled. These are known to conflict and cause various functions of " +
|
"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");
|
"both plugins to not work correctly. You should disable one of them.", "Got it");
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue