Closed dricketts closed 4 years ago
You're right, the PlusCal indentation doesn't work as expected with the c-syntax. I need to fix that.
@dricketts, it's fixed and will be delivered as a part of the v1.3.0 release.
BTW, if you put the algorithm closing curly brace and the closing comment parenthesis on the same line (} *)
), you'll get better TLA+ highlighting. The same problem as in #104.
Awesome, thanks.
I forgot about putting the closing comment on the same line as the closing curly brace. Thanks for reminding me.
@dricketts, the auto-indentation should work better with C-syntax in just released v1.3, so I'm closing the issue. Please, feel free to reopen it should the problem remain.
Indentation sometimes is a bit surprising for PlusCal c-syntax. If an algorithm has a procedure, then the plugin properly indents within the procedure, but also seems to continue to indent after the closing bracket of the procedure. For example, in the following algorithm, going to a new line after the closing bracket of F moves the cursor to the next indentation level.
Glancing at src/formatters/tla.ts, it looks like the block begin and end logic does not look for
{
and}
, but ratherbegin
andend
of the p-syntax.