If the users selects a language, let's have it actually choose the language they selected. (Yaml vs yaml)#288153
Merged
bpasero merged 3 commits intomicrosoft:mainfrom Jan 16, 2026
Conversation
…nguage they selected. (Yaml vs yaml)
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @bpaseroMatched files:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in the language selection feature where selecting a language (e.g., "YAML") from the quick pick would not reliably select the correct language ID due to case-sensitive fuzzy lookup. The fix replaces the indirect lookup via languageName with direct usage of the languageId stored in the quick pick item's id field.
Changes:
- Added
id: languageIdfield to language quick pick items to store the precise language ID - Changed language selection logic to use
pick.idinstead of performing a fuzzy name lookup viagetLanguageIdByLanguageName(pick.label)
Comments suppressed due to low confidence (1)
src/vs/workbench/browser/parts/editor/editorStatus.ts:1289
- This line still uses the old fuzzy lookup approach via
getLanguageIdByLanguageName(pick.label). It should be updated to usepick.idfor consistency with the fix on line 1284. This inconsistency could cause the telemetry to report incorrect language IDs when the label doesn't match exactly (e.g., 'YAML' vs 'yaml').
const chosenLanguageId = languageService.getLanguageIdByLanguageName(pick.label) || 'unknown';
Member
|
What bug does this fix? |
Contributor
Author
|
When multiple languages exist with differently cased names. You can only change to one of them. Eg Yaml vs yaml then no matter which you select, it'll choose Yaml. This lets you select either one . |
bpasero
approved these changes
Jan 16, 2026
dmitrivMS
approved these changes
Jan 16, 2026
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.
Untested - Use Id instead of fuzzy lookup (Yaml vs yaml)
Too simple for an issue.
Two line change which changes identifying with a string to identifying them with the id. WOW