Fork me on GitHub
#lsp
<
2021-06-17
>
bartuka12:06:56

is it possible to check where is the .clj-kondo/config.ednloaded in a lsp session?

bartuka12:06:33

I would like to ensure the project config is loaded instead of my global config

bartuka12:06:57

I am not familiar with clojure-lsp project, but this (https://github.com/clojure-lsp/clojure-lsp/blob/master/src/clojure_lsp/config.clj#L23) means that clojure-lsp is not reading any clj-kondo/config.edn files? or the copy-configs option should be enough to make it work?

bartuka12:06:31

this namespace does not have an explicit "read clj-kondo config" statement

ericdallo14:06:18

Yes, all of that is handled by clj-kondo, we don't tell clj-kondo to use specific config, it checks automatically by project config or ~/.config/clj-kondo/config.edn

bartuka17:06:36

I have this in .clj-kondo/config.edn in project root folder

{:linters {:unresolved-symbol {:exclude []}
           :unresolved-var {:exclude [sql/raw sql/call sql/format]}}
and yet the Error List to my project is filled with these msgs:

ericdallo17:06:51

@U04V15CAJ can help here but I think you should use the full qualified symbol in the exclude?

borkdude17:06:40

@UBSREKQ5Q is the namespace called sql or is this an alias?

bartuka17:06:27

that might be it, I will test asap

borkdude17:06:33

yeah, you should use the full namespace name

borkdude17:06:17

@UBSREKQ5Q btw, is this for honeysql?

👍 2
borkdude17:06:43

I have this in my own config:

honeysql.util/defalias clojure.core/def
honeysql.helpers/defhelper clojure.core/def

👍 4
borkdude17:06:23

this will resolve the correct vars (after analyzing honeysql again)

ericdallo17:06:54

Yeah, if you have the chance to teach the linter instead of suppress the warning, I think it's better

👍 2
borkdude17:06:14

you also get better auto-completions for it

borkdude17:06:27

because ... LSP rules!

metal 2
bartuka18:06:44

ohh.. nice! thanks @U04V15CAJ I didn't know about this option

bartuka18:06:45

perfect! just tried that out. thanks again