tree-sitter-bash
tree-sitter-bash copied to clipboard
After a backslash, the `#` character should not begin a comment
The problem
Everything after # on line 5 is highlighted as a comment, while it should not be allowed.
sudo dnf remove -y \
krdc \
kmail \
kgpg \
krusader \ # the old kde twinstyle file manager
kruler
Example from https://github.com/atom/language-shellscript/issues/150
The Solution
- We could either highlight this comment as an error to warn the user that this is not allowed.
- The quick solution would be not to scope what's after the # is a comment, thus not misleading the user and also not breaking the highlighting after the comment, since line 6 is considered a separate function call, rather than part of the sudo command.
Issue-Label Bot is automatically applying the label bug
to this issue, with a confidence of 0.75. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
Simpler runnable example:
$ echo \ # hi
Prints:
# hi
Current situation (just for clarity):