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

Fix ns detection for complex metadata #555

Merged
merged 3 commits into from
Mar 20, 2020

Conversation

yuhan0
Copy link
Contributor

@yuhan0 yuhan0 commented Mar 20, 2020

See clojure-emacs/cider#2821

Use clojure-forward-logical-sexp to reliably skip metadata instead of error-prone regex.

The previous variable clojure-namespace-name-regex is kept as obsolete in case it breaks other packages - can remove it directly if that's preferred.

One of the commented out TODO tests used a old metadata syntax #^{:bar true} which wasn't supported by clojure--looking-at-non-logical-sexp


Before submitting a PR mark the checkboxes for the items you've done (if you
think a checkbox does not apply, then leave it unchecked):

  • The commits are consistent with our [contribution guidelines][1].
  • You've added tests (if possible) to cover your change(s). Bugfix, indentation, and font-lock tests are extremely important!
  • You've run M-x checkdoc and fixed any warnings in the code you've written.
  • You've updated the changelog (if adding/changing user-visible functionality).
  • You've updated the readme (if adding/changing user-visible functionality).

@bbatsov bbatsov merged commit 64ed043 into clojure-emacs:master Mar 20, 2020
@bbatsov
Copy link
Member

bbatsov commented Mar 20, 2020

Nicely done!

@yuhan0
Copy link
Contributor Author

yuhan0 commented Mar 20, 2020

Thanks! Just as another data point from the wild, the clojure.string ns form was being detected wrongly before due to the docstring containing "(ns ...":
https://github.com/clojure/clojure/blob/master/src/clj/clojure/string.clj#L14

With the changes in this PR it now works correctly :)

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.

2 participants