Fork me on GitHub
#lsp
<
2024-03-13
>
ericdallo16:03:08

clojure-lsp Released clojure-lsp 2024.03.13-13.11.00 including a clj-kondo bump fixing high memory usage fix from previous release. ā€¢ General ā—¦ Bump clj-kondo to 2024.03.13 fixing high memory usage issue. ā€¢ Editor ā—¦ Fix workspace/didChangeConfiguration exception causing noise on logs. https://github.com/clojure-lsp/clojure-lsp/issues/1784

ā¤ļø 7
arnaud_bos16:03:22

Sorry to bother but I don't really get what those commands are used for (slurp, barf?), and regarding @U34K4458Xā€™s comment about "pair movement commands", I do not know what that sentence means. I may have similar behavior already "custom keymapped" without knowing it, so I'm going to experiment a bit more right away. Also I may have conflated some terms but when I said "paredit" I mostly meant "what I'm used to in the context of Cursive", especially the structural editing part of the documentation where parens/etc are automatically matched, whitespace automatically tidied-up, etc. Does clojure-lsp intellij behave the same? Last time I checked, I did get that.

ericdallo16:03:17

maybe the docs need an improvement likehttps://calva.io/paredit/

armed16:03:53

pair movement example

(let [foo 1
      bar| 2])
run move up command result:
(let [bar| 2
      foo 1])

ericdallo16:03:32

clojure-lsp-intellij does have auto paren matching, so yes, paredit is when you want to do actions like parens manipulation, that calva doc explains really well with images, maybe we should just link it to there šŸ˜‚

šŸ˜„ 1
ericdallo16:03:49

Also, I added support for only what clojure-lsp supports in terms of paredit, which are the most used ones, no one never complained about the other missing paredit actions

arnaud_bos16:03:31

Thanks @U34K4458X, that clears it up. Actually Cursive has some issues on this front.

armed16:03:40

@UKFSJSM38 does clojure-lsp format the code block when slurp/barf code actions used?

ericdallo16:03:38

possible on other editors, not available for intellij yet, but a format whole buffer is pretty fast and would work too

arnaud_bos16:03:39

Ah this defprotocols "find implementations" feature is bliss šŸ¤¤

ericdallo17:03:39

I wanna do improvements on the popup in the future, but I think the repl plugin needs more attention ATM

arnaud_bos17:03:26

I had to open the file containing the implementation (defrecord) first to be able to find it from the defprotocol, does it mean that the project is "indexed" lazily?

arnaud_bos17:03:43

Or maybe I didn't give "it" enough time.

arnaud_bos17:03:43

"pair movement" doesn't seem to work in my case. Maybe I should tweak some setting, but out of the box my let form gets messed-up. Same this with "Strict mode" from Calva docs, I can unbalance pretty much anything. I'll take a look at lsp config and at my key bindings, maybe I'm missing some tuning?

ericdallo19:03:25

> does it mean that the project is "indexed" lazily? No, but maybe the way I added this support you need to go to the definition first, but we can support it

ericdallo19:03:00

@U1DLD0WNR maybe there is a bug on this parens manipulation indeed, feel free to give more detaisl

JAtkins19:03:13

Different paredit questions :)

JAtkins19:03:59

I don't see them in the paredit feature list, but how difficult would it be to add "move", "nav around", etc? In particular, I rely heavily on "forward/back sexp or up" from cursive to nav around inside my code. https://calva.io/paredit/

ericdallo19:03:26

makes sense, I think should not be hard, please open an issue!

JAtkins20:03:31

Can do. Might make a PR. Iā€™m hoping to use zed+lsp in the not too distant future

ericdallo20:03:01

zed may have the same problem, so if we manage to add that to clojure-lsp server would be easier to add to other editors

Noah Bogart20:03:27

I wrote a clj-kondo hook to look at sytax-quoted symbols in with-meta calls. The hook doesn't work unless I've already linted/cached the other files, so on CI runs, it fails. This seems like the kind of feature that is better suited for clojure-lsp's whole project/classpath-aware linting. Is it possible to write hooks that happen after analyzing the whole project?

ericdallo21:03:41

no, this is something that completely happens on clj-kondo side, but the idea is not bad, would be really nice if in a hook we could pass extra information, like a context that we could inject all the analysis or so, not sure if that makes sense c/c @U04V15CAJ

borkdude21:03:55

hooks api exposes the function api/ns-analysis which already has a bunch of stuff, but this doesn't solve the order of namespaces that get linted

ericdallo21:03:44

yeah, I suppose that only provides the analysis of that ns and not all the ones (especially because of the order too)

borkdude21:03:47

One solution (workaround rather) would be to lint the local source twice, once to populate the cache and once to detect real issues

ericdallo21:03:44

makes sense, but should probably affect performance, but would work as a workaround if that would be optional for final user

borkdude21:03:08

I don't mean that lsp should do this, I mean that Noah should (can) do this on his CI

šŸ‘ 2