Add indentation rules for GLSL syntax#58520
Conversation
Add C-Style indentation rules for GLSL
MrSubidubi
left a comment
There was a problem hiding this comment.
Thanks for this!
Overall looks fine, one minor note
| ((comment) @indent | ||
| (#match? @indent "^/\\*")) |
There was a problem hiding this comment.
Curious whether we can instead not add either block_comments or documentation_comment to the language config?
There was a problem hiding this comment.
This indents.scm is essentially just a copy of the one C uses. I can remove those lines if it’s not needed here
There was a problem hiding this comment.
Tried getting it to work but it seems that glsl treesitter doesn't support block comments so adding
block_comment = { start = "/*", prefix = "", end = "*/", tab_size = 1 } &
documentation_comment = { start = "/**", prefix = "* ", end = "*/", tab_size = 1} to config.toml didn't do anything. I have removed the lines, normal comments are probably sufficient anyways.
There was a problem hiding this comment.
Hm that is odd since this should really be unrelated to Tree-sitter IIRC. If you are down, feel free to push a follow-up or dig this more if you can find the underlying issue. Maybe you need to specify a non-empty prefix? Would need to check, but perhaps something did break.
Removed indentation rule for comments starting with '/*'.
MrSubidubi
left a comment
There was a problem hiding this comment.
Definitely a solid improvement and happy to merge. Thanks!
Add C-Style indentation rules for GLSL. By adding an indents.scm file for GLSL we get the same automatic indentation as we have for other languages.
Release Notes: