hugo icon indicating copy to clipboard operation
hugo copied to clipboard

Support for tree-sitter

Open UtkarshVerma opened this issue 5 months ago • 2 comments

Hugo's existing support for syntax highlighting is good, but using tree-sitter would be a huge improvement. They have Go bindings for it as well at go-tree-sitter.

This is not something critical and I simply leave this as a suggestion.

UtkarshVerma avatar Jan 26 '24 11:01 UtkarshVerma

Dependency wise this would, I guess, fall into the libsass/webp category (C/C++/zig?), which I have said (for many good reasons) we will only do if:

  1. There's no good Go native alternative.
  2. This is a real must have for Hugo.

In my head,

Chroma (the native Go alternative) is very good, which should at least satisfy the first point.

But I'll leave this proposal open for others to chime in.

bep avatar Jan 26 '24 11:01 bep

One area where chroma really doesn't shine is for the console format/type. It doesn't support newline escapes for multiline input for example. But I'm not sure tree-sitter would help with that because afaik there's no console parser/query for tree-sitter.

dvdksn avatar Feb 05 '24 21:02 dvdksn