Thanks, as always @ericdallo!
Hmm, I've been noticing some code being deleted on-save 😞 I'll make a minimal reproduction tomorrow
@ericdallo I've raised: https://github.com/clojure-lsp/clojure-lsp/issues/396 Weird if I'm the only one experiencing this lol Thanks
FYI @nicdaoraf https://github.com/clojure-lsp/clojure-lsp/issues/399#issuecomment-814922383
Oh, interesting
If you could test if that branch fix your issue, it'd help
you can just checkout it and run make debug-bin
to generate a local clojure-lsp
Sweet, will do. Thanks
@ericdallo After using LSP for a few mins with that branch, haven't seen the issue so far 😄 I'll keep an eye out throughout the day tomorrow too
nice 🙂
The filtering of workspace symbols seems a bit weird. I think it only takes in the first 2 chars (and also, some search results don't even have those 2 chars)
@ericdallo I opened https://github.com/Yomguithereal/clj-fuzzy/issues/49for clj-fuzzy. It doesn't feel appropriate to put this algorithm into clj-fuzzy.
So, I'm thinking I just publish a separate lib (like https://github.com/lewang/flx, so maybe call it clj-flx
or something). Then I'll make a PR to clojure-lsp so that {:workspace-symbol-filter :flx}
uses the lib?
Oh, seems good 🙂
If the algo is better than the current one, I think we could just replace the clj-fuzzy with that new one
Right, ok. I'll write extensive unit tests to show how intuitive (or otherwise) it is
@ericdallo I've published https://github.com/anonimitoraf/clj-flx 🙂 I'll inject it into clojure-lsp later/tomorrow. Are there other parts of clojure-lsp that uses "fuzzy" candidate matching?
Nice! No, this is the only one :)
it's not perfect as it uses a fuzzy search, the idea is that it scores all symbols with your query and order by the score
Fuzzy meaning the search term has to be a substring of the searched term, no?
If so, should create-topic
be matched by the search term try-pop
?
no, is just a "smart" search: https://whatis.techtarget.com/definition/fuzzy-search#:~:text=A%20fuzzy%20search%20is%20a,correspond%20to%20the%20desired%20information.
we could probably tune the config I just used the defaults from https://github.com/Yomguithereal/clj-fuzzy
Ah, I see. I had the wrong expectations. Reading the doc for clj-fuzzy, I couldnt tell whether it uses all the algorithms together or the client (of the lib) has to pick which ones.
the client has to pick one
Feel free to improve that, I think it can be improved somehow
Maybe the score filter on the line below should check if it's equal to 0?