Fork me on GitHub
#lsp
<
2022-02-11
>
murtaza13:02:59

The clj-kondo integration with lsp on emacs was working fine, but now it's unable to access the clj-kondo jar file. From the stderr:

Error: Unable to access jarfile ~/clj-kondo-lsp-server-2022.02.09-standalone.jar

Process clojure-lsp stderr finished
I've verified that the jar exists and has the necessary permissions. What could have caused this?

ericdallo13:02:14

oh, that looks odd, I suppose you are not using clojure-lsp at all and using clj-kondo via emacs?

ericdallo13:02:42

if so, maybe this is more a question for #clj-kondo as is not related with LSP, unless I didn't understand correctly your issue 😅

ericdallo13:02:12

I see, I think it's okay to discuss it here if it's a LSP as well 😅 but probably @U04V15CAJ will know better about that clj-kondo server

borkdude13:02:35

perhaps a configuration error.

borkdude13:02:50

the same lsp jar is used in the clj-kondo vscode extension

Braden Shepherdson16:02:49

found an odd case of divergence between my LSP and actual compilation. I've got a spec that wants to match a deftype in a different namespace. I used #(instance? other.ns.TheType %). that works when I compile the namespace, but LSP highlights that as an error unresolved symbol "other". The namespace is required.

Braden Shepherdson16:02:35

meanwhile a reference like other.ns/TheType makes LSP happy but dies on real compilation, No such var: other.ns/TheType

Braden Shepherdson16:02:42

should I be importing these like Java classes, maybe?

ericdallo16:02:41

Yeah, already noticed that as well

ericdallo16:02:01

maybe @U04V15CAJ can help here, if that is expected from kondo side

ericdallo16:02:25

I mean, shouldn't kondo recognize other.ns.TheType as well?

Braden Shepherdson16:02:40

it's a fully qualified class name, so probably?

Braden Shepherdson16:02:51

you can do the same with java.time.Instant or similar; if you import and just say Instant, it works; but the fully qualified name is an error.

ericdallo16:02:01

Do you have a simple code snippet where I can repro the issue?

borkdude16:02:18

Can't repro.

Braden Shepherdson16:02:49

huh, I can't repro either in a separate ns.

Braden Shepherdson16:02:54

weird. I'm not sure what's wrong with this namespace. it's just a load of specs, mostly simple ones.

Braden Shepherdson16:02:30

oh! I think I see it. it's a .cljc file but my test one was .clj

Braden Shepherdson16:02:09

naturally it's not going to be cross-platform. I habitually made this specs file .cljc but it's shot through with java.time things, so I'll just make it .clj.

borkdude16:02:26

I already thought it was a .cljc file :)

Braden Shepherdson16:02:51

calling it cljc was a silly fiction, the real one imports four things that are .clj and touch things like ByteBuffer. this was never going to be cross-platform 🙂

Braden Shepherdson16:02:21

ah, that seems to be the Right Solution.