public override void CursorPositionChanged()
 {
     CancelQuickFixTimer();
     if (QuickTaskStrip.EnableFancyFeatures && Document.ParsedDocument != null && !Debugger.DebuggingService.IsDebugging)
     {
         quickFixCancellationTokenSource = new CancellationTokenSource();
         var token = quickFixCancellationTokenSource.Token;
         quickFixTimeout = GLib.Timeout.Add(100, delegate {
             var loc = Document.Editor.Caret.Location;
             RefactoringService.QueueQuickFixAnalysis(Document, loc, token, delegate(List <CodeAction> fixes) {
                 if (!fixes.Any())
                 {
                     ICSharpCode.NRefactory.Semantics.ResolveResult resolveResult;
                     AstNode node;
                     if (ResolveCommandHandler.ResolveAt(document, out resolveResult, out node, token))
                     {
                         var possibleNamespaces = ResolveCommandHandler.GetPossibleNamespaces(document, node, ref resolveResult);
                         if (!possibleNamespaces.Any())
                         {
                             if (currentSmartTag != null)
                             {
                                 Application.Invoke(delegate { RemoveWidget(); });
                             }
                             return;
                         }
                     }
                     else
                     {
                         if (currentSmartTag != null)
                         {
                             Application.Invoke(delegate { RemoveWidget(); });
                         }
                         return;
                     }
                 }
                 Application.Invoke(delegate {
                     if (token.IsCancellationRequested)
                     {
                         return;
                     }
                     CreateSmartTag(fixes, loc);
                     quickFixTimeout = 0;
                 });
             });
             return(false);
         });
     }
     else
     {
         RemoveWidget();
     }
     base.CursorPositionChanged();
 }
Пример #2
0
        public override void CursorPositionChanged()
        {
            RemoveWidget();

            if (Document.ParsedDocument != null && Document.Editor != null && Document.Editor.Caret != null)
            {
                DomLocation loc = new DomLocation(Document.Editor.Caret.Line, Document.Editor.Caret.Column);
                RefactoringService.QueueQuickFixAnalysis(Document, loc, delegate(List <ContextAction> fixes) {
                    Application.Invoke(delegate {
                        RemoveWidget();
                        CreateWidget(fixes, loc);
                    });
                });
            }
            base.CursorPositionChanged();
        }
        public override void CursorPositionChanged()
        {
            RemoveWidget();
            CancelQuickFixTimer();

            if (QuickTaskStrip.EnableFancyFeatures && Document.ParsedDocument != null)
            {
                quickFixTimeout = GLib.Timeout.Add(100, delegate {
                    var loc = Document.Editor.Caret.Location;
                    RefactoringService.QueueQuickFixAnalysis(Document, loc, delegate(List <CodeAction> fixes) {
                        Application.Invoke(delegate {
                            RemoveWidget();
                            CreateWidget(fixes, loc);
                        });
                    });
                    quickFixTimeout = 0;
                    return(false);
                });
            }
            base.CursorPositionChanged();
        }