Open dricketts opened 5 years ago
You're right, in a couple of cases the extension doesn't capture boundaries of a PlusCal algorithm correctly. There's a quick fix for this particular issue, but unfortunately, it brings other highlighting problems. VS Code has some limitations on grammar parsing, especially when it comes to embedded languages (PlusCal inside TLA+).
So, for the time being, I'll leave the highlighting rules as they are. But I'll add some kind of Caveats section to the Wiki. Thanks for the idea!
Thanks, that looks good to me.
There's an attempt to improve VS Code highlighting capabilities: https://github.com/microsoft/vscode/issues/77133. I hope the result will allow us to fix this issue.
BTW, it's also better to keep the closing curly bracket on the last comment line:
(*--algorithm WriteStealing {
{
skip;
}
} *)
The extension starting with version 1.2 handles it better.
A similar problem if opening bracket of define is on the next line:
define
{
...
}
This is extremely minor, but maybe worth noting in a wiki page. PlusCal syntax highlighting won't work if the algorithm is written as:
However, it does work if the algorithm is written as: