Fork me on GitHub
#lsp
<
2022-01-21
>
pdmct03:01:00

Hi, I have clojure-lsp installed and working with regular clojure code, but when I edit the code that uses clara rules I get a lot of lsp errors raised, to the extent that it hits the error threshold and stops. I can raise the threshold, but I would rather like to not raise the errors on the macros it doesn’t seem to understand. Having done that if feels like it gets a big sluggish too. Do i have to add some config to get it to recognise the rule forms? Is there any examples of this? or Is there some doco of how to do that somewhere? Thanks

kommen09:01:07

upgrading clojure-lsp via homebrew currently fails for me on macos:

$ brew upgrade
==> Upgrading 1 outdated package:
clojure-lsp/brew/clojure-lsp-native 2022.01.03-19.46.10 -> 2022.01.20-14.12.43
==> Downloading 
curl: (22) The requested URL returned error: 404

Error: clojure-lsp-native: Failed to download resource "clojure-lsp-native"
Download failed: 

kommen09:01:23

thank you!

ericdallo12:01:26

sorry, I didn't rollback homebrew, the fix should be available soon!

gdanov09:01:00

how do I add “parsing” rules for macros so that lsp can infer all the symbols? done this before the kondo migration, now I can’t figure it out from the documentation. is it a custom linter or a hook?

borkdude09:01:52

@gdanov clojure-lsp now uses clj-kondo for its analysis. so if you add a clj-kondo hook that makes the macro understandable for clj-kondo, then it will also work for lsp

gdanov09:01:42

thanks, like this I guess https://github.com/clj-kondo/clj-kondo/blob/master/doc/hooks.md another thing: is there a way to package the custom hooks with my library so that other projects using my library would automatically get the hooks and the proper LSP treatment?

borkdude10:01:08

yes :) see the same document under exporting and importing

borkdude10:01:16

You can see a list of examples of libraries that do that here: https://github.com/clj-kondo/clj-kondo/issues/1383

gdanov10:01:02

:thumbsup: