internal static void NavigateTo(System.IServiceProvider serviceProvider, string filename, Guid docViewGuidType, int line, int col) { if (File.Exists(filename)) { VsUtilities.NavigateTo(serviceProvider, filename, docViewGuidType, line, col); } }
internal static ITextBuffer GetBufferForDocument(IServiceProvider serviceProvider, string filename) { VsUtilities.OpenDocument(serviceProvider, filename, out var viewAdapter, out _); ErrorHandler.ThrowOnFailure(viewAdapter.GetBuffer(out var lines)); var adapter = serviceProvider.GetComponentModel().GetService <IVsEditorAdaptersFactoryService>(); return(adapter.GetDocumentBuffer(lines)); }
internal static void NavigateTo(System.IServiceProvider serviceProvider, string filename, Guid docViewGuidType, int pos) { VsUtilities.OpenDocument(serviceProvider, filename, out var viewAdapter, out var pWindowFrame); ErrorHandler.ThrowOnFailure(pWindowFrame.Show()); // Set the cursor at the beginning of the declaration. ErrorHandler.ThrowOnFailure(viewAdapter.GetLineAndColumn(pos, out var line, out var col)); ErrorHandler.ThrowOnFailure(viewAdapter.SetCaretPos(line, col)); // Make sure that the text is visible. viewAdapter.CenterLines(line, 1); }
internal static ITextBuffer GetBufferForDocument(System.IServiceProvider serviceProvider, string filename) { IVsTextView viewAdapter; IVsWindowFrame frame; VsUtilities.OpenDocument(serviceProvider, filename, out viewAdapter, out frame); IVsTextLines lines; ErrorHandler.ThrowOnFailure(viewAdapter.GetBuffer(out lines)); var adapter = serviceProvider.GetComponentModel().GetService<IVsEditorAdaptersFactoryService>(); return adapter.GetDocumentBuffer(lines); }
public ProjectModel(string name, string fullPath, string projectIdentifier, ProjectKind kind, string projectKindId, string rootNamespace) { Name = name; FullPath = fullPath; Kind = kind; KindId = projectKindId; ProjectIdentifier = projectIdentifier; RootNamespace = rootNamespace; Children = new List <ProjectModel>(); TypeDescription = VsUtilities.GetProjectTypeDescription(projectKindId); }
private void NavigateTo(string targetFilepath, int targetLine, int targetColumn) { string sourceFilepath = _textBuffer.GetTextDocument().FilePath; if (sourceFilepath == targetFilepath) { // Current File ITextSnapshotLine newLine = _textBuffer.CurrentSnapshot.Lines.ElementAt(targetLine); _textView.Caret.MoveTo(newLine.Start.Add(targetColumn)); _textView.ViewScroller.EnsureSpanVisible(_textView.GetTextElementSpan(newLine.Start)); } else { // Other File VsUtilities.NavigateTo(_serviceProvider, targetFilepath, Guid.Empty, targetLine, targetColumn); } }
internal static void NavigateTo(string filename, int pos) { VsUtilities.NavigateTo(Instance, filename, NodejsProjectNode.IsNodejsFile(filename) ? typeof(NodejsEditorFactory).GUID : Guid.Empty, pos); }
internal static void NavigateTo(string filename, int pos) { VsUtilities.NavigateTo(Instance, filename, Guid.Empty, pos); }
internal static void NavigateTo(string filename, int line, int col) { VsUtilities.NavigateTo(Instance, filename, Guid.Empty, line, col); }
internal static void NavigateTo(System.IServiceProvider serviceProvider, string filename, Guid docViewGuidType, int pos) { VsUtilities.NavigateTo(serviceProvider, filename, docViewGuidType, pos); }