Skip to content

Implement clojure-ts-align #83

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 23, 2025

Conversation

rrudakov
Copy link
Contributor

@rrudakov rrudakov commented Apr 18, 2025

First part for #16

The code is adapted from clojure-mode, but I used treesit-* API wherever it was appropriate and possible. The most difficult part is dealing with metadata, I left comments describing how it works.

The function is bound to C-c SPC in clojure-ts-mode-map, similar to clojure-mode.

I also disabled tab-indent-mode by default for clojure-ts-mode, similar to clojure-mode, otherwise it tries to use tabs for alignment and sometimes it looks ugly.


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!

@rrudakov rrudakov force-pushed the feature/16-align-forms branch from 69f9fa9 to b9d8ae1 Compare April 18, 2025 16:12
@rrudakov rrudakov marked this pull request as draft April 18, 2025 16:17
@rrudakov rrudakov force-pushed the feature/16-align-forms branch from b9d8ae1 to 15434f0 Compare April 18, 2025 18:24
@rrudakov rrudakov marked this pull request as ready for review April 18, 2025 18:24
@rrudakov
Copy link
Contributor Author

The initial version was very slow, so I had to do some optimizations. Now it's pretty fast even in large buffers.

@rrudakov rrudakov force-pushed the feature/16-align-forms branch from 15434f0 to 2ad63f5 Compare April 18, 2025 18:32
@rrudakov rrudakov force-pushed the feature/16-align-forms branch from 2ad63f5 to 862d391 Compare April 21, 2025 16:48
@rrudakov
Copy link
Contributor Author

rrudakov commented Apr 23, 2025

Anybody? @bbatsov?

@bbatsov
Copy link
Member

bbatsov commented Apr 23, 2025

I'm always around. ;-)

@rrudakov
Copy link
Contributor Author

I'm always around. ;-)

Sorry for pinging you :) Could you please review this when you have a chance?

I'd like to contribute more, but I don't want to keep many conflicting branches in my fork.

@bbatsov bbatsov merged commit 61041c8 into clojure-emacs:main Apr 23, 2025
3 checks passed
@bbatsov
Copy link
Member

bbatsov commented Apr 23, 2025

The changes look great! Impressive work!

@rrudakov rrudakov deleted the feature/16-align-forms branch April 23, 2025 10:49
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