-
Notifications
You must be signed in to change notification settings - Fork 263
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
Let the IDE translate to and resolve Boogie only when attempting to verify #4378
Let the IDE translate to and resolve Boogie only when attempting to verify #4378
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just finished my review. I did not test this PR myself yet, so I'm relying on the CI tests, although I did not find any obvious or potential issues in the code itself.
Source/DafnyLanguageServer.Test/Synchronization/VerificationStatusTest.cs
Outdated
Show resolved
Hide resolved
Source/DafnyLanguageServer.Test/Synchronization/VerificationStatusTest.cs
Show resolved
Hide resolved
} | ||
|
||
private IdeState CreateDocumentWithEmptySymbolTable(Compilation compilation, | ||
IReadOnlyDictionary<Uri, IReadOnlyList<Diagnostic>> resolutionDiagnostics) { | ||
var dafnyOptions = DafnyOptions.Default; | ||
var program = new EmptyNode(); | ||
return new IdeState( | ||
compilation.Version, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't that what was sufficient to ensure that gutter icons are handled in order?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like before the Ide state did not have this field and I remember you mentioning to me that because versioning had been lost, gutter icons were sometimes published in the wrong order. I was wondering if this fixes that.
…dafny into onDemandPreverification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor typo and I think it's good to go!
Source/DafnyLanguageServer.Test/Synchronization/VerificationStatusTest.cs
Outdated
Show resolved
Hide resolved
} | ||
|
||
private IdeState CreateDocumentWithEmptySymbolTable(Compilation compilation, | ||
IReadOnlyDictionary<Uri, IReadOnlyList<Diagnostic>> resolutionDiagnostics) { | ||
var dafnyOptions = DafnyOptions.Default; | ||
var program = new EmptyNode(); | ||
return new IdeState( | ||
compilation.Version, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like before the Ide state did not have this field and I remember you mentioning to me that because versioning had been lost, gutter icons were sometimes published in the wrong order. I was wondering if this fixes that.
…atusTest.cs Co-authored-by: Mikaël Mayer <[email protected]>
It previously sort of had this field, through its other field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this excellent work.
This was breaking a CI for the last 3 runs
…erify (dafny-lang#4378) Depends on dafny-lang#4395 ### Changes Let the IDE translate to and resolve Boogie only when attempting to verify, instead of doing those steps for all code in the project right after resolution, and before allowing any verification to be done. - Using the experimental verification caching feature to detect which tasks were already verified before the user triggers any verification, no longer works. This is because that caching relies on pre-verification which we now only do when the user triggers verification. However, when trying to verify these cached tasks, they'll be completed immediately after pre-verification finishes. In the future, we will have to implement caching of verification based on the Dafny AST if we want it to show up before pre-verification. - The Dafny AST nodes must now specify whether they can be verified, even before being translated to Boogie. This creates a slight duplication of effort, since this information was implicitly also provided by the Boogie translation ### Testing - Existing tests have been adapted for the new behavior - The performance part improvement of this PR is not tested, since we don't have a good framework for testing performance. - Add tests for the behavior of `OnChangeFile` and `OnChangeProject` mode. <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small> --------- Co-authored-by: Aaron Tomb <[email protected]>
…erify (#4378) Depends on #4395 ### Changes Let the IDE translate to and resolve Boogie only when attempting to verify, instead of doing those steps for all code in the project right after resolution, and before allowing any verification to be done. - Using the experimental verification caching feature to detect which tasks were already verified before the user triggers any verification, no longer works. This is because that caching relies on pre-verification which we now only do when the user triggers verification. However, when trying to verify these cached tasks, they'll be completed immediately after pre-verification finishes. In the future, we will have to implement caching of verification based on the Dafny AST if we want it to show up before pre-verification. - The Dafny AST nodes must now specify whether they can be verified, even before being translated to Boogie. This creates a slight duplication of effort, since this information was implicitly also provided by the Boogie translation ### Testing - Existing tests have been adapted for the new behavior - The performance part improvement of this PR is not tested, since we don't have a good framework for testing performance. - Add tests for the behavior of `OnChangeFile` and `OnChangeProject` mode. <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small> --------- Co-authored-by: Aaron Tomb <[email protected]>
Changes
Let the IDE translate to and resolve Boogie only when attempting to verify, instead of doing those steps for all code in the project right after resolution, and before allowing any verification to be done.
Properly close files after they are read, both
.dfy
and.dfyconfig.toml
filesXUnit tests now all run sequentially. This does not seem to have a significant affect on total test runtime and makes debugging test timeouts easier because it excludes lack of available threads as a cause.
The class
ConstantField
is moved to a separate fileAdd AutoGeneratedToken where they were missing.
Configure the
dotnet test
call on the CLI so individual server tests won't run for more than 6 minutes.Split the existing
OnChange
mode intoOnChangeFile
andOnChangeProject
, which let verification automatically run if either their containing file or containing project has changed, respectively.Stringify
, a method to help with debugging, has been improvedSmall cleanup of
CounterExampleTest
, changing aList<Action>
into anAction
Many improvements to logging
Testing
OnChangeFile
andOnChangeProject
mode.Stringify
FindNode
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.