I've recently been looking into integrating clojure-lsp with Sublime Text and I definitely agree, clojure-lsp is a real hidden gem.
awesome, thanks
Looks like clojure-lsp always reports defrecord
s and their parameters as unused. Is it something that should work, or has it just not been implemented yet?
@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.
Well it's all about scratching your itches. Gotta figure out how much it bugs you and your team.
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?
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. 🙂
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.
If that sounds plausible to you, I can throw a PR your way tomorrow.
Just need to work through all of the possible defrecord
arities. 😓
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
Yep, I found lein test-refresh
. It seems to syntax error out on me all the time for some reason, though.
Anyway, it'll get the job done. Thanks for the tip about the log file, though. :thumbsup:
hey, thanks for diving in!
Sure! It's interesting stuff. I'll continue later — time for sleep.