This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-11-01
Channels
- # babashka (1)
- # beginners (28)
- # calva (28)
- # cider (8)
- # clj-kondo (1)
- # clojars (4)
- # clojure (20)
- # clojure-australia (1)
- # clojure-europe (13)
- # clojure-uk (2)
- # clojurescript (2)
- # conjure (4)
- # core-async (4)
- # cryogen (3)
- # datomic (17)
- # fulcro (3)
- # helix (45)
- # malli (9)
- # off-topic (6)
- # pathom (3)
- # re-frame (13)
- # reitit (17)
- # sci (1)
- # shadow-cljs (9)
- # sql (6)
- # tools-deps (11)
- # vim (17)
Hi, silly question: I have a deps.edn
project with a directory structure where the foo
namespace would be in the src/main/foo/bar.clj
file.
But when I create that file in Cider, it adds a (ns main.foo.bar)
namespace declaration instead.
Is there some configuration I can tweak so that it generates a (ns foo.bar)
form instead?
It seems unusual to have a directory under src that is not part of the namespace. I would remove the main directory if its not part of the namespace and problem solved.
Otherwise, if you keep main directory, I assume you have had to set :paths ["src/main"]
configuration in the project deps.edn
file to make the code run with a namespace without main (otherwise I assume it will fail if run on the command line or as a jar)
I'm just trying to find out if there is a way to make Cider work a little better with the existing code base
If the namespace is being added automatically when a new file is created in cider, then it's clj-refactor at work. The namespace is not added if clj-refactor is not enabled. So take a look at that project for options. Also try the clojure-mode refactoring to manually add the namespace, see if that respects the path set in the deps.edn file