Fork me on GitHub

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 namespace declaration instead. Is there some configuration I can tweak so that it generates a (ns 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 agree that it's unusual.


:paths is already set to ["src/main"] , and the code runs fine


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


Oh, that would explain why I didn't find anything in the cider docs 😅 Thank you!