From 0009a0b424264f8e3489261716f2e368b664c6a5 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 3 Aug 2020 15:08:16 -0700 Subject: [PATCH] Fallback to bundled version if selected TS version is invalid Fixes #103213 This restores some logic that we removed during the web refactoring --- .../src/typescriptServiceClient.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/extensions/typescript-language-features/src/typescriptServiceClient.ts b/extensions/typescript-language-features/src/typescriptServiceClient.ts index 3f086292310..2a09c643727 100644 --- a/extensions/typescript-language-features/src/typescriptServiceClient.ts +++ b/extensions/typescript-language-features/src/typescriptServiceClient.ts @@ -366,6 +366,12 @@ export default class TypeScriptServiceClient extends Disposable implements IType } let version = this._versionManager.currentVersion; + if (!version.isValid) { + vscode.window.showWarningMessage(localize('noServerFound', 'The path {0} doesn\'t point to a valid tsserver install. Falling back to bundled TypeScript version.', version.path)); + + this._versionManager.reset(); + version = this._versionManager.currentVersion; + } this.info(`Using tsserver from: ${version.path}`);