UAT: LspClient missing protocol methods for 7 LSP capabilities — REFERENCES, RENAME, CODE_ACTIONS, FORMATTING, SIGNATURE_HELP, DOCUMENT_SYMBOLS, WORKSPACE_SYMBOLS #2573

Open
opened 2026-04-03 18:57:09 +00:00 by freemo · 0 comments
Owner

Bug Report

Feature Area

Standards Alignment — LSP (Language Server Protocol) Integration

What Was Tested

Code-level analysis of src/cleveragents/lsp/client.py and src/cleveragents/lsp/runtime.py against the LspCapability enum in src/cleveragents/lsp/models.py.

Expected Behavior (from spec)

The specification (§LSP Integration) states that LSP capabilities exposed to actors include:

diagnostics, type information, symbol navigation, completions, references, rename, code actions, and more — are exposed as tools (via LSPToolAdapter)

The LspCapability enum defines 11 capabilities:

class LspCapability(StrEnum):
    DIAGNOSTICS = "diagnostics"
    HOVER = "hover"
    COMPLETIONS = "completions"
    DEFINITIONS = "definitions"
    REFERENCES = "references"
    RENAME = "rename"
    CODE_ACTIONS = "code_actions"
    FORMATTING = "formatting"
    SIGNATURE_HELP = "signature_help"
    DOCUMENT_SYMBOLS = "document_symbols"
    WORKSPACE_SYMBOLS = "workspace_symbols"

All 11 capabilities should be callable through LspClient and LspRuntime.

Actual Behavior (from code)

LspClient (src/cleveragents/lsp/client.py) only implements 4 of the 11 capabilities:

  • get_diagnostics()
  • get_completions()
  • get_hover()
  • get_definitions()

Missing from LspClient (7 capabilities):

  • get_references()textDocument/references
  • rename()textDocument/rename
  • get_code_actions()textDocument/codeAction
  • format_document()textDocument/formatting
  • get_signature_help()textDocument/signatureHelp
  • get_document_symbols()textDocument/documentSymbol
  • get_workspace_symbols()workspace/symbol

LspRuntime (src/cleveragents/lsp/runtime.py) also only implements 4 methods corresponding to the 4 implemented capabilities.

The LspToolAdapter (src/cleveragents/lsp/tool_adapter.py) generates tool specs for all 11 capabilities, but the _make_runtime_handler() function raises LspNotAvailableError for all capabilities except DIAGNOSTICS, COMPLETIONS, HOVER, and DEFINITIONS:

def _handler(**kwargs: Any) -> Any:
    ...
    if capability == LspCapability.DIAGNOSTICS:
        items = runtime.get_diagnostics(server_name, file_path)
        return {"diagnostics": items}
    if capability == LspCapability.COMPLETIONS:
        ...
    if capability == LspCapability.HOVER:
        ...
    if capability == LspCapability.DEFINITIONS:
        ...
    # Capabilities not yet implemented raise an explicit error
    raise LspNotAvailableError(
        f"LSP capability '{capability.value}' is not yet implemented "
        f"for server '{server_name}'",
    )

Impact

  • 7 of 11 LSP capabilities are non-functional even when a runtime is wired.
  • Actors cannot use references, rename, code actions, formatting, signature help, or symbol navigation — core code intelligence features.
  • Tool specs are generated but always fail: The LspToolAdapter creates tool entries for all 11 capabilities, but 7 of them always raise LspNotAvailableError at runtime, even in server mode with a real LSP server.

Code Location

  • src/cleveragents/lsp/client.py — missing 7 protocol methods
  • src/cleveragents/lsp/runtime.py — missing 7 runtime methods
  • src/cleveragents/lsp/tool_adapter.py_make_runtime_handler() raises for 7 capabilities

Fix Required

Implement the missing 7 LSP protocol methods in LspClient:

  1. get_references(uri, line, character)textDocument/references
  2. rename(uri, line, character, new_name)textDocument/rename
  3. get_code_actions(uri, start_line, start_char, end_line, end_char)textDocument/codeAction
  4. format_document(uri)textDocument/formatting
  5. get_signature_help(uri, line, character)textDocument/signatureHelp
  6. get_document_symbols(uri)textDocument/documentSymbol
  7. get_workspace_symbols(query)workspace/symbol

Then add corresponding methods to LspRuntime and wire them in LspToolAdapter._make_runtime_handler().


Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-uat-tester

