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
feat(vscode): support autocomplete with fuzzy search. #2769
Conversation
✅ Deploy Preview for unocss ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
packages/autocomplete/src/utils.ts
Outdated
* @returns | ||
*/ | ||
export function searchFuzzy(list: string[], keyword: string) { | ||
const regex = new RegExp(keyword.split('').join('.*')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creating a new regex for every change does not sound very efficient to me. Can we use fzf
or Fuse.js
to do it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! Fzf can dot it better.
Features:
1. Support autocomplete with fuzzy search.
Just like Windicss Intellisense
2023-06-16.11.32.40.mov
this feature need set match type to be 'fuzzy'
2. Add autocomplete max items configure.
For better performance during fuzzy search, we need add a setting for the maximum number of items