This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-04
Channels
- # announcements (19)
- # babashka (11)
- # babashka-sci-dev (9)
- # beginners (71)
- # calva (25)
- # cider (1)
- # clara (36)
- # clj-kondo (47)
- # clojure (65)
- # clojure-dev (64)
- # clojure-europe (9)
- # clojure-nl (2)
- # clojure-seattle (1)
- # clojure-uk (2)
- # clojured (8)
- # clojurescript (17)
- # cursive (9)
- # data-science (36)
- # datahike (11)
- # emacs (10)
- # figwheel-main (19)
- # fulcro (15)
- # graalvm (12)
- # humbleui (5)
- # introduce-yourself (3)
- # jobs (10)
- # leiningen (4)
- # lsp (24)
- # malli (7)
- # nextjournal (23)
- # off-topic (1)
- # pedestal (2)
- # polylith (6)
- # portal (1)
- # re-frame (3)
- # reitit (2)
- # releases (2)
- # remote-jobs (1)
- # reveal (9)
- # shadow-cljs (13)
- # spacemacs (6)
- # xtdb (3)
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
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've added an issue that describes them (just in case its not obvious) https://github.com/clojure-lsp/clojure-lsp/issues/797
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
This is how SPEC recommends it: https://microsoft.github.io/language-server-protocol/specification#snippet_syntax
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.
That's not the only point I was making, so no, we are not in agreement.
It seems to me that $0 is working properly, I mentioned it https://github.com/clojure-lsp/clojure-lsp/issues/797#issuecomment-1059789955
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
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