static void GoToDefinition(DefinitionInfo definition) { if (!definition.HasFileName()) { return; } var provider = FileService.OpenFile(definition.fileName) as ITextEditorProvider; if (provider != null) { Location location = provider.TextEditor.Document.OffsetToPosition(definition.minChar); FileService.JumpToFilePosition(definition.fileName, location.Line, location.Column); } }
static void GoToDefinition(DefinitionInfo definition) { if (!definition.HasFileName()) { return; } IViewContent view = FileService.OpenFile(definition.fileName); if (view == null) { return; } ITextEditor textEditor = view.GetService <ITextEditor>(); if (textEditor != null) { TextLocation location = textEditor.Document.GetLocation(definition.minChar); FileService.JumpToFilePosition(definition.fileName, location.Line, location.Column); } }