feat(lsp): add missing LspCapability enum values
CI / build (pull_request) Successful in 18s
CI / security (pull_request) Successful in 58s
CI / lint (pull_request) Successful in 3m19s
CI / typecheck (pull_request) Successful in 3m54s
CI / quality (pull_request) Successful in 3m55s
CI / integration_tests (pull_request) Successful in 6m49s
CI / unit_tests (pull_request) Successful in 7m3s
CI / docker (pull_request) Successful in 1m6s
CI / e2e_tests (pull_request) Successful in 11m45s
CI / benchmark-publish (pull_request) Has been skipped
CI / coverage (pull_request) Successful in 12m52s
CI / status-check (pull_request) Successful in 2s
CI / benchmark-regression (pull_request) Successful in 58m46s

Align LspCapability enum with the spec's 11-capability set
(docs/specification.md lines 20705-20717):

Renamed: TYPE_INFO -> HOVER, SYMBOLS -> DOCUMENT_SYMBOLS,
         FORMAT -> FORMATTING
Added:   DEFINITIONS, SIGNATURE_HELP, WORKSPACE_SYMBOLS

Updated LspToolAdapter._CAPABILITY_TOOL_MAP (11 entries):
- code_actions suffix -> code-actions (hyphen per spec)
- RENAME gets dedicated schema with new_name parameter
- workspace_symbols gets query-based schema

Updated _input_schema_for() with 4 schema categories extracted
to module-level constants: file-only, position-based, rename
(with new_name), and query-based. Added defensive ValueError for
unmapped capabilities. Added additionalProperties: false.

Extended LspClient.initialize() to advertise all 11 capabilities
in the initialize request (hover, definition, references, rename,
codeAction, formatting, signatureHelp, documentSymbol, workspace
symbol).

Fixed _make_runtime_handler() to handle workspace_symbols as
query-only input (no file_path required), resolving the
schema/handler contract mismatch.

Fixed stale references: type_info -> hover, symbols ->
document_symbols in test fixtures, feature files, CLI docstring.

Updated docs/reference/lsp.md and CHANGELOG.md.

Behave tests (38 scenarios): enum completeness, tool spec generation
with structural validation, input schema per category, all 11
stubbed provider keys, negative tests for invalid capability and
defensive ValueError branch.

ISSUES CLOSED: #834
This commit is contained in:
2026-03-19 03:59:44 +00:00
parent 83f671f9ec
commit 6a8f724299
10 changed files with 474 additions and 46 deletions
+15 -11
View File
@@ -20,16 +20,19 @@ The registry is available for configuration and validation purposes even in loca
Enum of LSP features that can be exposed as tools:
| Value | Description |
|----------------|------------------------------------------|
| `DIAGNOSTICS` | Retrieve diagnostics (errors/warnings) |
| `TYPE_INFO` | Get type information at a cursor position|
| `SYMBOLS` | List document and workspace symbols |
| `COMPLETIONS` | Get code completion suggestions |
| `REFERENCES` | Find all references to a symbol |
| `RENAME` | Rename a symbol across the workspace |
| `CODE_ACTIONS` | Retrieve available code actions |
| `FORMAT` | Format a document or selection |
| Value | Description |
|--------------------|------------------------------------------------|
| `DIAGNOSTICS` | Retrieve diagnostics (errors/warnings) |
| `HOVER` | Get type information and documentation |
| `COMPLETIONS` | Get code completion suggestions |
| `DEFINITIONS` | Go to the definition of a symbol |
| `REFERENCES` | Find all references to a symbol |
| `RENAME` | Rename a symbol across the workspace |
| `CODE_ACTIONS` | Retrieve available code actions for a range |
| `FORMATTING` | Format a document or selection |
| `SIGNATURE_HELP` | Get function signature information at a call |
| `DOCUMENT_SYMBOLS` | List all symbols in a file |
| `WORKSPACE_SYMBOLS`| Search for symbols across the workspace |
### LspServerConfig
@@ -101,7 +104,8 @@ languages: ["python"]
capabilities:
- diagnostics
- completions
- type_info
- hover
- definitions
- references
- rename
env: