Add TextBuffer snapshot restriction back to VisualStudioRazorParser.

This commit is contained in:
N. Taylor Mullen 2017-11-07 10:50:06 -08:00
parent 399dcca4f2
commit 801ad07560
1 changed files with 3 additions and 2 deletions

View File

@ -370,9 +370,10 @@ namespace Microsoft.VisualStudio.Editor.Razor
var args = (DocumentStructureChangedEventArgs)state;
if (_latestChangeReference == null || // extra hardening
!_latestChangeReference.IsAssociatedWith(args))
!_latestChangeReference.IsAssociatedWith(args) ||
args.Snapshot != TextBuffer.CurrentSnapshot)
{
// In the middle of parsing a newer change.
// In the middle of parsing a newer change or about to parse a newer change.
return;
}