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

Auto-formatting in calc #31

Open
RustanLeino opened this issue Jan 5, 2021 · 1 comment
Open

Auto-formatting in calc #31

RustanLeino opened this issue Jan 5, 2021 · 1 comment

Comments

@RustanLeino
Copy link
Contributor

The automatic formatting that dafny-mode performs does not produce nice results in calc statements. In fact, I find the automatic formatting is working against me, and I constantly have to correct what it's doing. I'd love to see this improved.

Repro:

Start with

lemma L() {
  calc {
  }
}

Then, inside the braces that follow the calc statement, type the following lines in order:

A(x);
==
B(x);
C(x);
==  // here is a comment
D(x);
==  { MyFavoriteLemma(x, y); }
E(x);
{ AnotherLemma(x, y); }
F(x);
<
100;

This produces:

lemma L() {
  calc {
    A(x);
    ==
      B(x);
      C(x);
      ==  // here is a comment
        D(x);
        ==  { MyFavoriteLemma(x, y); }
        E(x);
        { AnotherLemma(x, y); }
        F(x);
        <
          100;
  }
}

but I wish it would instead produce:

lemma L() {
  calc {
    A(x);
  ==
    B(x);
    C(x);
  ==  // here is a comment
    D(x);
  ==  { MyFavoriteLemma(x, y); }
    E(x);
    { AnotherLemma(x, y); }
    F(x);
  <
    100;
  }
}
@texastony
Copy link

The indenting provided by Boogie Friends,
when working on Dafny,
is a little frustrating.

One day, I hope to have time to push a PR to improve it.
One day...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants