Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlusCal syntax highlighting breaks if --algorithm is not on line of open comment #104

Open
dricketts opened this issue Sep 26, 2019 · 6 comments
Labels
bug Something isn't working on hold Cannot be fixed/implemented right now

Comments

@dricketts
Copy link

This is extremely minor, but maybe worth noting in a wiki page. PlusCal syntax highlighting won't work if the algorithm is written as:

(*
--algorithm WriteStealing
{
{
    skip;
}
}
*)

However, it does work if the algorithm is written as:

(*--algorithm WriteStealing
{
{
    skip;
}
}
*)
@alygin alygin added the bug Something isn't working label Sep 26, 2019
@alygin
Copy link
Contributor

alygin commented Sep 26, 2019

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!

@alygin
Copy link
Contributor

alygin commented Oct 2, 2019

Here it is: Caveats

@dricketts
Copy link
Author

Thanks, that looks good to me.

@alygin
Copy link
Contributor

alygin commented Oct 7, 2019

There's an attempt to improve VS Code highlighting capabilities: microsoft/vscode#77133. I hope the result will allow us to fix this issue.

@alygin
Copy link
Contributor

alygin commented Oct 20, 2019

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.

@lemmy
Copy link
Member

lemmy commented Feb 26, 2022

A similar problem if opening bracket of define is on the next line:

define
{
   ...
}

See https://github.com/lemmy/azure-cosmos-tla/blob/6e4e505a663ced50a61120219a70c7a2c1ae0f17/general-model/cosmos_client.tla#L84-L85

@lemmy lemmy pinned this issue Dec 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working on hold Cannot be fixed/implemented right now
Development

No branches or pull requests

3 participants