clojure-emacs / clojure-ts-mode

The next generation Clojure major mode for Emacs, powered by TreeSitter
GNU General Public License v3.0
129 stars 11 forks source link

Add clojure-ts-toplevel-inside-comment-form #31

Closed kommen closed 7 months ago

kommen commented 7 months ago

Fixes #30

clojure-ts-toplevel-inside-comment-form is the equivalent to clojure-toplevel-inside-comment-form in clojure-mode. Defaults to nil so no change in behavior by default.

This change makes use of treesit-defun-type-regexps ability to use (REGEXP . PRED) cons cells to reject comment as a defun if clojure-ts-toplevel-inside-comment-form is enabled.

bbatsov commented 7 months ago

I like the proposed change. I'd suggest mentioning in the README as well, so it'd be easier for users to discover it.

bbatsov commented 7 months ago

Can you also mention it here https://github.com/clojure-emacs/clojure-ts-mode?tab=readme-ov-file#configuration?

kommen commented 7 months ago

@bbatsov is https://github.com/clojure-emacs/clojure-ts-mode/pull/31/commits/ddc669615077f8034f321d4609920577e2e19328 enough?

bbatsov commented 7 months ago

Yeah, that's enough. Thanks!