Fork me on GitHub
#lsp
<
2022-07-06
>
Karol Wójcik13:07:25

I'm trying to auto-activate the signature help in clojure-lsp via trigger chars. I would like the signature to activate when I complete at point and then type " ". How can I add additional chars to triggers to achieve this?

Karol Wójcik13:07:42

Or maybe clojure-lsp could detect the fn in a position and send the trigger request from the server?

ericdallo13:07:23

hum, not sure the spec supports that, In my experience, lisp doesn't work that well with that feature

Cora (she/her)20:07:09

will clojure-lsp use clj-kondo hooks in the project? (since it uses clj-kondo for analysis under the hood)

Cora (she/her)20:07:35

cool! thanks

👍 2
borkdude21:07:27

@jacob.maine I noticed you're working on goto definition in the recent commits. One thing that might also be improved is when navigating to a var that was declared and later defined, I think goto def should go to the def rather than the declare

ericdallo21:07:01

I think we fixed that on the past, maybe we re introduced the issue?

borkdude21:07:11

Probably by just going to the latest defined var, rather than the first occurrence

borkdude21:07:20

Oh, yes, perhaps. For me it was still going to declare

jacob.maine21:07:12

That’s surprising @U04V15CAJ… as @UKFSJSM38 said, it’s supposed to go to the def, not the declare

jacob.maine21:07:52

Can you share a snippet that fails?

borkdude21:07:26

I'll try to remember this when it happens again

borkdude21:07:33

don't have the repro handy

borkdude21:07:57

when I do it in a small file, it works as expected

jacob.maine21:07:40

fwiw, clojure-lsp is supposed to go to the last analysis element it finds. but it relies on clj-kondo to define last. that is, it uses the last matching element returned by clj-kondo. it doesn’t sort elements by line number. does clj-kondo have any guarantees about element order?

jacob.maine21:07:10

(and @UKFSJSM38 why does it exclude delcarations? what if a var is declared but never defed?)

ericdallo21:07:28

We should probably fix that on clojure-lsp and not rely on order

ericdallo21:07:03

We should be able to go to a declare if no other definitions, probably a issue

borkdude21:07:00

I think clj-kondo inserts the found vars in the order it finds them, so they should be sorted by line number already

borkdude21:07:13

But I haven't double checked that

jacob.maine21:07:26

I worry about the performance implications of sorting elements… we could do it during normalization to minimize the cost, but still, sorting isn’t cheap. If clj-kondo returns the analysis elements already sorted, it’d be cheaper to rely on that

borkdude21:07:53

The issue may have happened in a .cljc file where the order relies on first the clj aspects of the file and then the .cljs aspects which might mess up things a little bit

borkdude21:07:02

I'll check tomorrow, now sleep

jacob.maine21:07:46

@U04V15CAJ, that makes sense. I’ll think about the implications of that on the clojure-lsp side. For now, ’night!