lsp

:clojure-lsp: Clojure implementation of the Language Server Protocol: https://clojure-lsp.io/
flowthing 2020-05-13T04:10:55.051800Z

I've recently been looking into integrating clojure-lsp with Sublime Text and I definitely agree, clojure-lsp is a real hidden gem.

snoe 2020-05-13T14:18:53.052100Z

awesome, thanks

flowthing 2020-05-13T18:06:14.053Z

Looks like clojure-lsp always reports defrecords and their parameters as unused. Is it something that should work, or has it just not been implemented yet?

snoe 2020-05-13T18:41:05.055100Z

@flowthing I think it should work - there's code in parser.clj that tries to handle defrecords, but I rarely use defrecord in my project so I haven't scratched too hard at that itch. If you produce a small test case I think the tests are a good place to get started or it helps me dive in when I have time.

snoe 2020-05-15T00:00:33.057800Z

Well it's all about scratching your itches. Gotta figure out how much it bugs you and your team.

🎯 1
flowthing 2020-05-13T18:43:08.055200Z

All right, thanks! A minimal test case is just (defrecord Foo [bar baz]) (->Foo :a 1). I'll file an issue or maybe even consider making a PR if I get the chance. Any tips on how to best get started hacking on clojure-lsp?

flowthing 2020-05-13T18:49:43.055500Z

Although I guess as long as I'm not working on data that's coming from an editor or something, I don't really need any tips to get started. 🙂

flowthing 2020-05-13T19:33:49.055800Z

Hmm… could it be that clojure-lsp attaches signatures to the user.Foo class but not the constructor functions user/map->Foo and user/->Foo? It looks like clojure-lsp handlers (Foo. :a 1) correctly.

flowthing 2020-05-13T19:34:05.056Z

If that sounds plausible to you, I can throw a PR your way tomorrow.

flowthing 2020-05-13T19:37:12.056200Z

Just need to work through all of the possible defrecord arities. 😓

snoe 2020-05-13T19:37:56.056400Z

yup makes sense. If I have a repro, I find the easiest way is to run lein test-refresh - there's also a nrepl port that runs that you can see in /tmp/lsp.out

flowthing 2020-05-13T19:38:43.056600Z

Yep, I found lein test-refresh . It seems to syntax error out on me all the time for some reason, though.

flowthing 2020-05-13T19:39:05.056800Z

Anyway, it'll get the job done. Thanks for the tip about the log file, though. :thumbsup:

snoe 2020-05-13T19:43:35.057100Z

hey, thanks for diving in!

flowthing 2020-05-13T19:51:59.057300Z

Sure! It's interesting stuff. I'll continue later — time for sleep.