Fork me on GitHub
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?


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

@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


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


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


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


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


Can you share a snippet that fails?


I'll try to remember this when it happens again


don't have the repro handy


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


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?


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


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


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


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


But I haven't double checked that


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


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


I'll check tomorrow, now sleep


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