Fork me on GitHub
#lsp
<
2022-03-04
>
practicalli-john15:03:49

I've been using the following Clojure LSP snippets in my local configuration. Are you interested in any of these being added to the 19 built in aliases in Clojure LSP? https://github.com/practicalli/clojure-lsp-config/blob/main/config.edn

ericdallo15:03:43

For sure! Thank you, I see some of them we could add to clojure-lsp indeed like deftest , require and some others that already exists but are missing docstring fro example

ericdallo15:03:05

I'll take a closer look this weekend and include/update most them, thanks!

practicalli-john15:03:38

I've added an issue that describes them (just in case its not obvious) https://github.com/clojure-lsp/clojure-lsp/issues/797

ericdallo15:03:31

Yes, not sure all of them makes sense to be built-in, but most of it probably yes, thank you!

practicalli-john15:03:17

One thing I notice, using placeholder text with $0 doesnt highlight the text, so its not replaced when tabbing into that placeholder. I've either removed body or added a $number other than 0

ericdallo15:03:53

maybe a yasnipet/lsp-mode issue? not sure this is actually expected, I don't know that much about how snippets should behave

practicalli-john15:03:55

I assume that as $0 has a special meaning (the end of the snippet) that text replacement is not done. Or this could just be the way that yasnippets that does the expansion on Emacs does not replace the text. The microsoft document does not make it clear if text replacement should also work for $0 (unless I missed something) Text replacement works fine with 1,2,3,4,5.... etc.

ericdallo16:03:16

Yes, agreed, sounds like a emacs/yasnippets limitation

practicalli-john10:03:48

That's not the only point I was making, so no, we are not in agreement.

ericdallo13:03:03

Your point is that we could remove $0 and replace with $something?

practicalli-john22:03:38

Nope. $0 works correctly. ${0:placeholder-text} does not highlight place-holder text and therefore the text says there when tabbing to the last position. With ${1:placeholder-text}, the place-holder text is highlighted and replaced as soon as you start typing.

practicalli-john22:03:10

For example, in the updated built-in snippets, I notice that ns-doc will not replace references text when tabing to the last position and typing.

(ns ${1:name}\n \"${2:docstring}\"\n ${0:references})

practicalli-john22:03:54

If the ns-doc is changed to the following, then it would replace references when typing at the tab-stop

(ns ${1:name}\n \"${2:docstring}\"\n ${3:references})

ericdallo22:03:49

got it, I'll change it to be just $0 or other number to avoid issues on most clients

šŸ‘ 1
practicalli-john23:03:14

Excellent, sorry it it wasn't clear before.

šŸ‘ 1
ericdallo23:03:30

The $0 on ns-doc does work for me on lsp-mode, even so I'll change it to avoid users with the same issue you have

alex19:03:30

I'm seeing strange behavior in my Emacs after upgrading to clojure-lsp 2022.02.23-12.12.12 and enabling lsp-mode . Have you gotten reports of anything similar? • I think it's creating .clj-kondo/metosin and .clj-kondo/funcool in my project directory • Does clojure-lsp do anything with adjusting parens based on indentation? All of a sudden my Emacs is aggressively balancing parentheses (but doing it poorly and creating invalid expressions). Merely moving my cursor to a point in normal mode is causing re-shifting of parens. Not sure this is lsp responsible for this

ericdallo19:03:45

The first one is completely expected, you should even commit those folders following clj-kondo recommendation

ericdallo19:03:35

The second one is probably not related with lsp-mode just moving in normal mode, check if you have any other minor mode enabled like agressivo indent or something like that

alex19:03:43

Thanks Eric! Good to know about the extra clj-kondo configs

borkdude19:03:34

The configs will make linting better for promesa and malli. You can disable copying the configs as well, if you want.

šŸ‘ 2