doesn't track namespace when ns decl isn't first in file #15

Closed
trevor opened this Issue Feb 4, 2014 · 3 comments

Projects

None yet

2 participants

@trevor

It appears ns-tracker will cease following a namespace when there's non-commented content before the namespace declaration.

works:

;-begin
(ns myproject.core)
(println "hi")
;-end

untracked — (any of the four possibilities when uncommented, for example):

;-begin
1
;;; (println "before ns")
;;; (println "loading" *file*)
;;; :abc
(ns myproject.core)
(println "hi")
;-end
@weavejester
Owner

This is a limitation of the tools.namespace library, which assumes the first form read is the namespace declaration. In practice, it almost always will be, and I haven't heard any reason why it shouldn't be, so this doesn't seem like a huge problem.

@trevor

Great, thank you for pointing me in the right direction!

http://dev.clojure.org/jira/browse/TNS-17

@trevor trevor closed this Feb 4, 2014
@weavejester
Owner

TBH I'm not sure it's fixable. There are any number of different ways that you could obscure the namespace a file contains. The only way for tools.namespace to work is to rely on a convention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment