Browse Source

Cancel previous ResolveAtCaret() immediately when the caret is moved, don't wait for the timer to expire.

pull/478/head
Daniel Grunwald 12 years ago
parent
commit
b4cc68c9e8
  1. 4
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/CaretReferenceHighlightRenderer.cs

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

@ -141,6 +141,8 @@ namespace CSharpBinding @@ -141,6 +141,8 @@ namespace CSharpBinding
void CaretLocationChanged(object sender, EventArgs e)
{
if (caretMovementTokenSource != null)
caretMovementTokenSource.Cancel();
timer.Stop();
timer.Start();
}
@ -148,8 +150,6 @@ namespace CSharpBinding @@ -148,8 +150,6 @@ namespace CSharpBinding
void ResolveAtCaret()
{
timer.Stop();
if (caretMovementTokenSource != null)
caretMovementTokenSource.Cancel();
caretMovementTokenSource = new CancellationTokenSource();
var rr = SD.ParserService.Resolve(editor.FileName, editor.Caret.Location, editor.Document, cancellationToken: caretMovementTokenSource.Token);
SetCurrentSymbol(rr.GetSymbol());

Loading…
Cancel
Save