This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-26
Channels
- # babashka (7)
- # beginners (85)
- # calva (39)
- # cider (3)
- # clara (1)
- # clj-kondo (10)
- # clojure (194)
- # clojure-europe (36)
- # clojure-madison (2)
- # clojure-nl (13)
- # clojure-spec (11)
- # clojure-uk (2)
- # clojurescript (17)
- # community-development (5)
- # component (9)
- # conjure (4)
- # core-async (3)
- # cursive (32)
- # data-science (26)
- # datomic (31)
- # graalvm (22)
- # holy-lambda (31)
- # honeysql (7)
- # introduce-yourself (1)
- # jobs (9)
- # jobs-rus (1)
- # lsp (3)
- # malli (9)
- # off-topic (54)
- # pathom (27)
- # pedestal (6)
- # portal (1)
- # re-frame (4)
- # releases (1)
- # remote-jobs (1)
- # sci (3)
- # shadow-cljs (4)
- # spacemacs (13)
- # vim (14)
- # xtdb (3)
Hey, does anyone have a mapping to insert a form comment (#_)?
Ideally to toggle one?
I am using this now (with https://github.com/guns/vim-sexp plugin)
<Plug>(sexp_move_to_prev_bracket)i#_<C-[>l=af
But it only allow to insert and not toggle.
There are some solutions discussed in https://clojurians.slack.com/archives/C0DF8R51A/p1638731389109100 but I'm also wondering if there are better solutions. Maybe this could be a https://clojure-lsp.io/capabilities/#refactorings?
@UKFSJSM38, what do you think about making it a part of lsp?
This fits into a code snippet that is already possible to customize on clojure-lsp: https://clojure-lsp.io/settings/#snippets
Hmm, I can see how a snippet would be used to add the discard #_
, but I'm not sure I understand how a snippet could toggle the discard.
Do you think it's an appropriate candidate for an LSP refactoring? At least in my workflow toggling comments on individual elements or their parent form is a common operation.
Given a form like (prn 1 2 3)
, have a way to toggle a discard macro in front of either one of the arguments, or in front of the whole expression.
(prn |1 2 3)
Can transformed to
(prn #_1 2 3)
Or to
#_(prn 1 2 3)
And the same action would allow going in the opposite direction to remove the discard macro.
Does that match what you're thinking @UL05W6AEM?