Skip to content

Basic support for dynamic indentation #69

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

Merged
merged 1 commit into from
Apr 3, 2025

Conversation

rrudakov
Copy link
Contributor

@rrudakov rrudakov commented Apr 3, 2025

This PR introduces clojure-ts-get-indent-function variable, which can be set by CIDER as:

(setq-local clojure-ts-get-indent-function #'cider--get-symbol-indent)

to enable dynamic indentation based on :style/indent metadata. Currently it supports only first level, so {:style/indent 1} and {:style/indent [1 [[:defn]] :form]} are both translated to (:block 1) rule.

I haven't added anything to README, because it's internal change, similar function is not mentioned in clojure-mode readme as well.


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.
  • 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).

Thanks!

@bbatsov
Copy link
Member

bbatsov commented Apr 3, 2025

The change looks pretty good overall! We're now one step closer to full support for CIDER!

@rrudakov rrudakov force-pushed the feature/dynamic-indentation branch from 1222b1b to 5085667 Compare April 3, 2025 20:32
@rrudakov rrudakov requested a review from bbatsov April 3, 2025 20:32
@bbatsov bbatsov merged commit 9ae1f42 into clojure-emacs:main Apr 3, 2025
2 of 3 checks passed
@rrudakov rrudakov deleted the feature/dynamic-indentation branch April 4, 2025 09:17
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