public virtual void JumpToCurrentLine(string sourceFullFilename, int startLine, int startColumn, int endLine, int endColumn) { IViewContent viewContent = FileService.OpenFile(sourceFullFilename); if (viewContent != null) { IPositionable positionable = viewContent.GetService <IPositionable>(); if (positionable != null) { positionable.JumpTo(startLine, startColumn); } } }
public override void JumpToCurrentLine(string sourceFullFilename, int startLine, int startColumn, int endLine, int endColumn) { IViewContent viewContent = FileService.OpenFile(sourceFullFilename); if (viewContent != null) { IPositionable positionable = viewContent.GetService <IPositionable>(); if (positionable != null) { positionable.JumpTo(startLine, startColumn); } } CurrentLineBookmark.SetPosition(viewContent, startLine, startColumn, endLine, endColumn); }
/// <inheritdoc/> public IViewContent JumpToFilePosition(FileName fileName, int line, int column) { LoggingService.InfoFormatted("FileService\n\tJumping to File Position: [{0} : {1}x{2}]", fileName, line, column); if (fileName == null) { return(null); } NavigationService.SuspendLogging(); bool loggingResumed = false; try { IViewContent content = OpenFile(fileName); IPositionable positionable = content != null?content.GetService <IPositionable>() : null; if (positionable != null) { content.WorkbenchWindow.ActiveViewContent = content; NavigationService.ResumeLogging(); loggingResumed = true; positionable.JumpTo(Math.Max(1, line), Math.Max(1, column)); } else { NavigationService.ResumeLogging(); loggingResumed = true; NavigationService.Log(content); } return(content); } finally { LoggingService.InfoFormatted("FileService\n\tJumped to File Position: [{0} : {1}x{2}]", fileName, line, column); if (!loggingResumed) { NavigationService.ResumeLogging(); } } }