Skip to content

Commit 98230dc

Browse files
committed
feat(vscode): add error message for incompatible extensions
1 parent 8540bef commit 98230dc

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

extensions/vscode/index.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,25 @@ import {
1717
import * as vscode from 'vscode';
1818
import { config } from './lib/config';
1919

20+
const incompatibleExtensionIds = [
21+
'johnsoncodehk.vscode-typescript-vue-plugin',
22+
'Vue.vscode-typescript-vue-plugin',
23+
];
24+
25+
for (const extensionId of incompatibleExtensionIds) {
26+
const extension = vscode.extensions.getExtension(extensionId);
27+
if (extension) {
28+
vscode.window.showErrorMessage(
29+
`The "${extensionId}" extension is incompatible with the Vue extension. Please uninstall it.`,
30+
'Show Extension',
31+
).then(action => {
32+
if (action === 'Show Extension') {
33+
vscode.commands.executeCommand('workbench.extensions.search', '@id:' + extensionId);
34+
}
35+
});
36+
}
37+
}
38+
2039
let client: lsp.BaseLanguageClient | undefined;
2140

2241
class _LanguageClient extends lsp.LanguageClient {

0 commit comments

Comments
 (0)