public async Task GotoDeclaration_Update(CommandInfo ci, CancellationToken cancellationToken) { var doc = IdeApp.Workbench.ActiveDocument; if (doc == null || doc.FileName == FilePath.Null) { return; } if (DocumentContext.AnalysisDocument == null) { ci.Enabled = false; return; } var symbol = await GoToDefinitionService.FindSymbolAsync(base.DocumentContext.AnalysisDocument, Editor.CaretOffset, cancellationToken); ci.Enabled = symbol != null; }
public async void GotoDeclaration_Update(CommandInfo ci) { var doc = IdeApp.Workbench.ActiveDocument; if (doc == null || doc.FileName == FilePath.Null) { return; } if (doc.ParsedDocument == null || doc.ParsedDocument.GetAst <SemanticModel> () == null) { ci.Enabled = false; return; } var symbol = await GoToDefinitionService.FindSymbolAsync(base.DocumentContext.AnalysisDocument, Editor.CaretOffset, default(CancellationToken)); ci.Enabled = symbol != null; }
public void GotoDeclaration() { GoToDefinitionService.TryGoToDefinition(base.DocumentContext.AnalysisDocument, Editor.CaretOffset, default(CancellationToken)); }
public static void Run(MonoDevelop.Ide.Gui.Document doc) { GoToDefinitionService.TryGoToDefinition(doc.AnalysisDocument, doc.Editor.CaretOffset, default(CancellationToken)); }