Files
cleveragents-core/features/lsp_capability_enum.feature

123 lines
5.1 KiB
Gherkin

@lsp @capability
Feature: LspCapability Enum Completeness
As a developer integrating LSP servers
I want the LspCapability enum to include all spec-defined capabilities
So that the tool adapter generates correct tool specs
# Enum completeness
Scenario: LspCapability enum has exactly 11 members
Given the LspCapability enum for lsp_cap
Then the lsp_cap enum should have 11 members
Scenario Outline: LspCapability enum includes <member>
Given the LspCapability enum for lsp_cap
Then the lsp_cap enum should include "<member>"
Examples:
| member |
| diagnostics |
| hover |
| completions |
| definitions |
| references |
| rename |
| code_actions |
| formatting |
| signature_help |
| document_symbols |
| workspace_symbols |
# ── Tool adapter generates specs for all capabilities ──────
Scenario: Tool adapter has mappings for all 11 capabilities
Given the lsp_cap capability tool map
Then the lsp_cap tool map should have 11 entries
Scenario Outline: Tool adapter generates tool spec for <capability>
Given an LspServerConfig with capability "<capability>" for lsp_cap
When I generate tool specs for lsp_cap
Then the lsp_cap generated specs should not be empty
And the lsp_cap tool spec should have keys "name" and "input_schema"
And the lsp_cap tool name should end with "<tool_suffix>"
Examples:
| capability | tool_suffix |
| diagnostics | diagnostics |
| hover | hover |
| completions | completions |
| definitions | definition |
| references | references |
| rename | rename |
| code_actions | code-actions |
| formatting | format |
| signature_help | signature |
| document_symbols | symbols |
| workspace_symbols | workspace-symbols |
# ── Input schemas per category ─────────────────────────────
Scenario Outline: File-only capability <cap> has file_path schema
Given the lsp_cap input schema for "<cap>"
Then the lsp_cap schema should require "file_path"
And the lsp_cap schema should not require "line"
Examples:
| cap |
| diagnostics |
| formatting |
| document_symbols |
Scenario Outline: Position capability <cap> has file+line+column schema
Given the lsp_cap input schema for "<cap>"
Then the lsp_cap schema should require "file_path"
And the lsp_cap schema should require "line"
And the lsp_cap schema should require "column"
Examples:
| cap |
| hover |
| completions |
| definitions |
| references |
| code_actions |
| signature_help |
Scenario: Rename capability has file+line+column+new_name schema
Given the lsp_cap input schema for "rename"
Then the lsp_cap schema should require "file_path"
And the lsp_cap schema should require "line"
And the lsp_cap schema should require "column"
And the lsp_cap schema should require "new_name"
Scenario: Workspace symbols has query schema
Given the lsp_cap input schema for "workspace_symbols"
Then the lsp_cap schema should require "query"
And the lsp_cap schema should not require "file_path"
# ── Stubbed server capabilities include all keys ───────────
Scenario: Stubbed server capabilities include all LSP providers
Given the lsp_cap stubbed server capabilities
Then the lsp_cap stubbed caps should include "hoverProvider"
And the lsp_cap stubbed caps should include "definitionProvider"
And the lsp_cap stubbed caps should include "signatureHelpProvider"
And the lsp_cap stubbed caps should include "documentSymbolProvider"
And the lsp_cap stubbed caps should include "workspaceSymbolProvider"
And the lsp_cap stubbed caps should include "completionProvider"
And the lsp_cap stubbed caps should include "referencesProvider"
And the lsp_cap stubbed caps should include "renameProvider"
And the lsp_cap stubbed caps should include "codeActionProvider"
And the lsp_cap stubbed caps should include "documentFormattingProvider"
And the lsp_cap stubbed caps should include "diagnosticProvider"
# ── Negative tests ─────────────────────────────────────────
Scenario: Invalid capability value raises ValueError
When I create an LspCapability with value "nonexistent" for lsp_cap
Then the lsp_cap creation should raise a ValueError
Scenario: _input_schema_for raises ValueError for unknown capability
When I call _input_schema_for with a fake capability for lsp_cap
Then the lsp_cap schema call should raise a ValueError