You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently reviewing aspects of namespace handling for rewrite-cljc and came to cljfmt to review how it handles namespaces.
Under docs for alias-map we have:
:alias-map - a map of namespace alias strings to fully qualified namespace names. This option is unnecessary in almost all cases, because cljfmt can compute the alias map from an ns declaration.
However, it can't do that when used as a CLJS library, or when indenting something with no ns declaration like an EDN file.
After reviewing the code, I might be missing something or maybe I have a blind spot, but I'm not sure why cljfmt would not be able to parse out alias maps from a ns declaration when used as a CLJS library. Is that maybe a historical, rather than current, limitation?
If it is no longer a CLJS limitation, and with the understanding that :alias-map is still useful in other cases, I am happy to update the docs and tests accordingly.
The text was updated successfully, but these errors were encountered:
Oh that's a wonderful PR description, thanks @weavejester (and @MatthewDarling). It states that the limitation is due to the current version of rewrite-cljs not being able to handle namespaced keywords #106 as evidenced here.
I am (oh so slowly) creating a successor for rewrite-cljs and rewrite-clj in rewrite-cljc, which should benefit tools like cljfmt.
I am hoping you are good with leaving this issue open while I work to reproduce an example of the limitation of parsing alias-maps from namespace declarations in cljfmt when using rewrite-cljs and then verify that is (or can be) resolved in rewrite-cljc.
I'm currently reviewing aspects of namespace handling for rewrite-cljc and came to cljfmt to review how it handles namespaces.
Under docs for
alias-map
we have:After reviewing the code, I might be missing something or maybe I have a blind spot, but I'm not sure why cljfmt would not be able to parse out alias maps from a ns declaration when used as a CLJS library. Is that maybe a historical, rather than current, limitation?
If it is no longer a CLJS limitation, and with the understanding that
:alias-map
is still useful in other cases, I am happy to update the docs and tests accordingly.The text was updated successfully, but these errors were encountered: