Closed
Conversation
sean-mcmanus
approved these changes
Dec 9, 2022
Contributor
|
Does protocalFilter.ts file need comments to explain certain conditions or special cases to consider the next time any logic in this file needs to be changed in the future? |
Contributor
Author
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.
A more complete fix for: #10227
An issue had occurred with
didChange, as thecontentChangesfield of theTextDocumentChangeEventcan become inconsistent with thedocumentfield when re-evaluated late.This change removes most deferring from protocolFilter. There are still
await's that occur prior to processingdidOpen, but that seems to be OK - it should be valid to process the document passed todidOpenat any point. (The native code will discard any edits that are received for versions prior to the one received fromdidOpen, or when the file is not yet known to be open).This fix is based on the assumption that there are no otherwise unhandled order dependencies that must be enforced for these messages. The original implementation was designed to fundamental ensure all messages are processed serially, and this is removing code that ensured that. But, so far, I've been unable to identify any issues with these messages potentially occurring out of order relative to internal messages. These messages all represent actions the user has already performed, operations they want to initiate, etc., that could occur at any time, and therefore their ordering relative to internal messages is already indeterminate. When edits are involved or could invalidate an operation, we should also already be using the document version to verify the operation and discarding the results of the operation if versions do not match.