Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong namespace when source path is src/cljc #310

Closed
yatesco opened this issue Jul 29, 2015 · 6 comments
Closed

Wrong namespace when source path is src/cljc #310

yatesco opened this issue Jul 29, 2015 · 6 comments

Comments

@yatesco
Copy link

yatesco commented Jul 29, 2015

Assume I have src/cljc/a/b/c.cljc. If I navigate in dired to src/cljc/a/b and then C-x C-f new.cljc then a new buffer is created (ns cljc.a.b.new).

Namespaces are setup correctly so src/cljc is a source path according to project.clj.

Libraries are Clojure 1.7.0 and snapshot cider.

@bbatsov
Copy link
Member

bbatsov commented Jul 29, 2015

I haven't played with cljc yet. I'm assuming src/cljc is the standard layout and we should take this into account, right?

@expez
Copy link
Member

expez commented Jul 29, 2015

This happens with src/cljs and src/clj too, doesn't it?

@yatesco
Copy link
Author

yatesco commented Jul 29, 2015

Yep. Let me try src\clj and test\clj to see if it is specific to the clojure reader functionality.

On 29 Jul 2015, at 12:36, Bozhidar Batsov notifications@github.com wrote:

I haven't played with cljc yet. I'm assuming src/cljc is the standard layout and we should take this into account, right?


Reply to this email directly or view it on GitHub #310 (comment).

@bbatsov
Copy link
Member

bbatsov commented Jul 29, 2015

I guess we need a list of folders which to drop from the generated ns. That should be pretty simple to do.

@yatesco
Copy link
Author

yatesco commented Jul 29, 2015

Yep, it behaves the same with src/clj and src/cljs

expez added a commit to expez/clojure-mode that referenced this issue Jul 29, 2015
…c/cljc

When the source path is src/{clj,cljc,cljs} instead of just src/
clojure-expected ns would create namespaces like clj.my-project.my-ns
whereas what's wanted is my-project.my-ns.

Reading boot.clj or project.clj to find out the user's src dirs is out
of scope for clojure-mode, so we use the simply heuristic that no
namespace should start with clj, cljc or cljs because these are the
idiomatic source directories in multi-source projects.

When improving clojure-expected-ns I extracted out two utilities,
clojure-project-dir and clojure-project-relative-path.  These
utilities already exist in clj-refactor so I opted to make them public
rather than private, as they are generally useful.
expez added a commit to expez/clojure-mode that referenced this issue Jul 29, 2015
…c/cljc

When the source path is src/{clj,cljc,cljs} instead of just src/
clojure-expected ns would create namespaces like clj.my-project.my-ns
whereas what's wanted is my-project.my-ns.

Reading boot.clj or project.clj to find out the user's src dirs is out
of scope for clojure-mode, so we use the simply heuristic that no
namespace should start with clj, cljc or cljs because these are the
idiomatic source directories in multi-source projects.

When improving clojure-expected-ns I extracted out two utilities,
clojure-project-dir and clojure-project-relative-path.  These
utilities already exist in clj-refactor so I opted to make them public
rather than private, as they are generally useful.
expez added a commit to expez/clojure-mode that referenced this issue Jul 29, 2015
…c/cljc

When the source path is src/{clj,cljc,cljs} instead of just src/
clojure-expected ns would create namespaces like clj.my-project.my-ns
whereas what's wanted is my-project.my-ns.

Reading boot.clj or project.clj to find out the user's src dirs is out
of scope for clojure-mode, so we use the simply heuristic that no
namespace should start with clj, cljc or cljs because these are the
idiomatic source directories in multi-source projects.

When improving clojure-expected-ns I extracted out two utilities,
clojure-project-dir and clojure-project-relative-path.  These
utilities already exist in clj-refactor so I opted to make them public
rather than private, as they are generally useful.
expez added a commit to expez/clojure-mode that referenced this issue Jul 29, 2015
…c/cljc

When the source path is src/clj{,c,s,x} instead of just src/
clojure-expected ns would create namespaces like clj.my-project.my-ns
whereas what's wanted is my-project.my-ns.

Reading boot.clj or project.clj to find out the user's src dirs is out
of scope for clojure-mode, so we use the simply heuristic that no
namespace should start with clj, cljc or cljs because these are the
idiomatic source directories in multi-source projects.

When improving clojure-expected-ns I extracted out two utilities,
clojure-project-dir and clojure-project-relative-path.  These
utilities already exist in clj-refactor so I opted to make them public
rather than private, as they are generally useful.
expez added a commit to expez/clojure-mode that referenced this issue Jul 29, 2015
…c/cljc

When the source path is src/clj{,c,s,x} instead of just src/
clojure-expected ns would create namespaces like clj.my-project.my-ns
whereas what's wanted is my-project.my-ns.

Reading boot.clj or project.clj to find out the user's src dirs is out
of scope for clojure-mode, so we use the simply heuristic that no
namespace should start with clj, cljc or cljs because these are the
idiomatic source directories in multi-source projects.

When improving clojure-expected-ns I extracted out two utilities,
clojure-project-dir and clojure-project-relative-path.  These
utilities already exist in clj-refactor so I opted to make them public
rather than private, as they are generally useful.
bbatsov added a commit that referenced this issue Jul 29, 2015
@yatesco
Copy link
Author

yatesco commented Jul 29, 2015

Thanks for the quick response guys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants