Skip to content

M-x fill-paragraph in comments regression vs clojure-mode #50

@stig

Description

@stig

Use the template below when reporting bugs. Please, make sure that
you're running the latest stable clojure-ts-mode and that the problem you're reporting
hasn't been reported (and potentially fixed) already.

Please, remove all of the placeholder text (the one in italics) in your final report!

Expected behavior

Clojure TS Mode should support comments being filled (using M-x fill-paragraph or similar) without disturbing surrounding code, like regular Clojure Mode.

Actual behavior

In Clojure TS Mode fill-paragraph will happily mangle surrounding code when attempting to do fill-paragraph on a comment.

Steps to reproduce the problem

This is extremely important! Providing us with a reliable way to reproduce
a problem will expedite its solution.

Place cursor somewhere in the comment of this example, and invoke M-x fill-paragraph:

(defn hello []
  ;; hello world
  ;; bar
  (println "hello world"))

This produces the following token salad:

(defn hello [] ;; hello world ;; bar (println "hello world"))

Instead I would expect to see this instead (and regular Clojure Mode does this)

(defn hello []
  ;; hello world bar
  (println "hello world"))

Environment & Version information

clojure-ts-mode version

clojure-ts-mode 0.2.2 (package: 20240725.1139)

tree-sitter-clojure grammar version

v0.0.12

Emacs version

GNU Emacs 29.4 (build 1, aarch64-apple-darwin23.5.0, NS appkit-2487.60 Version 14.5 (Build 23F79))

Operating system

MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions