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

Unexpected auto-indentation for PlusCal c-syntax #120

Closed
dricketts opened this issue Nov 15, 2019 · 4 comments
Closed

Unexpected auto-indentation for PlusCal c-syntax #120

dricketts opened this issue Nov 15, 2019 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@dricketts
Copy link

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.

(*--algorithm Test
{
    procedure F() {
        l2: skip;
    }
        
    process (P \in {})
    {
        l1: skip;
    }

}
*)

Glancing at src/formatters/tla.ts, it looks like the block begin and end logic does not look for { and }, but rather begin and end of the p-syntax.

@alygin
Copy link
Contributor

alygin commented Nov 15, 2019

You're right, the PlusCal indentation doesn't work as expected with the c-syntax. I need to fix that.

@alygin alygin added the bug Something isn't working label Nov 15, 2019
@alygin alygin added this to the v1.3.0 milestone Nov 15, 2019
alygin added a commit that referenced this issue Nov 16, 2019
@alygin
Copy link
Contributor

alygin commented Nov 16, 2019

@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.

@dricketts
Copy link
Author

Awesome, thanks.

I forgot about putting the closing comment on the same line as the closing curly brace. Thanks for reminding me.

@alygin alygin self-assigned this Dec 1, 2019
@alygin
Copy link
Contributor

alygin commented Jan 5, 2020

@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.

@alygin alygin closed this as completed Jan 5, 2020
lemmy pushed a commit to lemmy/vscode-tlaplus that referenced this issue Apr 5, 2021
lemmy pushed a commit to lemmy/vscode-tlaplus that referenced this issue Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants