Clarify TypeScript version picker UI when workspace version is manually configured#269527
Open
magliocchetti wants to merge 2 commits intomicrosoft:mainfrom
Open
Conversation
Fixes microsoft#263226 The "TypeScript: Select TypeScript Version..." command was showing incorrect information about which TypeScript version was active when users manually configured `typescript.tsdk` in their settings. The issue was that the indicator logic checked the `useWorkspaceTsdkSetting` workspace state flag (only set when selecting through the picker UI) rather than checking which version was actually being used (`currentVersion`). This caused the UI to show the bundled version as active even when the workspace version was actually in use. Changes: - Simplified indicator logic in `getBundledPickItem()` to check `currentVersion.eq(bundledVersion)` instead of the state flag - Simplified indicator logic in `getLocalPickItems()` to check `currentVersion.eq(version)` instead of the state flag - Removed unnecessary workspace trust checks from indicator logic The indicator now accurately reflects the active TypeScript version regardless of whether it was configured manually or through the picker. Signed-off-by: Giovanni Magliocchetti <giovimag123@gmail.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where the TypeScript version picker showed incorrect active version indicators when users manually configured typescript.tsdk in their workspace settings. The fix simplifies the logic to directly check which version is actually active rather than relying on UI state flags.
- Simplified indicator logic in version picker to directly compare current version with available versions
- Removed dependency on workspace state flag that wasn't set for manual configurations
- Fixed mismatch between displayed active version and actually used version
mjbvz
reviewed
Oct 2, 2025
Collaborator
mjbvz
left a comment
There was a problem hiding this comment.
The current UI is confusing but it was actually designed to work like this. The most important info in this UI if the workspace or bundled TS version is being used
Instead of strictly checking the version, I think we should clarify the UI:
- Still show which type of TS the user has selected (workspace vs bundled)
- For cases where there is a mismatch between the active version and provided version, show a more detailed message. Something like
Workspace version (Currently Active: 5.9 Found: 5.7)
…ly configured Fixes microsoft#263226 When users manually configure `typescript.tsdk` in their workspace settings (without using the version picker), the "TypeScript: Select TypeScript Version..." command showed confusing information. The bundled version appeared selected (with bullet indicator) even though the workspace version was actually active. The UI was designed to show which version type the user has explicitly selected through the picker, not which version is currently active. This caused confusion when there was a mismatch between selection and active version. This change adds clarifying text to the version picker to distinguish between "selected" and "currently active" versions: - When workspace version is active but not explicitly selected (e.g., manually configured in settings), shows: "5.9.1 (Currently Active)" - When bundled version is selected but a different version is active (rare case), shows: "5.8.3 (Currently Active: 5.9.1)" The bullet indicator (•) continues to show the user's explicit selection, maintaining backward compatibility with existing UI conventions while adding clarity about which version is actually running. Signed-off-by: Giovanni Magliocchetti <giovimag123@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #263226
Improves the "TypeScript: Select TypeScript Version..." UI by adding clarifying text when there's a mismatch between the user's explicit selection and the currently active TypeScript version.
Problem
When users manually set
"typescript.tsdk": "node_modules/typescript/lib"in their workspace settings (without using the version picker), the UI was confusing:This caused confusion about which TypeScript version was being used.
Root Cause
The version picker UI was designed to show which version type the user has explicitly selected through the picker (tracked by workspace state), not which version is currently active. When users manually configure
typescript.tsdkin settings.json:Solution
Following maintainer feedback, this PR clarifies the UI rather than changing the selection indicator logic:
Specific Changes
Workspace version active but not selected (the reported issue):
"5.9.1 (Currently Active)"Bundled version selected but different version active (rare edge case):
"5.8.3 (Currently Active: 5.9.1)"Behavior
Before (confusing)
No indication that workspace version is actually active!
After (clear)
Now clearly shows workspace version is active.
Impact
TypeScript: Select TypeScript Version...shows incorrect info #263226Testing
Manually tested scenarios:
typescript.tsdk→ workspace version shows "(Currently Active)"Files Changed
extensions/typescript-language-features/src/tsServer/versionManager.ts