Skip to content

Require what ::alias/name needs and see aliases in reader conditionals - #4228

Open
bbatsov wants to merge 2 commits into
masterfrom
ns-alias-fixes
Open

bbatsov wants to merge 2 commits into
masterfrom
ns-alias-fixes

Conversation

@bbatsov

@bbatsov bbatsov commented Nov 10, 2026

Copy link
Copy Markdown
Member

cider-ns-add-missing refused auto-resolved keywords, though magic requires already resolve their aliases, so it now goes by the same namespaces and adds the require. The ns edits also missed aliases and refers taken in reader conditionals (#?, #?@) and in a second :require clause, and added a clashing :as that broke the ns form.

Fixes #4222

The ns edits only looked at the plain libspecs of the first :require
clause, so with [c.d :as d] behind #?(:clj ...), or in a second :require
clause, adding a require as d put a second :as d into the form, which
then didn't compile. Every libspec now counts when checking whether an
alias or a refer is taken, reader conditionals (#?@ included) and later
:require clauses too.
cider-ns-add-missing rejected ::config/aero as a keyword, though magic
requires already handle that alias. It now goes by the same namespaces
they do, asks which when there's more than one, and adds the require.
A keyword that needs no require still gets an error.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cider-ns-add-missing rejects auto-resolved keywords like ::alias/name

1 participant