vim

James Amberger 2023-04-04T17:51:37.986929Z

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
rafaeldelboni 2023-04-05T16:24:30.089699Z

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

James Amberger 2023-04-05T22:56:08.867799Z

thank you!

James Amberger 2023-04-05T22:57:58.284789Z

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

rafaeldelboni 2023-04-05T23:00:01.088469Z

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 🙂

James Amberger 2023-04-05T23:04:40.630029Z

yeah I am irrational about lsp

James Amberger 2023-04-05T23:04:55.068019Z

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

James Amberger 2023-04-05T23:05:23.290079Z

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

rafaeldelboni 2023-04-05T23:07:49.777119Z

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

James Amberger 2023-04-05T23:08:21.960699Z

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

James Amberger 2023-04-05T23:08:29.608279Z

hm.

James Amberger 2023-04-05T23:09:54.598819Z

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

rafaeldelboni 2023-04-05T23:10:16.341259Z

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.

James Amberger 2023-04-05T23:11:16.619319Z

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

rafaeldelboni 2023-04-05T23:11:44.845489Z

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

rafaeldelboni 2023-04-05T23:11:59.430729Z

dunno if there is an extra for ALE check this file

James Amberger 2023-04-05T23:12:13.834699Z

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

James Amberger 2023-04-05T23:12:24.347369Z

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

rafaeldelboni 2023-04-05T23:14:35.349649Z

ah wait

rafaeldelboni 2023-04-05T23:15:38.991149Z

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

rafaeldelboni 2023-04-05T23:16:31.610049Z

usually kondo downloads some configs for the libraries https://github.com/rafaeldelboni/helix-refx-reitit-example/tree/main/.clj-kondo/lilactown/helix

James Amberger 2023-04-05T23:17:08.310399Z

no, just straightforward use of defnc

rafaeldelboni 2023-04-05T23:17:17.392859Z

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

rafaeldelboni 2023-04-05T23:18:44.658679Z

depending of your project structure it should download helix configs automatically

James Amberger 2023-04-05T23:18:59.073239Z

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

James Amberger 2023-04-05T23:19:11.668949Z

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

rafaeldelboni 2023-04-05T23:19:22.585649Z

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

rafaeldelboni 2023-04-05T23:19:35.354039Z

in the root of your project should do the trick

rafaeldelboni 2023-04-05T23:19:54.982699Z

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

James Amberger 2023-04-05T23:20:03.964099Z

🙂

James Amberger 2023-04-05T23:20:04.557149Z

ok

James Amberger 2023-04-05T23:20:50.031039Z

do you usually commit the .clj-kondo dir?

rafaeldelboni 2023-04-05T23:20:59.475209Z

I do

rafaeldelboni 2023-04-05T23:21:40.793299Z

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

James Amberger 2023-04-05T23:21:51.675319Z

ha I may look in to lsp

James Amberger 2023-04-05T23:23:16.164909Z

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

rafaeldelboni 2023-04-05T23:26:35.442969Z

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

James Amberger 2023-04-05T23:26:56.147629Z

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

rafaeldelboni 2023-04-05T23:27:26.694059Z

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

James Amberger 2023-04-05T23:27:43.260309Z

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

James Amberger 2023-04-05T23:27:47.444339Z

ok thanks I will

rafaeldelboni 2023-04-05T23:28:27.676769Z

uhm interesting, I didn't knew about it

rafaeldelboni 2023-04-05T23:28:54.452269Z

I would like to know if this will work

James Amberger 2023-04-05T23:34:37.951409Z

we will see

James Amberger 2023-04-05T23:42:37.484439Z

okay:

James Amberger 2023-04-05T23:42:52.339129Z

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

James Amberger 2023-04-05T23:43:08.860189Z

so I needed to specify classpath from shadow-cljs

rafaeldelboni 2023-04-05T23:45:49.212449Z

cool