/// <summary> /// Gets the file content in the specified range as a string. /// </summary> /// <param name="bufferRange">The buffer range for which content will be extracted.</param> /// <returns>A string with the specified range of content.</returns> public string GetText(FileRange bufferRange) { return (string.Join( Environment.NewLine, this.GetTextLines(bufferRange))); }
/// <summary> /// Sets a selection in the host editor's active buffer. /// </summary> /// <param name="selectionRange">The range of the selection.</param> public void SetSelection(FileRange selectionRange) { this.editorOperations .SetSelectionAsync(selectionRange.ToBufferRange()) .Wait(); }
/// <summary> /// Gets the file content in the specified range as an array of strings. /// </summary> /// <param name="bufferRange">The buffer range for which content will be extracted.</param> /// <returns>An array of strings, each representing a line in the file within the specified range.</returns> public string[] GetTextLines(FileRange fileRange) { return(this.scriptFile.GetLinesInRange(fileRange.ToBufferRange())); }
/// <summary> /// Gets the file content in the specified range as an array of strings. /// </summary> /// <param name="bufferRange">The buffer range for which content will be extracted.</param> /// <returns>An array of strings, each representing a line in the file within the specified range.</returns> public string[] GetTextLines(FileRange fileRange) => scriptFile.GetLinesInRange(fileRange.ToBufferRange());