Skip to content

Quick pick: match the Hangul syllable an IME is still composing - #350141

Open
wonjang (wonjangcloud9) wants to merge 1 commit into
microsoft:mainfrom
wonjangcloud9:fix/quick-pick-partial-hangul
Open

wonjang (wonjangcloud9) wants to merge 1 commit into
microsoft:mainfrom
wonjangcloud9:fix/quick-pick-partial-hangul

Conversation

@wonjangcloud9

Copy link
Copy Markdown

Fixes #192789

Typing Korean builds each syllable from keystrokes, so while you type the last character of a query is usually unfinished. To reach 터미널, the box shows ㅌ, then 터, then 털 (the IME's guess) before the next syllable. Today matchesWords only finds 터미널 once 터 is complete, so the Command Palette shows nothing after ㅌ. Naver and Google treat the last character as partial (see the issue).

Change (src/vs/base/common/filters.ts): in _matchesWordsCompute, the last character of the query also matches a target Hangul syllable that it starts. "Starts" is judged by the keystrokes getKoreanAltChars already produces for the Korean-on-QWERTY matching:

query char keys target keys match
ㅌ x 터 xj yes
미 al 밋 alt yes
고 rh 과 rhk yes (the IME turns 고+ㅏ into 과)
ㄱ r 나 sk no

Only the last query character gets this, so ㅌ미 does not match 터미널. Characters before it are complete and still have to match exactly. The check returns early unless the target character is a Hangul syllable (U+AC00–U+D7A3), so non-Korean labels skip the extra work.

Not covered: a final consonant the IME later moves to the next syllable (typing 가고 shows 각 for a moment). That needs the query's last two characters re-split, so I left it out of this change.

Tests (filters.test.ts, WordFilter): ㅌ → 터미널: 새 터미널 만들기, 커미 → 커밋, 고 → 과일, 새 ㅌ → the second 터미널, and two negatives (ㅌ미 / 터미널, ㄱ / 나). I ran filters.test.ts and naturalLanguage/korean.test.ts under bun with a small mocha shim, not the repo's runner. With the change: 41 pass, 1 skipped (perf). Without it: the new WordFilter cases fail (ㅌ didn't match 터미널: 새 터미널 만들기).

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 24, 2026 13:38

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.

🟢 Approval recommended

No active review issues remain for the change enabling quick-pick matching of unfinished Hangul characters.

No open issues 🎉

What changed in this PR

Addresses #192789 by letting quick-pick word matching recognize an unfinished final Hangul character, so Korean queries can find commands before the IME completes the syllable.

Changes:

  • Compares Korean keystroke prefixes for the final query character while preserving existing matching for earlier characters.
  • Adds regression cases for partial consonants, syllable extensions, word boundaries, and non-matches.

No actionable findings remain. Reported tests used a Bun/Mocha shim rather than the repository’s test runner.

File Description
src/​vs/​base/​test/​common/​filters.test.ts Adds positive and negative partial-Hangul matching cases.
src/​vs/​base/​common/​filters.ts Adds final-character Hangul prefix matching and includes partial matches in highlight ranges.

Review effort: Balanced

@wonjangcloud9

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

This branch has not been deployed

No deployments
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.

Quick pick: Support searching hangul treating last character as partially formed

2 participants