-
Notifications
You must be signed in to change notification settings - Fork 257
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
Add support for concurrent document updates #1456
Conversation
…a document migration.
This mechanic can be easily changed or made configurable. Just pass dafny/Source/DafnyLanguageServer/Workspace/DocumentDatabase.cs Lines 115 to 123 in 2c136bb
Sounds like a fair statement for me.
Thanks, I'm glad that the effort was worth it. |
if (newDocument.SymbolTable.Resolved) { | ||
return newDocument; | ||
} | ||
return MigrateDocument(mergedText, newDocument, changeProcessor, false); |
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.
Is this migration so that in case of parse errors, we keep outdated resolution results since we're unable to compute new ones? Apparently the errors aren't migrated, so the new parse errors remain.
In any case, could you add a comment explaining this call?
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.
done
What does "applying a change" mean here? Another |
It means making any edit to (any file in?) your program. |
Only a change (text edit) in the same file cancels its ongoing verification. Changes to any other file won't affect the verification, even if the changed file was included by the currently verified file. |
…y-lang/dafny into camrein/concurrent-document-updates
Hm, should we cancel it also for included files? I could see us lose trust in the verification results if there's a possibility that there might be a discrepancy. |
Just for clarification, to ensure we're talking about the same thing.
If a verification of A is currently running, it will be canceled if one changes A. The running verification won't be canceled if one edits B or C. This is a similar behavior that could be observed prior this PR: If A had reported that there are errors in B, the error won't go away by only updating B. A has to be edited/saved/reopened to trigger a reload of the includes. |
This PR resolves #1448 and dafny-lang/ide-vscode#31. I've reworked the document database and added the following features to the language server:
ObjectDisposedException
inside boogie when using the cancellation API. Otherwise, it appears to be functioning.these requests will be canceled as they might wait for an outdated document state.these requests receive the migrated information of the version requested.This PR is work in progress and some parts need refactorings. Furthermore, this PR depends on the changes introduced in #1452.