Skip to content

Strip codicons from terminal quickpick filter matching - #313197

Merged
Megan Rogge (meganrogge) merged 2 commits into
microsoft:mainfrom
yogeshwaran-c:fix/terminal-quickpick-codicon-filter-153829
May 8, 2026
Merged

Megan Rogge (meganrogge) merged 2 commits into
microsoft:mainfrom
yogeshwaran-c:fix/terminal-quickpick-codicon-filter-153829

Conversation

@yogeshwaran-c

Copy link
Copy Markdown
Contributor

Summary

Typing in the terminal quickpick (`term` prefix) filter could highlight inside the `$(icon-id)` codicon syntax of each item's label, instead of only matching against the visible text.

Root cause

`terminalQuickAccess.ts` built each label as ```````````````` and ran `matchesFuzzy(filter, label, true)` against the entire string. The fuzzy match included the literal `$(...)` codicon prefix, so a query like `err` would highlight inside an `$(error)` icon.

Fix

Use the icon-aware helpers `matchesFuzzyIconAware` + `parseLabelWithIcons` from `base/common/iconLabels.ts` — the same pair that the base `quickInputList` already uses for its own matching. `parseLabelWithIcons` strips the icon syntax for matching while returning offsets remapped back to the original label so highlights land on the visible text.

cc TylerLeonhardt — your comment in #153829 pointed at this exact pattern ("You probably wanna do what we do in the quick pick base"). Two-line change in `terminalQuickAccess.ts`.

Test plan

  • Open terminal quickpick (`term`)
  • Type a substring that appears in any `$(icon)` source (e.g. `err`, `debug`)
  • Highlights only land on the visible text, not inside icon syntax

Fixes #153829

The terminal quick access provider built labels like
\`$(icon-id) 1: Title\` and ran matchesFuzzy directly against the full
string, so typing letters that happened to appear inside the codicon
syntax (e.g. searching for \"err\" while a terminal had a \`$(error)\`
icon) highlighted into the icon source.

Use matchesFuzzyIconAware + parseLabelWithIcons instead, which is the
helper the base quickInputList already uses for its own icon-aware
matching. parseLabelWithIcons strips the icon syntax for matching while
returning offsets remapped back to the original label, so highlights
land on the visible text.

Fixes microsoft#153829
Copilot AI review requested due to automatic review settings April 29, 2026 10:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 terminal quick access (the term quickpick) fuzzy-filter highlighting so it doesn’t match/highlight inside codicon markup ($(icon-id)), aligning terminal quick access matching behavior with the base QuickPick list.

Changes:

  • Replace raw matchesFuzzy matching on the label with icon-aware matching via matchesFuzzyIconAware.
  • Use parseLabelWithIcons to strip codicon syntax for matching while remapping highlight offsets back onto the original label.

@meganrogge Megan Rogge (meganrogge) added this to the 1.120.0 milestone May 7, 2026
@meganrogge
Megan Rogge (meganrogge) enabled auto-merge (squash) May 7, 2026 14:13
@meganrogge
Megan Rogge (meganrogge) merged commit 3b8129f into microsoft:main May 8, 2026
28 of 47 checks passed
Will Pfleger (wpfleger96) added a commit to wpfleger96/vscode that referenced this pull request May 8, 2026
…itle

* main:
  Fixes tests
  Escapes model id in chatEditHunk event
  Strip codicons from terminal quickpick filter matching (microsoft#313197)
  Approval telemetry (microsoft#315215)
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Jun 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Codicons should be excluded from the quick pick's filtering

5 participants