Fork me on GitHub

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?


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


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


I've added an issue that describes them (just in case its not obvious)


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


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


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


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.


Yes, agreed, sounds like a emacs/yasnippets limitation


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


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


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.


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})


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})


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

šŸ‘ 1

Excellent, sorry it it wasn't clear before.

šŸ‘ 1

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


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


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


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


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


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

šŸ‘ 2