This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-19
Channels
- # adventofcode (36)
- # asami (3)
- # babashka (22)
- # beginners (65)
- # calva (5)
- # clj-kondo (1)
- # cljs-dev (3)
- # clojure-europe (1)
- # clojurescript (3)
- # conjure (1)
- # core-async (6)
- # datomic (3)
- # emacs (4)
- # introduce-yourself (3)
- # juxt (11)
- # lsp (64)
- # malli (10)
- # missionary (11)
- # music (1)
- # off-topic (2)
- # pathom (1)
- # practicalli (1)
- # reagent (6)
- # reitit (3)
- # releases (3)
- # xtdb (9)
I’ve started playing with custom commands and love it! Two things I’d like to do, that I’m not sure are possible: Overwrite the substition in the editor instead of evaling it. This might work and be more general with “eval and replace” but I don’t know if i can access that from custom snippets. Add custom snippets through code or a special file in a lib, similar to the new clj-kondo auto include config. This would make it easier for tooling libraries to provide commands for ease of use. Currently to use something like debux, scope capture, omni-trace or even zprint I have to require it during every repl session. If the tools could provide custom snippets this would make them a lot easier to use, especially for beginners.
Please create issues with these feature requests and explain them in detail. If you could add examples for each of what is desired, that would be great. I can’t say that these would be implemented any time soon, but we can at least track them and discuss them there, and if they seem like good feature additions, a PR would be welcome, too.
Thanks for starting this conversation, @U02EMBDU2JU! There are a lot of things we could do to leverage the power of custom commands. Some things I have been thinking about are: • An option to evaluate them in the regular inline manner (in contrast to “send to output window”) • More variables. Maybe a way to select things at different depths. Such as “the current ancestor form, X levels up”. If we do this in a smart way, many current variables could get this ability. • Commands taking arguments from user input. • Configure snippets in EDN files.
Those sound like nice ideas! I would prioritize snippets from edn or something similar, mostly because it opens up wide range of interop scenarios and allows people to import them. Plus once the snippets get a little larger they don’t really fit into a json string very well. It seems to me that very few people are using snippet’s since you can’t just install them. I’ve started an issues for that: https://github.com/BetterThanTomorrow/calva/issues/1442 I also really like your your idea for extra user input. I’ve got a snippet for tools.deps/add-libs which would be even more useful if I could add extra user inputs that aren’t in a file.