Closed
Description
Brief
namespace-aliases
i.e. the defn that backs cljr-slash
, breaks if there's any .clj file with invalid syntax in a given project.
There's kind of a legitimate use case for .clj files with invalid syntax:
- template files, e.g.
moustache
d clojure - more importantly, WIP code.
As an aggraviating condition, cljr-slash omits errors, making this issue hard to debug / easy to forget.
So, namespace-aliases
could omit files with invalid syntax, instead of throwing exceptions in presence of these files
Steps to reproduce the problem
echo "totally-invalid(((((((" > src/sample.clj
- invoke
refactor-nrepl.ns.libspecs/namespace-aliases
Suggestion
In:
augment the (some-fn ...)
, with (every-pred readable? (some-fn ...))
, where readable?
is a defn that tries reading the ns form with tools.reader + tools.namespace.parse, returning false if any exception would have been thrown.
clj-refactor.el and refactor-nrepl version information
Both repos @ master