[TNS-6] Attempt to reload deleted file Created: 14/Dec/12 Updated: 14/Dec/12 |
|
| Status: | Open |
| Project: | tools.namespace |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Major |
| Reporter: | Stuart Sierra | Assignee: | Stuart Sierra |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I can't identify the exact circumstances, but I have seen events where a source code file has been deleted but clojure.tools.namespace.repl/refresh still tries to reload it. Because the file doesn't exist, there's an exception when you try to load it, so you're stuck. |
[TNS-5] Allow any valid .clj* source file to be parsed/analysed Created: 01/Nov/12 Updated: 13/Dec/12 |
|
| Status: | Open |
| Project: | tools.namespace |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Enhancement | Priority: | Major |
| Reporter: | Max Penet | Assignee: | Stuart Sierra |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | enhancement | ||
| Attachments: |
|
| Description |
|
This broadens the allowed file types to anything ending with #"\.clj.?$", meaning this would work for clj, cljs, cljc, cljx and possibly other Clojure implementations with their own extension in the future. This allows libraries such as codox (and possibly autodoc) to work with ClojureScript and others implementations without any modification. Note: My CA is on the way, I sent it a week ago, I am not sure if it arrived yet (it was sent from Switzerland with normal mail, with an ETA of 1 week). |
| Comments |
| Comment by Max Penet [ 02/Nov/12 6:51 AM ] |
|
CA received it seems (I am listed on http://clojure.org/contributing ). |
| Comment by Stuart Sierra [ 02/Nov/12 3:23 PM ] |
|
I'm not sure about this. If you're only using c.t.n.find in isolation, it's fine. But if you're using code-reloading and c.t.n.repl, it could incorrectly try to reload .cljs files in JVM Clojure. We really need [Feature Expressions]http://dev.clojure.org/display/design/Feature+Expressions or something like it to get away from multiple file extensions. Until then, I think it has to be optional. I don't know how best to achieve this. The APIs in c.t.n.repl and c.t.n.dir are not amenable to extension. I'll think about it. |
| Comment by Max Penet [ 06/Nov/12 6:11 PM ] |
|
True, I didn't realize that. Maybe using a dynamic var to hold the regex pattern (or a predicate?) could be a reasonable solution in the meantime, this would allow to rebind it in the case of codox & similar libs. |
| Comment by Max Penet [ 24/Nov/12 7:47 AM ] |
|
Any thoughts on my last comment/edit? I don't think there is a single doc lib that works with cljs at the moment, it is a bit painful to be honest. |
| Comment by Stuart Sierra [ 24/Nov/12 4:25 PM ] |
|
Yes, I think a dynamic var would be OK. However, I would like to know of a real use case, not just a potential one. |
| Comment by Max Penet [ 13/Dec/12 2:40 AM ] |
|
The idea was to be able to use codox on cljs files, I tried locally but there are other problems with this approach to be able to get to cljs vars metadata. So in the end I think you were right, maybe it's better to wait for feature expressions for this. |