diff --git a/extensions/typescript/src/typescriptMain.ts b/extensions/typescript/src/typescriptMain.ts index 3938f9888f2ffa8ad37996fbc50b96fcca595268..197cff2b6ef767f2821665a68a4e2466370441fb 100644 --- a/extensions/typescript/src/typescriptMain.ts +++ b/extensions/typescript/src/typescriptMain.ts @@ -94,7 +94,7 @@ export function activate(context: ExtensionContext): void { let clientHost: TypeScriptServiceClientHost | undefined; return () => { if (!clientHost) { - clientHost = new TypeScriptServiceClientHost(standardLanguageDescriptions, context.storagePath, context.globalState, context.workspaceState, plugins); + clientHost = new TypeScriptServiceClientHost(standardLanguageDescriptions, context.storagePath, context.workspaceState, plugins); context.subscriptions.push(clientHost); const host = clientHost; @@ -457,7 +457,6 @@ class TypeScriptServiceClientHost implements ITypescriptServiceClientHost { constructor( descriptions: LanguageDescription[], storagePath: string | undefined, - globalState: Memento, workspaceState: Memento, plugins: TypeScriptServerPlugin[] ) { @@ -479,7 +478,7 @@ class TypeScriptServiceClientHost implements ITypescriptServiceClientHost { this.versionStatus = new VersionStatus(); this.disposables.push(this.versionStatus); - this.client = new TypeScriptServiceClient(this, storagePath, globalState, workspaceState, this.versionStatus, plugins, this.disposables); + this.client = new TypeScriptServiceClient(this, storagePath, workspaceState, this.versionStatus, plugins, this.disposables); this.languagePerId = Object.create(null); for (const description of descriptions) { const manager = new LanguageProvider(this.client, description); diff --git a/extensions/typescript/src/typescriptServiceClient.ts b/extensions/typescript/src/typescriptServiceClient.ts index 5dbe275c7ae1c13595dc8ecf3bedd63274a3b772..84f35f4f11c8f2bc9a4f2f9c22a36acd23820107 100644 --- a/extensions/typescript/src/typescriptServiceClient.ts +++ b/extensions/typescript/src/typescriptServiceClient.ts @@ -163,9 +163,6 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient private static readonly WALK_THROUGH_SNIPPET_SCHEME = 'walkThroughSnippet'; private static readonly WALK_THROUGH_SNIPPET_SCHEME_COLON = `${TypeScriptServiceClient.WALK_THROUGH_SNIPPET_SCHEME}:`; - private host: ITypescriptServiceClientHost; - private storagePath: string | undefined; - private globalState: Memento; private pathSeparator: string; private modulePath: string | undefined; @@ -197,18 +194,13 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient private telemetryReporter: TelemetryReporter; constructor( - host: ITypescriptServiceClientHost, - storagePath: string | undefined, - globalState: Memento, + private readonly host: ITypescriptServiceClientHost, + private readonly storagePath: string | undefined, private readonly workspaceState: Memento, private readonly versionStatus: VersionStatus, - - private plugins: TypeScriptServerPlugin[], + private readonly plugins: TypeScriptServerPlugin[], disposables: Disposable[] ) { - this.host = host; - this.storagePath = storagePath; - this.globalState = globalState; this.pathSeparator = path.sep; this.lastStart = Date.now(); @@ -400,8 +392,6 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient return this.getDebugPort().then(debugPort => ({ modulePath, debugPort })); }).then(({ modulePath, debugPort }) => { return this.servicePromise = new Promise((resolve, reject) => { - const tsConfig = workspace.getConfiguration('typescript'); - this.info(`Using tsserver from: ${modulePath}`); if (!fs.existsSync(modulePath)) { window.showWarningMessage(localize('noServerFound', 'The path {0} doesn\'t point to a valid tsserver install. Falling back to bundled TypeScript version.', modulePath ? path.dirname(modulePath) : '')); @@ -426,15 +416,6 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient this.versionStatus.showHideStatus(); this.versionStatus.setInfo(label, tooltip); - // This is backwards compatibility code to move the setting from the local - // store into the workspace setting file. - const doGlobalVersionCheckKey: string = 'doGlobalVersionCheck'; - const globalStateValue = this.globalState.get(doGlobalVersionCheckKey, true); - const checkTscVersion = 'check.tscVersion'; - if (!globalStateValue) { - tsConfig.update(checkTscVersion, false, true); - this.globalState.update(doGlobalVersionCheckKey, true); - } this.sequenceNumber = 0; this.requestQueue = [];