This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-21
Channels
- # announcements (26)
- # aws (1)
- # babashka (40)
- # beginners (36)
- # calva (9)
- # cider (38)
- # clara (5)
- # clj-commons (4)
- # clj-kondo (29)
- # cljs-dev (8)
- # cljsrn (2)
- # clojars (12)
- # clojure (151)
- # clojure-europe (16)
- # clojure-gamedev (1)
- # clojure-nl (2)
- # clojure-uk (7)
- # clojurescript (2)
- # copenhagen-clojurians (2)
- # datalevin (18)
- # fulcro (7)
- # graphql (7)
- # gratitude (9)
- # helix (2)
- # honeysql (3)
- # introduce-yourself (1)
- # jobs (1)
- # lsp (13)
- # malli (10)
- # nextjournal (2)
- # off-topic (13)
- # pathom (1)
- # pedestal (2)
- # portal (4)
- # remote-jobs (1)
- # ring-swagger (1)
- # shadow-cljs (21)
- # specter (1)
- # testing (2)
- # tools-build (6)
- # vim (2)
- # xtdb (5)
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
See https://clojure-lsp.io/settings/#clj-kondo and https://github.com/clj-kondo/clj-kondo/blob/master/doc/config.md#lint-a-custom-macro-like-a-built-in-macro
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:
its this reason here: https://clojurians.slack.com/archives/CPABC1H61/p1642709484091700?thread_ts=1642708907.086800&cid=CPABC1H61
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?
@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
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?
no sorry, that's another document: https://github.com/clj-kondo/clj-kondo/blob/master/doc/config.md#exporting-and-importing-configuration
You can see a list of examples of libraries that do that here: https://github.com/clj-kondo/clj-kondo/issues/1383