Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand cljr magic require namespaces documentation #555

Merged

Conversation

dgtized
Copy link
Contributor

@dgtized dgtized commented Dec 1, 2023

  • Minimal documentation on the :only keyword.
  • Backport support for :only in the cljr-magic-requires-namespace if the suggest-libspec flag is off
  • Adds edn alias and limits io alias to clj only

Leverages clojure-emacs/refactor-nrepl#392 and #530.

Still needs more testing and expanded documentation but this seemed like a good incremental improvement.

Before submitting a PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):

  • The commits are consistent with our contribution guidelines
  • You've added tests (if possible) to cover your change(s)
    • not adding test coverage here as this is the deprecated path, but I did verify the parser change at the elisp repl.
  • The new code is not generating byte compile warnings (run cask exec emacs -batch -Q -L . -eval "(progn (setq byte-compile-error-on-warn t) (batch-byte-compile))" clj-refactor.el)
  • All tests are passing (run ./run-tests.sh)
  • You've updated the changelog (if adding/changing user-visible functionality)
  • You've updated the readme (if adding/changing user-visible functionality)

Thanks!

Seems like a decent default given it's in core anyway.
This is handled by the suggest-libspec middleware automatically, so should not
be user visible on latest versions. However, if cljr-slash-uses-suggest-libspec
is disabled, the alist format was broken with an :only keyword when parsed by
cljr--magic-requires-lookup-alias. This fixes that lookup and extracts the
libspec from the first element of the list if it's not a dotted pair.
Copy link
Member

@vemv vemv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice ones, thanks!

clj-refactor.el Outdated Show resolved Hide resolved
@vemv vemv merged commit 47a9a5c into clojure-emacs:master Dec 2, 2023
5 of 7 checks passed
@dgtized dgtized deleted the expand-clj-rmagic-require-namespaces branch December 2, 2023 04:41
@vemv
Copy link
Member

vemv commented Dec 2, 2023

I've tagged 3.11.1

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.

None yet

2 participants