Fork me on GitHub
#lsp
<
2022-12-22
>
Ellis14:12:13

What's needed for https://github.com/clojure-lsp/clojure-lsp/issues/634 now? Seems like clj-kondo supports edn files now

ericdallo14:12:40

@U04V15CAJ does kondo report edn analysis now?

Ellis14:12:59

I just tried on the playground and it seemed to

ericdallo14:12:43

that's nice, didn't know about it do we need any additional flag to kondo report edn analysis?

ericdallo14:12:51

could you share what you did on playground?

ericdallo14:12:23

I'm afraid kondo report findings (the diagnostics) but not include on analysis, if so we would need to change that on kondo first

borkdude14:12:14

what'cha talking about? ;)

Ellis14:12:11

What's needed to add edn support to clojure-lsp, eric's asking if kondo reports edn analysis now

Ellis14:12:29

I've tried on the playground & locally and both seem to handle my edn files

borkdude14:12:37

Please be specific in what you mean by edn support

borkdude14:12:53

and what you expect clojure-lsp and clj-kondo to do

borkdude14:12:23

clj-kondo reports common errors in edn files, like syntax errors

borkdude14:12:37

but it doesn't analyze any code expressions in it (yet)

Ellis14:12:41

Mainly to have imenu pick up the outlines & references, basically what the linked issue is asking for

ericdallo14:12:45

keyword analysis of edn for example

Ellis14:12:06

Like how lsp-mode handles yaml or json

ericdallo14:12:29

yep, we would need keyword analysis for edn files which I think kondo doesn't report yet as borkdude mentioned

ericdallo14:12:39

@U043RSZ25HQ if you could open a issue on clj-kondo about that, would help a lot

Ellis14:12:46

Sure thing 🙂

ericdallo14:12:54

hum, it should overlap a little indeed, I think supporting edn analysis ignoring quoted for now would be already a tremendous improvement though

borkdude15:12:21

what kind of keywords would be useful for analysis? please come up with some useful examples in the clj-kondo issue

Ellis15:12:49

Sure thing, I'll add some examples 🙂

ericdallo15:12:28

for clojure-lsp the keyword name, location and filename are already enough for find-references work

borkdude15:12:29

that's not an example

borkdude15:12:27

I mean, I can't remember when I ever wanted to navigate keywords in deps.edn so please help my imagination - also describing in this issue will help collect upvotes

Ellis15:12:42

I'm adding some examples now 😄

ericdallo15:12:55

At Nubank it's pretty common to have edn files at resources folder for configurations and being able to find the references of those keywords in the code and vice versa would be pretty good.

Ellis15:12:06

Done 🙂 Hopefully that helps

Ellis15:12:35

And yeah at juxt we do something similar, there's also https://github.com/juxt/site that has the whole openapi spec as an edn file

👍 2
borkdude15:12:04

> Done 🙂 Hopefully that helps Where?

Ellis15:12:27

On the issue

borkdude15:12:35

Can you make the examples self-contained? I peeked a little bit and several things you mention there aren't about keywords at all?

Ellis15:12:41

I'll skim through kondo's docs and try and add some expected kondo output 🙂 Think there might be some misunderstanding on my end

borkdude15:12:25

I mean, it would be nice if the person reading the issue wouldn't have to visit external links, but could just read the issue itself

Ellis15:12:35

I'll do that too 🙂

borkdude15:12:58

and as I said, the other issue will likely take care of this already. A keyword is something starting with a colon: :foo . A symbol is something like foo/bar . Your issue talks about keywords.

Ellis15:12:59

Keywords are what I'm interested in here yes 🙂

👍 1
practicalli-johnny19:12:56

Is there a configuration for the lsp-describe-at-point to show the docs in the doc pop-up. At the moment it opens a buffer and shows the raw markdown, so not as nice as the doc popup (although I find the doc popup too distracting to have on all the time)

ericdallo19:12:05

hum, for me the buffer shows the markdown properly:

ericdallo19:12:17

there is lsp-ui-doc for that but I personally don't like it

practicalli-johnny07:12:10

Hmm, it seems something is quite broken with my LSP setup for Emacs, it doesnt even show docs for defn

ericdallo10:12:45

Oh, that's expected, there is one macro or other that kondo analysis has only few info, but are pretty rare like defn and def