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

Nephila won't read ClojureScript (cljs) files #4

Open
sgrove opened this issue Sep 6, 2013 · 1 comment
Open

Nephila won't read ClojureScript (cljs) files #4

sgrove opened this issue Sep 6, 2013 · 1 comment

Comments

@sgrove
Copy link

sgrove commented Sep 6, 2013

It looks like when searching for Clojure namespace declarations (here https://github.com/timmc/nephila/blob/master/src/leiningen/nephila.clj#L44), Nephila uses clojure.tools.namespace.find/find-ns-decls, which ultimately calls out to clojure.tools.namespace.file/clojure-file? (https://github.com/clojure/tools.namespace/blob/master/src/main/clojure/clojure/tools/namespace/file.clj#L25), which is checking for .clj extensions on files.

I don't know whether is make sense to add a separate function for "Find clojurescript files", or to change clojure-file? to check for ".cljs?". Perhaps @stuartsierra could tells us the consequences of either.

@stuartsierra
Copy link

tools.namespace is currently oriented towards Clojure (JVM) sources only. The ns declaration parser will work on ClojureScript source files but it will not be able to load them, so changing clojure-file? to include .cljs files would break other features of tools.namespace.

If you want to search both .clj and .cljs sources, my current recommendation is to use custom code to search for files on the classpath (which is easy) and then call tools.namespace to parse the ns declarations.

Currently tools.namespace will not recognize :require-macros in ClojureScript. I do not know the consequences of adding support for :require-macros, but I am not opposed to adding it if there is a demonstrable use case and it doesn't break anything else.

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

1 participant