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

LSP autocomplete should support fuzzy search #5511

Open
pintassilgo opened this issue May 7, 2024 · 9 comments
Open

LSP autocomplete should support fuzzy search #5511

pintassilgo opened this issue May 7, 2024 · 9 comments
Labels

Comments

@pintassilgo
Copy link

pintassilgo commented May 7, 2024

VSCode:
image

Sublime:
image

Kate:
image

CudaText after typing qa: there's no autocomplete suggestion, I need to type queryselectora which is way slower.

All these three editors use full-fuzzy for these autocomplete, but I guess the ideal would be to use the "smart fuzzy" implemented here, which is also used by VSCode for Command palette.

@Alexey-T
Copy link
Owner

Alexey-T commented May 7, 2024

Hello @veksha , can you see it please?

@pintassilgo
Copy link
Author

pintassilgo commented May 7, 2024

Moved to #5513 by Alexey

1 similar comment
@pintassilgo
Copy link
Author

pintassilgo commented May 7, 2024

Moved to #5513 by Alexey

@Alexey-T
Copy link
Owner

Alexey-T commented May 8, 2024

My function is_fuzzy_match is here:
https://github.com/CudaText-addons/cuda_complete_from_text/blob/master/__init__.py

I tried to reuse it for LSP. here:
language.py

    def filter(self, item, word):
        s1 = item['label'] if item.get('filterText') is None else item.get('filterText')
        s2 = word
        pos_bracket = s1.find('(')
        s1 = s1 if pos_bracket == -1 else s1[:pos_bracket]
        print('filter for:', s1, s2)
        return is_fuzzy_match(s1, s2)

don't work!
def filter is not called at all if I call completion after word 'TE' and have id 'TIME_BEGIN' in code.

@pintassilgo pintassilgo changed the title Autocomplete (LSP / Complete_from_text) should support fuzzy search LSP autocomplete should support fuzzy search May 8, 2024
@Alexey-T
Copy link
Owner

Alexey-T commented May 8, 2024

So the fuzzy is requiring the server support and/or some LSP client option must be changed. this is for @veksha , please.

@Alexey-T
Copy link
Owner

Alexey-T commented May 17, 2024

I dont see in web-search how to allow fuzzy in LSP servers settings for other editors. maybe only few servers have setting. so we cannot solve it in common way, yes, @veksha ?

@Alexey-T Alexey-T closed this as not planned Won't fix, can't repro, duplicate, stale May 18, 2024
@pintassilgo
Copy link
Author

Why was this closed? Don't you agree this is a good feature to have?

@Alexey-T Alexey-T reopened this May 18, 2024
@Alexey-T
Copy link
Owner

Reopened. but I guess it is impossible to add, see my prev comment.

@pintassilgo
Copy link
Author

I understand you don't know how to fix, but I see no reason for it to be impossible. I use the same LSP server in all the examples I gave (typescript-language-server), surely it's doable for someone.

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

No branches or pull requests

2 participants