Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit b4cc68c

Browse files
committed
Cancel previous ResolveAtCaret() immediately when the caret is moved, don't wait for the timer to expire.
1 parent 366b443 commit b4cc68c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/AddIns/BackendBindings/CSharpBinding/Project/Src/CaretReferenceHighlightRenderer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,15 @@ void LoadSolutionProjectsThreadFinished(object sender, EventArgs e)
141141

142142
void CaretLocationChanged(object sender, EventArgs e)
143143
{
144+
if (caretMovementTokenSource != null)
145+
caretMovementTokenSource.Cancel();
144146
timer.Stop();
145147
timer.Start();
146148
}
147149

148150
void ResolveAtCaret()
149151
{
150152
timer.Stop();
151-
if (caretMovementTokenSource != null)
152-
caretMovementTokenSource.Cancel();
153153
caretMovementTokenSource = new CancellationTokenSource();
154154
var rr = SD.ParserService.Resolve(editor.FileName, editor.Caret.Location, editor.Document, cancellationToken: caretMovementTokenSource.Token);
155155
SetCurrentSymbol(rr.GetSymbol());

0 commit comments

Comments
 (0)