Add basic support for cancellation of resolution #4175
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Testing
I see improved behavior on large Dafny codebases with this change. The IDE generally becomes more responsive, switching away from 'Resolving...' into other states faster.
Given that from a user perspective the resolution process is black box, there's no contract for when in that process cancellation should be supported. I think the right way to test this is to have a codebase that takes a long time to resolve, and to test that changes will always cancel the current resolution within a time smaller than X. However, making such a test is time consuming and I would like to deliver this fix to users already, so I'm not adding such a test yet.
I also haven't added a test for the telemetry change but that is not a user facing change.
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.