Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions runtime/syntax/sh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ rules:
rules: []

- constant.string:
start: "<<[^\\s]+[-~.]*[A-Za-z0-9]+$"
end: "^[^\\s]+[A-Za-z0-9]+$"
start: "<<-?[\\s]*[\\w,.:~#!§$%=?@*+-]+$"
end: "^[\\w,.:~#!§$%=?@*+-]+$"
Comment on lines +60 to +61
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do people actually use punctuation for defining heredocs? I think it would be beneficial to keep the set of characters more realistic to reduce likelihood of false positives when looking for the end token.

Copy link
Collaborator Author

@JoeKar JoeKar Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really know if they are used, but they are at least allowed. I tried them with the bash.
In case we ignore a valid character there will most probably be a ticket complaining about it. 🤷‍♂️

Edit:
By taking a closer look at [\\s] the [] can be removed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never seen punctuation used for heredocs but I guess some other editors also allow it (although they don't need to worry about false positives for the end delimiter):

skip: "\\\\."
rules: []

Expand Down