Add tests and documentation for CodexLens LSP tool

- Introduced a new test script for the CodexLens LSP tool to validate core functionalities including symbol search, find definition, find references, and get hover.
- Created comprehensive documentation for the MCP endpoint design, detailing the architecture, features, and integration with the CCW MCP Manager.
- Developed a detailed implementation plan for transitioning to a real LSP server, outlining phases, architecture, and acceptance criteria.
This commit is contained in:
catlog22
2026-01-19 23:26:35 +08:00
parent eeaefa7208
commit 3fe630f221
24 changed files with 3044 additions and 509 deletions

View File

@@ -51,7 +51,7 @@ def find_definition(
# Get project info from registry
registry = RegistryStore()
project_info = registry.get_project_by_source(str(project_path))
project_info = registry.get_project(project_path)
if project_info is None:
raise IndexNotFoundError(f"Project not indexed: {project_path}")

View File

@@ -71,7 +71,7 @@ def file_context(
# Get project info from registry
registry = RegistryStore()
project_info = registry.get_project_by_source(str(project_path))
project_info = registry.get_project(project_path)
if project_info is None:
raise IndexNotFoundError(f"Project not indexed: {project_path}")

View File

@@ -43,7 +43,7 @@ def get_hover(
# Get project info from registry
registry = RegistryStore()
project_info = registry.get_project_by_source(str(project_path))
project_info = registry.get_project(project_path)
if project_info is None:
raise IndexNotFoundError(f"Project not indexed: {project_path}")

View File

@@ -139,8 +139,8 @@ def find_references(
# Initialize infrastructure
config = Config()
registry = RegistryStore(config.registry_db_path)
mapper = PathMapper(config.index_root)
registry = RegistryStore()
mapper = PathMapper(config.index_dir)
# Create chain search engine
engine = ChainSearchEngine(registry, mapper, config=config)

View File

@@ -51,7 +51,7 @@ def workspace_symbols(
# Get project info from registry
registry = RegistryStore()
project_info = registry.get_project_by_source(str(project_path))
project_info = registry.get_project(project_path)
if project_info is None:
raise IndexNotFoundError(f"Project not indexed: {project_path}")

View File

@@ -53,3 +53,7 @@ class StorageError(CodexLensError):
class SearchError(CodexLensError):
"""Raised when a search operation fails."""
class IndexNotFoundError(CodexLensError):
"""Raised when a project's index cannot be found."""