-
Notifications
You must be signed in to change notification settings - Fork 262
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
Move compilation status updates to notification publisher #4454
Move compilation status updates to notification publisher #4454
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.
Two non blocking comments. and I agree with the simplification. Well done.
@@ -21,7 +21,7 @@ public class CompilationStatusNotificationTest : ClientBasedLanguageServerTest { | |||
[Fact] | |||
public async Task MultipleDocuments() { | |||
var source = @" | |||
method Foo() returns (x: int) ensures x / 2 == 1; { | |||
method Foo() returns (x: int) { |
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.
Why did you remove the ensures clause?
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.
Part of debugging, but it's not needed
var program = parser.Parse(compilation, errorReporter, cancellationToken); | ||
var compilationAfterParsing = new CompilationAfterParsing(compilation, program, errorReporter.AllDiagnosticsCopy, | ||
compilation.RootUris.ToDictionary(uri => uri, | ||
uri => migratedVerificationTrees.GetValueOrDefault(uri) ?? new DocumentVerificationTree(program, uri))); | ||
if (errorReporter.HasErrors) { | ||
_ = statusPublisher.SendStatusNotification(compilation, CompilationStatus.ParsingFailed); |
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.
Did you ensure that parsing failures are still sent? Normally there should be a test for that but I have not checked.
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.
There are tests for it yes
…#4454) Fixes dafny-lang#4451 ### Changes - symbolStatus notifications are resent after any document change is made. - "Parsing" is no longer sent when opening a file because it's the default state for a file. This requires an update on the client to return to the old behavior, but in the meantime it's OK for the client to have this tiny regression. - "Preparing Verification" no longer exists as a notification. Because one verifiable can be preparing verification while another is verifying, there is no longer a global "Preparing verification" state so this notification lost its meaning. We can bring something like this back but on a more granular level. - "Resolution Succeeded (not verified)" (UI name) / CompilationSucceeded (server name) no longer exists as a notification. This sat between ResolutionStarted and symbolStatus notifications that indicated which symbols could be verified, but in practice was never shown because immediately after it symbolStatus notifications would be sent that trigger a status like "Verified X declarations, skipped Y" - `CompilationManager` no longer sends any status updates to the IDE client, bringing it closer to being able to be moved to `DafnyCore` and used by the CLI. ### Testing - Updated automating tests <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>
Fixes #4451 ### Changes - symbolStatus notifications are resent after any document change is made. - "Parsing" is no longer sent when opening a file because it's the default state for a file. This requires an update on the client to return to the old behavior, but in the meantime it's OK for the client to have this tiny regression. - "Preparing Verification" no longer exists as a notification. Because one verifiable can be preparing verification while another is verifying, there is no longer a global "Preparing verification" state so this notification lost its meaning. We can bring something like this back but on a more granular level. - "Resolution Succeeded (not verified)" (UI name) / CompilationSucceeded (server name) no longer exists as a notification. This sat between ResolutionStarted and symbolStatus notifications that indicated which symbols could be verified, but in practice was never shown because immediately after it symbolStatus notifications would be sent that trigger a status like "Verified X declarations, skipped Y" - `CompilationManager` no longer sends any status updates to the IDE client, bringing it closer to being able to be moved to `DafnyCore` and used by the CLI. ### Testing - Updated automating tests <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>
Fixes #4451
Changes
CompilationManager
no longer sends any status updates to the IDE client, bringing it closer to being able to be moved toDafnyCore
and used by the CLI.Testing
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.