Skip to content

Commit

Permalink
Fix TS Version Selector When Local Version == Global Version (#19593)
Browse files Browse the repository at this point in the history
**Bug**
When the global tsdk setting points to the workspace version of typescript, our ts selector interface can get confused on which version is currently active

**Fix**
Adds a check using the local storage value to show the correct active version
  • Loading branch information
mjbvz committed Jan 31, 2017
1 parent 0c2e4a4 commit 6e03d49
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions extensions/typescript/src/typescriptServiceClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient
return Promise.resolve(modulePath);
}

const useWorkspaceVersionSetting = this.workspaceState.get<boolean>(TypeScriptServiceClient.useWorkspaceTsdkStorageKey, false);
const shippedVersion = this.getTypeScriptVersion(this.globalTypescriptPath);
const localModulePath = this.localTypeScriptPath;
let messageShown: Thenable<MyQuickPickItem | undefined>;
Expand All @@ -507,12 +508,12 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient
{
label: localize('useWorkspaceVersionOption', 'Use Workspace Version'),
description: localVersion || '',
detail: modulePath === localModulePath ? localize('activeVersion', 'Currently active') : '',
detail: modulePath === localModulePath && (modulePath !== this.globalTypescriptPath || useWorkspaceVersionSetting) ? localize('activeVersion', 'Currently active') : '',
id: MessageAction.useLocal
}, {
label: localize('useVSCodeVersionOption', 'Use VSCode\'s Version'),
description: shippedVersion || '',
detail: modulePath === this.globalTypescriptPath ? localize('activeVersion', 'Currently active') : '',
detail: modulePath === this.globalTypescriptPath && (modulePath !== localModulePath || !useWorkspaceVersionSetting) ? localize('activeVersion', 'Currently active') : '',
id: MessageAction.useBundled,
}, {
label: localize('learnMore', 'Learn More'),
Expand Down

0 comments on commit 6e03d49

Please sign in to comment.