Skip to content

Commit a630dea

Browse files
authored
warn if old extension is installed (#528)
Add a warning message which shows up at the start if you have the old extension installed.
1 parent 8810064 commit a630dea

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/svelte-vscode/src/extension.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
ViewColumn,
1313
languages,
1414
IndentAction,
15+
extensions,
1516
} from 'vscode';
1617
import {
1718
LanguageClient,
@@ -37,6 +38,8 @@ namespace TagCloseRequest {
3738
}
3839

3940
export function activate(context: ExtensionContext) {
41+
warnIfOldExtensionInstalled();
42+
4043
const runtimeConfig = workspace.getConfiguration('svelte.language-server');
4144

4245
const { workspaceFolders } = workspace;
@@ -307,3 +310,13 @@ function addExtracComponentCommand(getLS: () => LanguageClient, context: Extensi
307310
function createLanguageServer(serverOptions: ServerOptions, clientOptions: LanguageClientOptions) {
308311
return new LanguageClient('svelte', 'Svelte', serverOptions, clientOptions);
309312
}
313+
314+
function warnIfOldExtensionInstalled() {
315+
if (extensions.getExtension('JamesBirtles.svelte-vscode')) {
316+
window.showWarningMessage(
317+
'It seems you have the old and deprecated extension named "Svelte" installed. Please remove it. ' +
318+
'Through the UI: You can find it when searching for "@installed" in the extensions window (searching "Svelte" won\'t work). ' +
319+
'Command line: "code --uninstall-extension JamesBirtles.svelte-vscode"',
320+
);
321+
}
322+
}

0 commit comments

Comments
 (0)