robotcode-core 1.4.0__tar.gz → 1.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/PKG-INFO +1 -1
- robotcode_core-1.5.0/src/robotcode/core/__version__.py +1 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/text_document.py +64 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/utils/logging.py +3 -4
- robotcode_core-1.4.0/src/robotcode/core/__version__.py +0 -1
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/.gitignore +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/LICENSE.txt +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/README.md +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/pyproject.toml +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/__init__.py +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/async_tools.py +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/concurrent.py +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/documents_manager.py +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/event.py +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/filewatcher.py +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/ignore_spec.py +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/language.py +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/lsp/__init__.py +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/lsp/types.py +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/py.typed +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/types.py +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/uri.py +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/utils/__init__.py +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/utils/caching.py +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/utils/cli.py +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/utils/dataclasses.py +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/utils/debugpy.py +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/utils/glob_path.py +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/utils/inspect.py +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/utils/net.py +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/utils/path.py +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/utils/process.py +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/utils/safe_eval.py +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/utils/version.py +0 -0
- {robotcode_core-1.4.0 → robotcode_core-1.5.0}/src/robotcode/core/workspace.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.5.0"
|
|
@@ -216,6 +216,70 @@ class TextDocument:
|
|
|
216
216
|
|
|
217
217
|
return self._lines
|
|
218
218
|
|
|
219
|
+
def get_text(self, r: Range) -> str:
|
|
220
|
+
lines = self.get_lines()
|
|
221
|
+
|
|
222
|
+
start_pos = r.start
|
|
223
|
+
end_pos = r.end
|
|
224
|
+
|
|
225
|
+
# Validate range
|
|
226
|
+
if start_pos.line < 0 or start_pos.character < 0:
|
|
227
|
+
raise InvalidRangeError(f"Invalid start position: {start_pos}")
|
|
228
|
+
if end_pos.line < 0 or end_pos.character < 0:
|
|
229
|
+
raise InvalidRangeError(f"Invalid end position: {end_pos}")
|
|
230
|
+
if start_pos > end_pos:
|
|
231
|
+
raise InvalidRangeError(f"Start position is greater than end position: {r}")
|
|
232
|
+
|
|
233
|
+
# Handle case where range is beyond document
|
|
234
|
+
if start_pos.line >= len(lines):
|
|
235
|
+
return ""
|
|
236
|
+
|
|
237
|
+
# Single line case
|
|
238
|
+
if start_pos.line == end_pos.line:
|
|
239
|
+
if start_pos.line < len(lines):
|
|
240
|
+
line = lines[start_pos.line]
|
|
241
|
+
# Handle newline character at end of line
|
|
242
|
+
if line.endswith(("\n", "\r\n")):
|
|
243
|
+
line_content = line.rstrip("\r\n")
|
|
244
|
+
if end_pos.character > len(line_content):
|
|
245
|
+
# Include the newline character(s)
|
|
246
|
+
return line[start_pos.character :]
|
|
247
|
+
|
|
248
|
+
return line_content[start_pos.character : end_pos.character]
|
|
249
|
+
|
|
250
|
+
return line[start_pos.character : end_pos.character]
|
|
251
|
+
return ""
|
|
252
|
+
|
|
253
|
+
# Multi-line case
|
|
254
|
+
result_lines = []
|
|
255
|
+
|
|
256
|
+
# First line
|
|
257
|
+
if start_pos.line < len(lines):
|
|
258
|
+
first_line = lines[start_pos.line]
|
|
259
|
+
if first_line.endswith(("\n", "\r\n")):
|
|
260
|
+
result_lines.append(first_line[start_pos.character :])
|
|
261
|
+
else:
|
|
262
|
+
result_lines.append(first_line[start_pos.character :] + "\n")
|
|
263
|
+
|
|
264
|
+
# Middle lines
|
|
265
|
+
for line_idx in range(start_pos.line + 1, min(end_pos.line, len(lines))):
|
|
266
|
+
result_lines.append(lines[line_idx])
|
|
267
|
+
|
|
268
|
+
# Last line
|
|
269
|
+
if end_pos.line < len(lines):
|
|
270
|
+
last_line = lines[end_pos.line]
|
|
271
|
+
if last_line.endswith(("\n", "\r\n")):
|
|
272
|
+
line_content = last_line.rstrip("\r\n")
|
|
273
|
+
if end_pos.character > len(line_content):
|
|
274
|
+
# Include the newline character(s)
|
|
275
|
+
result_lines.append(last_line)
|
|
276
|
+
else:
|
|
277
|
+
result_lines.append(line_content[: end_pos.character])
|
|
278
|
+
else:
|
|
279
|
+
result_lines.append(last_line[: end_pos.character])
|
|
280
|
+
|
|
281
|
+
return "".join(result_lines)
|
|
282
|
+
|
|
219
283
|
@event
|
|
220
284
|
def cache_invalidate(sender) -> None: ...
|
|
221
285
|
|
|
@@ -203,10 +203,9 @@ class LoggingDescriptor:
|
|
|
203
203
|
if context_name is not None:
|
|
204
204
|
depth = self._measure_contexts.get(context_name, 0)
|
|
205
205
|
|
|
206
|
-
if
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
extra["indent"] = " " * depth
|
|
206
|
+
extra = {**extra} if extra is not None else {}
|
|
207
|
+
if "indent" not in extra:
|
|
208
|
+
extra["indent"] = (" " * depth) if depth > 0 else ""
|
|
210
209
|
|
|
211
210
|
self.logger.log(
|
|
212
211
|
level,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.4.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|