Skip to content

Conversation

@Infro
Copy link
Contributor

@Infro Infro commented Jan 15, 2026

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

Copilot AI review requested due to automatic review settings January 15, 2026 19:24
@vs-code-engineering
Copy link

vs-code-engineering bot commented Jan 15, 2026

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@bpasero

Matched files:

  • src/vs/workbench/browser/parts/editor/editorStatus.ts

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: languageId field to language quick pick items to store the precise language ID
  • Changed language selection logic to use pick.id instead of performing a fuzzy name lookup via getLanguageIdByLanguageName(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 use pick.id for 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';

@bpasero bpasero assigned bpasero and unassigned hediet Jan 16, 2026
@bpasero bpasero added info-needed Issue requires more information from poster and removed triage-needed labels Jan 16, 2026
@bpasero
Copy link
Member

bpasero commented Jan 16, 2026

What bug does this fix?

@Infro
Copy link
Contributor Author

Infro commented Jan 16, 2026

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 bpasero removed the info-needed Issue requires more information from poster label Jan 16, 2026
@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 16, 2026
@bpasero bpasero enabled auto-merge (squash) January 16, 2026 16:06
@bpasero bpasero merged commit cce0642 into microsoft:main Jan 16, 2026
17 checks passed
dmitrivMS added a commit that referenced this pull request Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants