lsp

:clojure-lsp: Clojure implementation of the Language Server Protocol: https://clojure-lsp.io/
anonimitoraf 2021-02-16T02:31:55.156Z

My thoughts exactly too

borkdude 2021-02-16T17:11:03.156500Z

Showing the new keyword analysis support in clojure-lsp towards the end in this video.

3
2
❤️ 2
ericdallo 2021-02-16T17:18:58.156900Z

Really good keyword analysis overview, thanks! 😄

👍 1
borkdude 2021-02-16T17:37:14.157300Z

@ericdallo Hmm, I have an issue though, it doesn't find the keyword :citation in two different files, even not after I have visited them both

ericdallo 2021-02-16T17:39:17.158Z

I think this is expected, since it's a simple keyword, not namespaced. so clojure-lsp cannot know that one keyword is related to other (and probably is not)

borkdude 2021-02-16T17:39:39.158200Z

eeeeeh

borkdude 2021-02-16T17:40:01.158400Z

I disagree here. It should find all my usages of :citation

borkdude 2021-02-16T17:40:17.158600Z

That's the entire point of using this over grep

snoe 2021-02-16T17:41:26.158800Z

yup, it should find all references

snoe 2021-02-16T17:42:00.159Z

keywords are effectively global symbols

ericdallo 2021-02-16T17:43:39.159200Z

We could do that, I just thought that was expected when implementing it 😅

ericdallo 2021-02-16T17:49:47.159400Z

@snoe should it consider the :keys-destructuring too?

snoe 2021-02-16T17:55:19.159700Z

yeah if you have :x (let [{:keys [x]} a] x) it should find two usages if you search from col0 (searching for references from the destructured x, should find the local and not the keyword (same logic as rename)

👍 1
snoe 2021-02-16T18:10:13.160100Z

and related, I'm pretty sure the pre-kondo version would not allow you to rename simple keywords.

borkdude 2021-02-16T18:45:49.160300Z

Thanks for considering this @ericdallo and @snoe! I had to go for dinner

ericdallo 2021-02-16T19:26:20.160500Z

https://github.com/clojure-lsp/clojure-lsp/commit/6966bd25f7d823aa06ab36c795aeb7fe30db911c @borkdude ! it should be available on next release 🙂 Also we don't allow rename simple keywords now with that @snoe

borkdude 2021-02-16T19:26:53.160700Z

Very good! Only finding them is good enough for me to be able to rename

👍 1
snoe 2021-02-16T20:03:46.161Z

yeah rename is just pretty scary if you start cascading to locals.

snoe 2021-02-16T20:04:04.161200Z

some people will be surprised with either choice you make i believe.

👍 1