Fix restoration of problems (from watch task) when closing a file#183172
Closed
russelldavis wants to merge 1 commit intomicrosoft:mainfrom
Closed
Fix restoration of problems (from watch task) when closing a file#183172russelldavis wants to merge 1 commit intomicrosoft:mainfrom
russelldavis wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Fixes microsoft#47386 Logic was added in microsoft@df97bc3 to add a watcher's problems back to the problems view after closing a file. It doesn't work quite right though because of how `processLineInternal` batches up changes, only sending them to `markerService` when it gets called on subsequent lines with a different owner or resource. Because of that, the current behavior is that when you close a file with errors, the errors will disappear and only end up getting restored the next time a different file being watched gets saved. This PR fixes that (restoring the errors right after the file is closed) by calling `forceDelivery()`.
This was referenced May 23, 2023
Contributor
Author
|
Welp, I'm pretty sure my explanation above is wrong, and thus this PR is also the wrong fix. There is indeed a problem with restoring the problems when closing a file, but it looks like the actual cause is a race condition between the debounce timeout at vscode/src/vs/workbench/contrib/tasks/common/problemCollectors.ts Lines 437 to 439 in 91070de vscode/src/vs/workbench/contrib/tasks/common/problemCollectors.ts Lines 450 to 453 in 91070de Sorry for the confusion. Will follow up later with a proper fix. |
Contributor
Author
|
The proper fix for this is now at #183271 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #47386
Logic was added in df97bc3 to add a watcher's problems back to the problems view after closing a file.
It doesn't work quite right though because of howprocessLineInternalbatches up changes, only sending them tomarkerServicewhen it gets called on subsequent lines with a different owner or resource.Because of that, the current behavior is that when you close a file with errors, the errors will disappear and only end up getting restored the next time a different file being watched gets saved.
This PR fixes that (restoring the errors right after the file is closed) by calling
forceDelivery().cc @alexr00