Skip to content

Strip codicons from terminal quickpick filter matching#313197

Open
yogeshwaran-c wants to merge 1 commit intomicrosoft:mainfrom
yogeshwaran-c:fix/terminal-quickpick-codicon-filter-153829
Open

Strip codicons from terminal quickpick filter matching#313197
yogeshwaran-c wants to merge 1 commit intomicrosoft: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
Copy link
Copy Markdown
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 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 meganrogge added this to the 1.120.0 milestone May 7, 2026
@meganrogge meganrogge enabled auto-merge (squash) May 7, 2026 14:13
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.

Codicons should be excluded from the quick pick's filtering

4 participants