clojure-emacs / clojure-ts-mode

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

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

Closed kommen closed 9 months ago

kommen commented 9 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 9 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 9 months ago

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

kommen commented 9 months ago

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

bbatsov commented 9 months ago

Yeah, that's enough. Thanks!