clojure-emacs / clj-refactor.el

A CIDER extension that provides powerful commands for refactoring Clojure code.
GNU General Public License v3.0
771 stars 111 forks source link

cljr-slash magic require js/ behavior is determined by file type, not language context #523

Closed dgtized closed 1 year ago

dgtized commented 2 years ago

Context: https://github.com/clojure-emacs/clj-refactor.el/pull/522#discussion_r918170325

Specifically this is discussing the behavior of cljr--js-alias-p, which ignores a magic require alias prefix "js" if and only if it's in a cljs file. It will attempt to lookup the namespace in a cljc file. It's less clear what the behavior is inside of a #?(:clj) or #?(:cljs) language context within a cljc file, but I would expect that it should use the cljs behavior inside of a cljs context in a cljc file.

Expected behavior is that js/ in a cljs context should ignore the magic alias lookup for both cljs and cljc files.

vemv commented 1 year ago

Hey @dgtized , would you be interested in tackling this one?

Probably at this point we already have the primitives for making it easy.

dgtized commented 1 year ago

I can take a look, I agree it should be pretty easy at this point. That said, I'm pretty low capacity for the next month or two, so no promises on when.