From 801ad075601be8f3d04ff49a0ddf411fb43d32e6 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Tue, 7 Nov 2017 10:50:06 -0800 Subject: [PATCH] Add TextBuffer snapshot restriction back to VisualStudioRazorParser. --- .../DefaultVisualStudioRazorParser.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.VisualStudio.Editor.Razor/DefaultVisualStudioRazorParser.cs b/src/Microsoft.VisualStudio.Editor.Razor/DefaultVisualStudioRazorParser.cs index 816e21bbfe..4962d978ee 100644 --- a/src/Microsoft.VisualStudio.Editor.Razor/DefaultVisualStudioRazorParser.cs +++ b/src/Microsoft.VisualStudio.Editor.Razor/DefaultVisualStudioRazorParser.cs @@ -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; }