mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-13 18:16:10 +00:00
Improve documentation of line ending handling
This commit is contained in:
1 parent
063f872a01
commit
f3754c922d
2 files changed
+9
-1
No files matched your search
+2
-1
@@ -37,7 +37,8 @@ Status of the `main` branch. Changes prior to the next official version change w
|
||||
- During project creation, language composition percentages are now computed relative to the total number
|
||||
of recognised source files instead of all files, i.e. unrecognised files are ignored in the percentage
|
||||
computation.
|
||||
- Fix: Use LSP-compliant line splitting ("\n", "\r\n" and "\r" can define line breaks); previously only "\n" considered
|
||||
- Consider all LSP-compliant line endings ("\n", "\r\n" and "\r") in `TextUtils`, noting that
|
||||
only "\n" appears in files read by `FileUtils.read_file` (Serena's default reading mechanism)
|
||||
- Fix: Apply consistent line splitting across tools, uniformly applying the LSP splitting semantics;
|
||||
affects `search_text` used by `search_for_pattern` tool (reported in #1684)
|
||||
- Fix in `TextUtils` (used by editors): Deleting up to the end of the file, referencing the line one past
|
||||
|
||||
@@ -32,6 +32,13 @@ class InvalidTextLocationError(Exception):
|
||||
|
||||
|
||||
class TextStepper:
|
||||
r"""
|
||||
A utility class for stepping through a text string line by line, keeping track of the current line and column numbers.
|
||||
|
||||
It handles the newline sequences "\n", "\r\n", and "\r" as defined by the Language Server Protocol (LSP).
|
||||
However, note that files read through `FileUtils.read_file` will contain only "\n" (LF).
|
||||
"""
|
||||
|
||||
def __init__(self, chars: str):
|
||||
self._chars = chars
|
||||
self._len = len(chars)
|
||||
|
||||
Reference in new issue
Block a user