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

Conversation

christophediprima
Copy link

Missing a letter is allowed by matchSumOfSquares so it makes more sense to make filtering case insensitive.

Missing a letter is allowed by matchSumOfSquares so it makes more sense to make filtering case insensitive.
Copy link

Thanks for making a pull request to jupyterlab!
To try out this branch on binder, follow this link: Binder

Copy link

welcome bot commented Mar 8, 2024

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@christophediprima christophediprima changed the title Case unsensitive match for completion items filtering Case insensitive match for completion items filtering Mar 8, 2024
@krassowski krassowski added this to the 4.2.0 milestone Mar 8, 2024
Copy link
Member

@krassowski krassowski left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution @christophediprima.

It certainly does make sense to allow this as a setting. jupyterlab-lsp has a setting for it here. As whatever the default should be - opinions will vary.

Can you try to add the setting and unit tests for completion with this case sensitive and insensitive matchin on and off?

@christophediprima
Copy link
Author

Sure but I am a bit busy right now. I will have a look when I come back from holidays! :)

@krassowski
Copy link
Member

@christophediprima did you have a chance to take another look? It seems to have missed to 4.2 merge window, I will switch this PR to draft.

@krassowski krassowski marked this pull request as draft April 3, 2024 10:35
@krassowski krassowski modified the milestones: 4.2.0, 4.3.0 Apr 16, 2024
@@ -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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request for Case-Insensitive Filtering in completer extension
3 participants