vim 2023-04-04

I'm using ALE for linting in vim and it complains about macros from imported libraries, eg:

;;; defnc is from helix
(defnc my-component [{:keys [pdf-path]}] ; E: error: Unresolved symbol: my-component

✅ 1

What ALE uses as it's backend for linting, if it uses Kondo you can create this file: https://github.com/rafaeldelboni/helix-refx-reitit-example/blob/main/.clj-kondo/config.edn

thank you!

(yes, it's Kondo, and looking into it I find that it also looks for `joker' on one's path)

I searched a lil bit about it and I saw that you have options of those two sources, quite cool, the good part of using kondo, is that if you decide to go using lsp in the future you wont have any extra config to make it work 🙂

yeah I am irrational about lsp

my editor talking to the world every time I type something...

I am glad that this is not yet required to have a great editor experience

But with LSP you don't need internet, is a local process, your computer starts a server that talks in a json protocol.

I see... somehow I'd gotten the impression that the default was a public server

is there anything more I have to do to get that hook working?

No, I think it's because the json protocol can lead to this, but it's local. The good part is that most of the editors know how to talk this protocol and the "server" is responsible to parser your code and return the editor requests, with cache and all that.

It is still complaining of unresolved symbol when i use the defnc macro

No, double check if the file is in the same path root-your-project/.clj-kondo/config.edn

dunno if there is an extra for ALE check this file

i put it in .config/clj-kondo, and also tried specifying it on the command line

clj-kondo --config ~/.config/clj-kondo/config.edn --lint ./src/dev/fdny/lss/evds.cljs

ah wait

you having problem with the defnc from helix or a macro wrapper you wrote over it?

no, just straightforward use of defnc

this was downloaded automatically by kondo, in my first example I had to write a wrapper over defnc (as helix recomends) so I added that extra config

depending of your project structure it should download helix configs automatically

I have a shadow-cljs project, nothing fancy about it

let me see if I can coax clj-kondo into downloading something

clj-kondo --lint "$(clojure -Spath)" --copy-configs --skip-lint

in the root of your project should do the trick

you can delete that file you created that I sent you at first (sorry)

do you usually commit the .clj-kondo dir?

(lsp downloads those for you automatically, just saying hahaha)

ha I may look in to lsp

I dunno, I ran your one-liner and my .clj-kondo remains empty

maybe folks in #clj-kondo could help you with this one 🙂

thanks for the chat; I'm reading the clj-kondo docs now

Yeah, feel free to ping me, I really like helix as well doing a lot of studies on it

looks like I need to include clj-kondo in my deps.edn

ok thanks I will

uhm interesting, I didn't knew about it

I would like to know if this will work

we will see

okay:

clj-kondo --lint "$(npx shadow-cljs classpath)" --copy-configs --skip-lint --lang cljs

so I needed to specify classpath from shadow-cljs