Fork me on GitHub
#lsp
<
2022-09-16
>
Christoph22:09:45

I just stumbled over https://github.com/clj-kondo/clj-kondo/issues/1317 because my namespace has a - in it. Will there be any progress on this, or should I just rename my namespace to something without -?

ericdallo22:09:53

I think we should re-open the issue on clj-kondo, still makes sense to me so we can support that on LSP side, WDYT @U04V15CAJ?

borkdude22:09:04

reopend!

🙌 1
👍 1
borkdude08:09:08

@U02H56JNDK2 Can you give the full context (code) of how you are importing + using your var and in which clojure dialect?

Christoph10:09:14

@U04V15CAJ will do later in the evening when I'm at the computer. What do you mean by dialect? I'm using "pure" Clojure 1.11.1

borkdude10:09:39

OK, I meant CLJS or CLJ or ...

Christoph10:09:24

Clj it is 👍

borkdude12:09:54

I closed the issue again, with a comment. If we reach another conclusion I can re-open it, but I think it's the job of who uses the analysis to "do the right thing" here

borkdude13:09:08

I think alternatively you could require the namespace and write ->SomeRecord instead. Which is more idiomatic than going through the Java constructor too probably

Christoph13:09:12

I am using brute (https://github.com/markmandel/brute/) in my project, an ECS implementation. Without going too much into details, it uses the class name as index in its internal storage. For fetching data it’s common to have code like (brute.entity/get-component system entity Rectangle) where Rectangle is the imported class, created from a defrecord.

Christoph13:09:08

So I have to import the class in order to use brute. But I understand that this is a corner case and it doesn’t bother me too much. So I’m fine with the issue being closed. Eventually I might just rename the namespace.

borkdude13:09:04

It can be supported but my opinion is that this has to be inferred based on the java-class-usages + combination of existence of clojure namespaces

borkdude13:09:29

So imo it's more a "consumer of the analysis" (being lsp here) problem than "the analysis is incorrect" problem