Closed GitMurf closed 2 weeks ago
Hi and glad you're enjoying it. I agree that match strategy can be more loose. Let me think if we want to have a global setting or individual per buffer and snippet completions. I am leaning towards individual one but would like to sleep on this. I will take a look tomorrow.
Thanks for the suggestion
UPD: late travel, still plan to do this in the new few days
I've opened a PR #9 that adds multiple completion strategies. I will let it hang for a day or two before merging. Feel free to comment/review.
Great job on the LSP! I am testing it with Neovim right now and it is working nicely.
One thing that would be very useful is to add a setting for ability to match more fuzzily for snippet candidates. Currently there are two "problems" for me (see the link to the specific code below):
I often do not know exactly what my snippet is called and especially what it starts with, so if I type "diagnostic" I would like it to match my snippet that is called
disableDiagnosticError
. Current the snippet will only show up if I start with "disabl...". Instead of using astartsWith
it would be nice to just match any part of the string.Currently the matches are case sensitive. So in my previous example, if I start typing "Disabl..." it will not match because it starts with "disabl..." (lower case). Would be nice if you could do a toLowerCase for them before comparing.
Snippets are very important to me and unlike buffer text, there are far less (most the time) so being more loose with how many snippets are matched and returned I think is more appropriate than buffer words.
https://github.com/antonk52/basics-language-server/blob/dc2f861d1c4df57b447efbde164862a0cf982cda/src/connection.ts#L244-L249