clojure-emacs / refactor-nrepl

nREPL middleware to support refactorings in an editor agnostic way
Eclipse Public License 1.0
256 stars 69 forks source link

Make `namespace-aliases` aware of new files #369

Closed vemv closed 2 years ago

vemv commented 2 years ago

Context

https://stuartsierra.com/2015/05/10/clojure-namespace-aliases is a relatively popular pattern of aliasing.

For a ns named foo.bar.baz, baz or bar.baz would be idiomatic aliases.

For a newly created namespace foo.bar.baz, no other namespace will have aliased it yet, because it's new.

Yet, as a clj-refactor.el user, if I type e.g. baz <slash> i.e. cljr-slash, ideally I would get completions for inserting a foo.bar.baz :require libspec.

Task

Make namespace-aliases also return tentative Sierra-style aliases if:

n.b. a newly created ns may not be loaded yet.