Calculate exception regions when an active statement is deleted#5744
Merged
tmat merged 1 commit intodotnet:masterfrom Oct 7, 2015
Merged
Calculate exception regions when an active statement is deleted#5744tmat merged 1 commit intodotnet:masterfrom
tmat merged 1 commit intodotnet:masterfrom
Conversation
Member
Author
|
test win please |
tmat
added a commit
that referenced
this pull request
Oct 7, 2015
Calculate exception regions when an active statement is deleted
jjonescz
pushed a commit
to jjonescz/roslyn
that referenced
this pull request
Apr 28, 2026
* Fix HTML completion race when typing too quickly
- There was a race when typing too quickly our synchronization mechanism would try and reduce the work that was done to cancel pre-existing requests. So in the scenario when you were to type `<tr` what would happen is that 3 completion requests would fire:
1. Triggered completion for `<`
2. Typing completion for `t`
3. Typing completion for `r`
Now when we sped things up we were able to process requests in parallel which meant that we could handle simultaneous requests for `<`, `t` and `r` all at the same time; however, this in turn results in an interesting behavior where if we ask for completion at `r` while `<` and `t` are still active our synchronization mechanism would aggressively cancel the older requests. For completion this is catastrohpic because it would result in a 0 length completion list because HTML does not respect completion requests beyond trigger characters and the beginning of the word.
- To fix this issue I added a new mechanism for synchronization which takes a flag `rejectOnNewerParallelRequest` which states do not reject a synchronization request aggressively if this flag is `true`. Now this doesn't mean the requests never get rejected. If there's a batched document update or document close / open this will still reject the document; it just means that on the requesting of synchronization that older completion requests are not rejected eagerly.
- Added tests to our projection and synchronization stack to account for this
- Ensured that these changes are not breaking changes so marked some bits as virtual.
### Before

### After

Fixes dotnet#5743
* Update src/Razor/src/Microsoft.VisualStudio.LanguageServer.ContainedLanguage/LSPDocumentSynchronizer.cs
Co-authored-by: Allison Chou <allichou@microsoft.com>
* Fix newer tests.
Co-authored-by: Allison Chou <allichou@microsoft.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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 internal bug 131449: VS crashed when active statement in catch or finally clause was deleted or commented out.