Add benchmark results and tests for StandaloneLspManager path normalization

- Created a new JSON file with benchmark results from the run on 2026-02-09.
- Added tests for the StandaloneLspManager to verify path normalization on Windows, including handling of percent-encoded URIs and ensuring plain Windows paths remain unchanged.
This commit is contained in:
catlog22
2026-02-09 13:02:37 +08:00
parent 964292ebdb
commit c3fd0624de
12 changed files with 4747 additions and 1407 deletions

View File

@@ -0,0 +1,48 @@
"""Tests for StandaloneLspManager path normalization (Windows URI handling)."""
from __future__ import annotations
import platform
from codexlens.lsp.standalone_manager import StandaloneLspManager
def test_normalize_file_uri_percent_encoded_windows_drive() -> None:
if platform.system() != "Windows":
return
manager = StandaloneLspManager(workspace_root="D:/Claude_dms3/codex-lens")
raw = "file:///d%3A/Claude_dms3/codex-lens/src/codexlens/lsp/standalone_manager.py"
normalized = manager._normalize_file_path(raw)
assert normalized.lower().startswith("d:/")
assert "%3a" not in normalized.lower()
assert "d%3a" not in normalized.lower()
assert "/d%3a" not in normalized.lower()
def test_normalize_uri_path_percent_encoded_windows_drive() -> None:
if platform.system() != "Windows":
return
manager = StandaloneLspManager(workspace_root="D:/Claude_dms3/codex-lens")
raw = "/d%3A/Claude_dms3/codex-lens/src/codexlens/lsp/standalone_manager.py"
normalized = manager._normalize_file_path(raw)
assert normalized.lower().startswith("d:/")
assert "%3a" not in normalized.lower()
def test_normalize_plain_windows_path_is_unchanged() -> None:
if platform.system() != "Windows":
return
manager = StandaloneLspManager(workspace_root="D:/Claude_dms3/codex-lens")
raw = r"D:\Claude_dms3\codex-lens\src\codexlens\lsp\standalone_manager.py"
normalized = manager._normalize_file_path(raw)
assert normalized == raw