Skip to content

Calculate exception regions when an active statement is deleted#5744

Merged
tmat merged 1 commit intodotnet:masterfrom
tmat:EncExceptionRegionFix
Oct 7, 2015
Merged

Calculate exception regions when an active statement is deleted#5744
tmat merged 1 commit intodotnet:masterfrom
tmat:EncExceptionRegionFix

Conversation

@tmat
Copy link
Copy Markdown
Member

@tmat tmat commented Oct 7, 2015

Fixes internal bug 131449: VS crashed when active statement in catch or finally clause was deleted or commented out.

@tmat
Copy link
Copy Markdown
Member Author

tmat commented Oct 7, 2015

test win please

tmat added a commit that referenced this pull request Oct 7, 2015
Calculate exception regions when an active statement is deleted
@tmat tmat merged commit 86a7e80 into dotnet:master Oct 7, 2015
@tmat tmat deleted the EncExceptionRegionFix branch October 7, 2015 20:21
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

![before image](https://i.imgur.com/sZfGaub.gif)

### After

![after image](https://i.imgur.com/5EsJdDm.gif)

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants