Tags: 333fred/razor
Tags
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
Merge pull request dotnet#4659 from dotnet-maestro-bot/merge/main-to-… …main-vs-deps [automated] Merge branch 'main' => 'main-vs-deps'
[internal/release/3.1] Update dependencies from dnceng/internal/dotne… …t-extensions - Coherency Updates: - Microsoft.NETCore.App.Runtime.win-x64: from 3.1.19 to 3.1.19 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Runtime.win-x64: from 3.1.19 to 3.1.19 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Runtime.win-x64: from 3.1.19 to 3.1.19 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Runtime.win-x64: from 3.1.19 to 3.1.19 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Runtime.win-x64: from 3.1.19 to 3.1.19 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Internal: from 3.1.19-servicing.21416.10 to 3.1.19-servicing.21416.14 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Runtime.win-x64: from 3.1.19 to 3.1.19 (parent: Microsoft.Extensions.Logging)
Fix "add using" Razor light bulb (dotnet#4000) - After the LSP protocol refactor we weren't properly deserializing `SelectionRange` so we weren't understanding where a light bulb request was originating from resulting in us not providing any light bulbs. Fixes dotnet/aspnetcore#34891
Merged PR 16696: [internal/release/3.1] Update dependencies from dnce… …ng/internal/dotnet-extensions This pull request updates the following dependencies [marker]: <> (Begin:Coherency Updates) ## Coherency Updates The following updates ensure that dependencies with a *CoherentParentDependency* attribute were produced in a build used as input to the parent dependency's build. See [Dependency Description Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview) [DependencyUpdate]: <> (Begin) - **Coherency Updates**: - **Microsoft.NETCore.App.Runtime.win-x64**: from 3.1.18 to 3.1.18 (parent: Microsoft.Extensions.Logging) - **Microsoft.NETCore.App.Runtime.win-x64**: from 3.1.18 to 3.1.18 (parent: Microsoft.Extensions.Logging) - **Microsoft.NETCore.App.Runtime.win-x64**: from 3.1.18 to 3.1.18 (parent: Microsoft.Extensions.Logging) - **Microsoft.NETCore.App.Runtime.win-x64**: from 3.1.18 to 3.1.18 (parent: Microsoft.Extensions.Logging) - **Microsoft.NETCore.App.Runtime.win-x64**: from 3.1.18 to 3.1.18 (parent: Microsoft.Extensions.Logging) - **Microsoft.NETCore.App.Internal**: from 3.1.18-servicing.21363.6 to 3.1.18-servicing.21364.2 (parent: Microsoft.Extensions.Logging) - **Microsoft.NETCore.App.Runtime.win-x64**: from 3.1.18 to 3.1.18 (parent: Microsoft.Extensions.Logging) [DependencyUpdate]: <> (End) [marker]: <> (End:Coherency Updates) [marker]: <> (Begin:69367bda-f465-40d4-e1e9-08d79559e508) ## From https://dev.azure.com/dnceng/internal/_git/dotnet-extensions - **Subscription**: 69367bda-f465-40d4-e1e9-08d79559e508 - **Build**: 20210714.3 - **Date Produced**: 7/14/2021 7:01 PM - **Commit**: 9130c4bf47c4920f1f3dffb7504119c367b83808 - **Branch**: refs/heads/internal/release/3.1 [DependencyUpdate]: <> (Begin) - **Updates**: - **Microsoft.AspNetCore.BenchmarkRunner.Sources**: [from 3.1.18-servicing.21363.9 to 3.1.18-servicing.21364.3][1] - **Microsoft.AspNetCore.Testing**: [from 3.1.18-servicing.21363.9 to 3.1.18-servicing.21364.3][1] - **Microsoft.Extensions.CommandLineUtils.Sources**: [from 3.1.18-servicing.21363.9 to 3.1.18-servicing.21364.3][1] - **Microsoft.Extensions.NonCapturingTimer.Sources**: [from 3.1.18-servicing.21363.9 to 3.1.18-servicing.21364.3][1] - **Microsoft.Extensions.HashCodeCombiner.Sources**: [from 3.1.18-servicing.21363.9 to 3.1.18-servicing.21364.3][1] - **Microsoft.Extensions.Logging**: [from 3.1.18 to 3.1.18][1] - **Microsoft.NETCore.App.Runtime.win-x64**: [from 3.1.18 to 3.1.18][2] - **Microsoft.NETCore.App.Runtime.win-x64**: [from 3.1.18 to 3.1.18][2] - **Microsoft.NETCore.App.Runtime.win-x64**: [from 3.1.18 to 3.1.18][2] - **Microsoft.NETCore.App.Runtime.win-x64**: [from 3.1.18 to 3.1.18][2] - **Microsoft.NETCore.App.Runtime.win-x64**: [from 3.1.18 to 3.1.18][2] - **Microsoft.NETCore.App.Internal**: [from 3.1.18-servicing.21363.6 to 3.1.18-servicing.21364.2][2] - **Microsoft.NETCore.App.Runtime.win-x64**: [from 3.1.18 to 3.1.18][2] [1]: https://dev.az...
Merge pull request dotnet#3891 from dotnet-maestro-bot/merge/main-to-… …main-vs-deps [automated] Merge branch 'main' => 'main-vs-deps'
[internal/release/3.1] Update dependencies from dnceng/internal/dotne… …t-extensions - Coherency Updates: - Microsoft.NETCore.App.Runtime.win-x64: from 3.1.17 to 3.1.17 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Runtime.win-x64: from 3.1.17 to 3.1.17 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Runtime.win-x64: from 3.1.17 to 3.1.17 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Runtime.win-x64: from 3.1.17 to 3.1.17 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Runtime.win-x64: from 3.1.17 to 3.1.17 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Internal: from 3.1.17-servicing.21315.3 to 3.1.17-servicing.21315.11 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Runtime.win-x64: from 3.1.17 to 3.1.17 (parent: Microsoft.Extensions.Logging)
[internal/release/3.1] Update dependencies from dnceng/internal/dotne… …t-extensions - Coherency Updates: - Microsoft.NETCore.App.Runtime.win-x64: from 3.1.16 to 3.1.16 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Runtime.win-x64: from 3.1.16 to 3.1.16 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Runtime.win-x64: from 3.1.16 to 3.1.16 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Runtime.win-x64: from 3.1.16 to 3.1.16 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Runtime.win-x64: from 3.1.16 to 3.1.16 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Internal: from 3.1.16-servicing.21256.2 to 3.1.16-servicing.21262.7 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.App.Runtime.win-x64: from 3.1.16 to 3.1.16 (parent: Microsoft.Extensions.Logging) - Microsoft.NETCore.Platforms: from 3.1.6 to 3.1.7 (parent: Microsoft.NETCore.App.Runtime.win-x64)
Merge pull request dotnet#3567 from dotnet/nimullen/interopmerge Merge interop branch into vs17.0 branch