Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support nested indentation rules#70

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@rrudakov
Copy link
Contributor

Hopefully the final piece that concerns semantic indentation.

This change generalize the way we detect indentation for macros and special forms and adds support for nested indentation rules (so, for example, separate functionclojure-ts--match-method-body is not needed anymore).

I changed to format ofclojure-ts-semantic-indent-rules (hopefully it's OK for the version that has not been yet officially released) from(:block n) to((:block n)) or optionally((:block n) (:inner n)), which is more consistent with cljfmt format.
New format allows defining rules like("letfn" . ((:block 1) (:inner 2 0)))).

clojure-ts--dynamic-indent-for-symbol now converts not only top level rule, but the entire spec.


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 ourcontribution guidelines.
  • You've added tests (if possible) to cover your change(s). Bugfix, indentation, and font-lock tests are extremely important!
  • You've runM-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).

Thanks!

@rrudakovrrudakovforce-pushed thefeature/nested-indentation-rules branch from44af05e toa0aca89CompareApril 4, 2025 17:21
@bbatsov
Copy link
Member

I changed to format of clojure-ts-semantic-indent-rules (hopefully it's OK for the version that has not been yet officially released) from (:block n) to ((:block n)) or optionally ((:block n) (:inner n)), which is more consistent with cljfmt format.

Yeah, that's fine. Perhaps we can eventually teach CIDER (and maybeclojure-mode as well) to support this format as well, to get closer to the dream of having uniform indentation metadata withcljfmt.

Great change overall!

@rrudakovrrudakovforce-pushed thefeature/nested-indentation-rules branch froma0aca89 toec50b30CompareApril 4, 2025 20:22
@rrudakovrrudakov requested a review frombbatsovApril 4, 2025 20:24
@bbatsovbbatsov merged commitc8286e2 intoclojure-emacs:mainApr 4, 2025
2 of 3 checks passed
@rrudakovrrudakov deleted the feature/nested-indentation-rules branchApril 7, 2025 07:47
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@bbatsovbbatsovbbatsov approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@rrudakov@bbatsov

[8]ページ先頭

©2009-2025 Movatter.jp