## Bug Report ### Feature Area Standards Alignment — LSP (Language Server Protocol) Integration ### What Was Tested Code-level analysis of `src/cleveragents/lsp/client.py` and `src/cleveragents/lsp/runtime.py` against the `LspCapability` enum in `src/cleveragents/lsp/models.py`. ### Expected Behavior (from spec) The specification (§LSP Integration) states that LSP capabilities exposed to actors include: > diagnostics, type information, symbol navigation, completions, references, rename, code actions, and more — are exposed as tools (via `LSPToolAdapter`) The `LspCapability` enum defines 11 capabilities: ```python class LspCapability(StrEnum): DIAGNOSTICS = "diagnostics" HOVER = "hover" COMPLETIONS = "completions" DEFINITIONS = "definitions" REFERENCES = "references" RENAME = "rename" CODE_ACTIONS = "code_actions" FORMATTING = "formatting" SIGNATURE_HELP = "signature_help" DOCUMENT_SYMBOLS = "document_symbols" WORKSPACE_SYMBOLS = "workspace_symbols" ``` All 11 capabilities should be callable through `LspClient` and `LspRuntime`. ### Actual Behavior (from code) `LspClient` (`src/cleveragents/lsp/client.py`) only implements **4** of the 11 capabilities: - `get_diagnostics()` ✓ - `get_completions()` ✓ - `get_hover()` ✓ - `get_definitions()` ✓ **Missing from `LspClient`** (7 capabilities): - `get_references()` — `textDocument/references` - `rename()` — `textDocument/rename` - `get_code_actions()` — `textDocument/codeAction` - `format_document()` — `textDocument/formatting` - `get_signature_help()` — `textDocument/signatureHelp` - `get_document_symbols()` — `textDocument/documentSymbol` - `get_workspace_symbols()` — `workspace/symbol` `LspRuntime` (`src/cleveragents/lsp/runtime.py`) also only implements 4 methods corresponding to the 4 implemented capabilities. The `LspToolAdapter` (`src/cleveragents/lsp/tool_adapter.py`) generates tool specs for all 11 capabilities, but the `_make_runtime_handler()` function raises `LspNotAvailableError` for all capabilities except `DIAGNOSTICS`, `COMPLETIONS`, `HOVER`, and `DEFINITIONS`: ```python def _handler(**kwargs: Any) -> Any: ... if capability == LspCapability.DIAGNOSTICS: items = runtime.get_diagnostics(server_name, file_path) return {"diagnostics": items} if capability == LspCapability.COMPLETIONS: ... if capability == LspCapability.HOVER: ... if capability == LspCapability.DEFINITIONS: ... # Capabilities not yet implemented raise an explicit error raise LspNotAvailableError( f"LSP capability '{capability.value}' is not yet implemented " f"for server '{server_name}'", ) ``` ### Impact - **7 of 11 LSP capabilities are non-functional** even when a runtime is wired. - **Actors cannot use references, rename, code actions, formatting, signature help, or symbol navigation** — core code intelligence features. - **Tool specs are generated but always fail**: The `LspToolAdapter` creates tool entries for all 11 capabilities, but 7 of them always raise `LspNotAvailableError` at runtime, even in server mode with a real LSP server. ### Code Location - `src/cleveragents/lsp/client.py` — missing 7 protocol methods - `src/cleveragents/lsp/runtime.py` — missing 7 runtime methods - `src/cleveragents/lsp/tool_adapter.py` — `_make_runtime_handler()` raises for 7 capabilities ### Fix Required Implement the missing 7 LSP protocol methods in `LspClient`: 1. `get_references(uri, line, character)` → `textDocument/references` 2. `rename(uri, line, character, new_name)` → `textDocument/rename` 3. `get_code_actions(uri, start_line, start_char, end_line, end_char)` → `textDocument/codeAction` 4. `format_document(uri)` → `textDocument/formatting` 5. `get_signature_help(uri, line, character)` → `textDocument/signatureHelp` 6. `get_document_symbols(uri)` → `textDocument/documentSymbol` 7. `get_workspace_symbols(query)` → `workspace/symbol` Then add corresponding methods to `LspRuntime` and wire them in `LspToolAdapter._make_runtime_handler()`. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
freemo added this to the v3.6.0 milestone 2026-04-05 04:53:38 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#2573
No description provided.