Add tests and implement functionality for staged cascade search and LSP expansion

- Introduced a new JSON file for verbose output of the Codex Lens search results.
- Added unit tests for binary search functionality in `test_stage1_binary_search_uses_chunk_lines.py`.
- Implemented regression tests for staged cascade Stage 2 expansion depth in `test_staged_cascade_lsp_depth.py`.
- Created unit tests for staged cascade Stage 2 realtime LSP graph expansion in `test_staged_cascade_realtime_lsp.py`.
- Enhanced the ChainSearchEngine to respect configuration settings for staged LSP depth and improve search accuracy.
This commit is contained in:
catlog22
2026-02-08 21:54:42 +08:00
parent 166211dcd4
commit b9b2932f50
20 changed files with 1882 additions and 283 deletions

View File

@@ -760,6 +760,24 @@ class TestLocationParsing:
assert loc.line == 1
assert loc.character == 1
def test_location_from_file_uri_windows_percent_encoded_drive(self):
"""Parse Location from percent-encoded Windows drive URIs (pyright-style)."""
from codexlens.lsp.lsp_bridge import Location
data = {
"uri": "file:///d%3A/Claude_dms3/codex-lens/src/codexlens/api/semantic.py",
"range": {
"start": {"line": 18, "character": 3},
"end": {"line": 18, "character": 10},
},
}
loc = Location.from_lsp_response(data)
assert loc.file_path == "d:/Claude_dms3/codex-lens/src/codexlens/api/semantic.py"
assert loc.line == 19 # 0-based -> 1-based
assert loc.character == 4
def test_location_from_direct_fields(self):
"""Parse Location from direct field format."""
from codexlens.lsp.lsp_bridge import Location