nixfmt icon indicating copy to clipboard operation
nixfmt copied to clipboard

/* comments */ should not be reformatted

Open toastal opened this issue 10 months ago • 18 comments

Description

/* */ style comments should not be reformatted. They have additional use cases such as tree-sitter picking up the the syntax to highlight before scripts inside multiline strings.

Small example input

/* lua */ ''
  print("Hello, world!")
''

Expected output

/* lua */ ''
  print("Hello, world!")
''

(now tree-sitter in my editor highlights this string to Lua which really helps me read/write code in this block now that it’s not just syntax highlighted as a string)

Actual output

# lua
''
  print("Hello, world!")
''

toastal avatar Apr 02 '24 07:04 toastal