This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-12-06
Channels
- # adventofcode (54)
- # announcements (3)
- # babashka (34)
- # beginners (38)
- # calva (27)
- # cherry (5)
- # clj-kondo (34)
- # clojure (26)
- # clojure-bay-area (4)
- # clojure-berlin (3)
- # clojure-europe (26)
- # clojure-india (6)
- # clojure-nl (1)
- # clojure-norway (54)
- # clojure-uk (2)
- # conjure (3)
- # cursive (4)
- # data-science (1)
- # emacs (6)
- # events (4)
- # fulcro (2)
- # hugsql (6)
- # hyperfiddle (38)
- # lsp (3)
- # matrix (1)
- # membrane (5)
- # off-topic (27)
- # re-frame (3)
- # releases (1)
- # sci (8)
- # shadow-cljs (34)
- # squint (132)
How does one find what inserts the (ns some.name)
template into a new visited .clj
file to change the template? I use eglot, clojure-lsp, cider, and yasnippet. But I seem to be unable to locate the bit that does insert the template.
yasnippet has a snippet that inserts exactly that, but editing the snippet and calling yas-reload-all
doesn't change what's inserted.
For clojure-lsp I have {:auto-add-ns-to-new-files? false}
in .clojure-lsp/config.edn
, removing which leads to the ns
form being inserted twice in the same file, so the flag actually has an effect, and it seems to be not clojure-lsp inserting the original ns form.
eglot shouldn't do that on its own I believe, as it's merely an LSP client.
And cider... I couldn't find anything related to new file templates in its docs, and thus am not sure if it's ever involved.
Still, the question remains, how do I figure out where the ns form comes from?
Do you also use clj-refactor? Then take a look at the cljr-add-ns-to-blank-clj-files
custom.
What do you want to change the declaration to?
Oh yeah. That's it. I have cljr-add-ns-to-blank-clj-files
set to t
in .clj files... setting it to nil
stops the form being added to new files
Thank you so much
I'd like to add some more forms added as default on the current project and wanted to disable the simple ns one, but couldn't figure out how.
I somehow have forgotten clj-refactor was doing this... even though I believe I knew it at some point... huh.