Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Case insensitive match for completion items filtering #15949

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/completer/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ export class CompleterModel implements Completer.IModel {
index > -1
? originalItem.label.substring(0, index)
: originalItem.label;
const match = StringExt.matchSumOfSquares(escapeHTML(text), query);
const match = StringExt.matchSumOfSquares(escapeHTML(text.toLowerCase()), query.toLowerCase());

Choose a reason for hiding this comment

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

I think using toLocaleLowerCase() instead of toLowerCase() might be a better call here. It tends to handle language-specific rules more gracefully, which could save us some headaches down the line. Plus, it aligns better with user expectations, especially in multilingual environments. Cheers!

// Filter non-matching items.
if (match) {
// Highlight label text if there's a match
Expand Down