6932: Added a warning if conflicting rust-lang.rust is enabled. r=lnicola a=extremegf

Added a warning if conflicting rust-lang.rust plugin is enabled.

Resolves #6463

![Screenshot from 2020-12-18 18-33-02](https://user-images.githubusercontent.com/1788593/102644202-b2f50500-4160-11eb-8fb0-76aeebd80aea.png)


Co-authored-by: Przemyslaw Horban <p.horban@invinets.com>
This commit is contained in:
bors[bot] 2020-12-18 17:48:41 +00:00 committed by GitHub
commit 53f81e4e8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -132,6 +132,7 @@ async function tryActivate(context: vscode.ExtensionContext) {
ctx.pushCleanup(activateTaskProvider(workspaceFolder, ctx.config));
activateInlayHints(ctx);
warnAboutRustLangExtensionConflict();
vscode.workspace.onDidChangeConfiguration(
_ => ctx?.client?.sendNotification('workspace/didChangeConfiguration', { settings: "" }),
@ -399,3 +400,13 @@ async function queryForGithubToken(state: PersistentState): Promise<void> {
await state.updateGithubToken(newToken);
}
}
function warnAboutRustLangExtensionConflict() {
const rustLangExt = vscode.extensions.getExtension("rust-lang.rust");
if (rustLangExt !== undefined) {
vscode.window.showWarningMessage(
"You have both rust-analyzer (matklad.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");
};
}