From f47eb12a905b512a55eeae4328da2e668b33a8ba Mon Sep 17 00:00:00 2001 From: Error Date: Sat, 8 Nov 2025 12:27:47 -0600 Subject: [PATCH] added specs for lsp smbolic tools --- specs/epic-lsp-symbolic-tools.md | 176 ++++++++++++++++++ specs/task-lsp-api-enable-find-symbol.md | 20 ++ specs/task-lsp-cli-tui-mapping-proposal.md | 21 +++ specs/task-lsp-docs-tools-and-examples.md | 21 +++ specs/task-lsp-edit-application-order.md | 19 ++ specs/task-lsp-edit-code-action-flow.md | 20 ++ specs/task-lsp-edit-conflict-detection.md | 20 ++ specs/task-lsp-edit-convert-workspaceedit.md | 20 ++ specs/task-lsp-edit-dry-run-preview.md | 19 ++ specs/task-lsp-edit-rename-flow.md | 20 ++ specs/task-lsp-edit-transactional-apply.md | 19 ++ specs/task-lsp-edit-writability-validation.md | 19 ++ specs/task-lsp-fallback-unsupported.md | 20 ++ specs/task-lsp-foundation-inventory.md | 21 +++ specs/task-lsp-foundation-mvp-capabilities.md | 21 +++ specs/task-lsp-helper-codeAction.md | 20 ++ ...-lsp-helper-definition-type-declaration.md | 21 +++ ...ask-lsp-helper-documentSymbol-normalize.md | 20 ++ ...sp-helper-errors-timeouts-normalization.md | 21 +++ specs/task-lsp-helper-references.md | 21 +++ .../task-lsp-helper-rename-prepare-rename.md | 21 +++ specs/task-lsp-inttest-code-action-edits.md | 18 ++ specs/task-lsp-inttest-find-references.md | 18 ++ specs/task-lsp-inttest-go-to-definition.md | 18 ++ specs/task-lsp-inttest-rename-multifile.md | 19 ++ specs/task-lsp-logging-observability.md | 20 ++ specs/task-lsp-nav-jump-to-definition.md | 19 ++ specs/task-lsp-nav-references-listing.md | 19 ++ .../task-lsp-performance-timeouts-batching.md | 22 +++ specs/task-lsp-routing-multi-server-policy.md | 21 +++ ...ests-mock-navigation-references-symbols.md | 20 ++ specs/task-lsp-tests-tool-schemas.md | 18 ++ ...task-lsp-tests-workspaceedit-conversion.md | 18 ++ specs/task-lsp-tool-code-action.md | 19 ++ specs/task-lsp-tool-definition.md | 20 ++ .../task-lsp-tool-document-symbol-listing.md | 19 ++ specs/task-lsp-tool-references.md | 20 ++ specs/task-lsp-tool-rename.md | 20 ++ specs/task-lsp-tool-symbols.md | 22 +++ specs/task-lsp-tools-register.md | 19 ++ specs/task-lsp-tools-spec-ids-schemas.md | 20 ++ 41 files changed, 969 insertions(+) create mode 100644 specs/epic-lsp-symbolic-tools.md create mode 100644 specs/task-lsp-api-enable-find-symbol.md create mode 100644 specs/task-lsp-cli-tui-mapping-proposal.md create mode 100644 specs/task-lsp-docs-tools-and-examples.md create mode 100644 specs/task-lsp-edit-application-order.md create mode 100644 specs/task-lsp-edit-code-action-flow.md create mode 100644 specs/task-lsp-edit-conflict-detection.md create mode 100644 specs/task-lsp-edit-convert-workspaceedit.md create mode 100644 specs/task-lsp-edit-dry-run-preview.md create mode 100644 specs/task-lsp-edit-rename-flow.md create mode 100644 specs/task-lsp-edit-transactional-apply.md create mode 100644 specs/task-lsp-edit-writability-validation.md create mode 100644 specs/task-lsp-fallback-unsupported.md create mode 100644 specs/task-lsp-foundation-inventory.md create mode 100644 specs/task-lsp-foundation-mvp-capabilities.md create mode 100644 specs/task-lsp-helper-codeAction.md create mode 100644 specs/task-lsp-helper-definition-type-declaration.md create mode 100644 specs/task-lsp-helper-documentSymbol-normalize.md create mode 100644 specs/task-lsp-helper-errors-timeouts-normalization.md create mode 100644 specs/task-lsp-helper-references.md create mode 100644 specs/task-lsp-helper-rename-prepare-rename.md create mode 100644 specs/task-lsp-inttest-code-action-edits.md create mode 100644 specs/task-lsp-inttest-find-references.md create mode 100644 specs/task-lsp-inttest-go-to-definition.md create mode 100644 specs/task-lsp-inttest-rename-multifile.md create mode 100644 specs/task-lsp-logging-observability.md create mode 100644 specs/task-lsp-nav-jump-to-definition.md create mode 100644 specs/task-lsp-nav-references-listing.md create mode 100644 specs/task-lsp-performance-timeouts-batching.md create mode 100644 specs/task-lsp-routing-multi-server-policy.md create mode 100644 specs/task-lsp-tests-mock-navigation-references-symbols.md create mode 100644 specs/task-lsp-tests-tool-schemas.md create mode 100644 specs/task-lsp-tests-workspaceedit-conversion.md create mode 100644 specs/task-lsp-tool-code-action.md create mode 100644 specs/task-lsp-tool-definition.md create mode 100644 specs/task-lsp-tool-document-symbol-listing.md create mode 100644 specs/task-lsp-tool-references.md create mode 100644 specs/task-lsp-tool-rename.md create mode 100644 specs/task-lsp-tool-symbols.md create mode 100644 specs/task-lsp-tools-register.md create mode 100644 specs/task-lsp-tools-spec-ids-schemas.md diff --git a/specs/epic-lsp-symbolic-tools.md b/specs/epic-lsp-symbolic-tools.md new file mode 100644 index 000000000000..ca9d7bb95c7e --- /dev/null +++ b/specs/epic-lsp-symbolic-tools.md @@ -0,0 +1,176 @@ +# Epic: LSP Symbolic Editing, Refactoring, and Search + +Goal + +- Provide LSP-powered symbolic navigation, refactoring, and search tools that the model and TUI/SDK can call reliably across languages. + +Motivation + +- Unlock model-native workflows like jump-to-definition, find-references, rename symbol, code actions, and symbol search. +- Address open requests like workspace symbol search API (#247) and pave the way for definition/references/rename tooling. + +Non‑Goals (initial) + +- Execute command-based code actions (workspace/executeCommand) beyond simple edit actions. +- A full graphical UI. CLI/TUI wiring will target simple commands that call tools/server endpoints. + +References (repo) + +- Client LSP symbols exist: src/lsp/index.ts (workspaceSymbol, documentSymbol) +- Symbol range fallback: src/session/prompt.ts (uses documentSymbol to expand ranges) +- Server symbol API is stubbed: src/server/server.ts (/find/symbol returns []) +- Existing tools: src/tool/lsp-hover.ts, src/tool/lsp-diagnostics.ts + +Definition of Done (MVP) + +- Tools exposed: definition, references, symbols (document/workspace), rename (with prepare), code actions (edit-only). +- /find/symbol returns live results where supported (gracefully returns [] otherwise). +- WorkspaceEdit from rename/code actions is converted and applied atomically via patch/multiedit with a dry‑run preview option. +- Story-pointed tasks below are implemented and tests cover core flows (definition, references, rename multi-file, code action producing edits). + +Sizing Notes + +- Story points are 1, 2, 3, or 5. Any task >5 is split until <=5. + +Task Index + +Phase 1: Foundations and Capabilities + +- [SP:2] Inventory current LSP capabilities and gaps — specs/task-lsp-foundation-inventory.md +- [SP:2] Define MVP operations and capability detection — specs/task-lsp-foundation-mvp-capabilities.md +- [SP:3] Add navigation helpers: definition/typeDefinition/declaration — specs/task-lsp-helper-definition-type-declaration.md +- [SP:2] Add references helper — specs/task-lsp-helper-references.md +- [SP:2] Normalize documentSymbol — specs/task-lsp-helper-documentSymbol-normalize.md +- [SP:3] PrepareRename + Rename helpers — specs/task-lsp-helper-rename-prepare-rename.md +- [SP:2] CodeAction helper — specs/task-lsp-helper-codeAction.md +- [SP:2] Shared error/timeout handling and normalization — specs/task-lsp-helper-errors-timeouts-normalization.md + +Phase 2: Tool Abstractions (Server-Side) + +- [SP:2] Specify tool IDs and schemas — specs/task-lsp-tools-spec-ids-schemas.md +- [SP:3] LspDefinitionTool — specs/task-lsp-tool-definition.md +- [SP:3] LspReferencesTool — specs/task-lsp-tool-references.md +- [SP:2] LspSymbolsTool — specs/task-lsp-tool-symbols.md +- [SP:3] LspRenameTool — specs/task-lsp-tool-rename.md +- [SP:3] LspCodeActionTool — specs/task-lsp-tool-code-action.md +- [SP:1] Register tools — specs/task-lsp-tools-register.md + +Phase 3: Edit/Refactor Application Pipeline + +- [SP:3] Convert WorkspaceEdit/TextEdit to patches — specs/task-lsp-edit-convert-workspaceedit.md +- [SP:2] Apply order per file — specs/task-lsp-edit-application-order.md +- [SP:1] Writability/sandbox validation — specs/task-lsp-edit-writability-validation.md +- [SP:3] Rename flow: preview + apply (atomic) — specs/task-lsp-edit-rename-flow.md +- [SP:3] Code action flow: preview + apply — specs/task-lsp-edit-code-action-flow.md +- [SP:2] Conflict detection — specs/task-lsp-edit-conflict-detection.md +- [SP:2] Dry‑run preview format — specs/task-lsp-edit-dry-run-preview.md +- [SP:2] Transactional apply wrapper — specs/task-lsp-edit-transactional-apply.md + +Phase 4: Search and Navigation UX + +- [SP:2] Re-enable /find/symbol API — specs/task-lsp-api-enable-find-symbol.md +- [SP:2] Document symbol listing tool — specs/task-lsp-tool-document-symbol-listing.md +- [SP:2] Jump-to-definition prioritization — specs/task-lsp-nav-jump-to-definition.md +- [SP:3] References listing (pagination-ready) — specs/task-lsp-nav-references-listing.md +- [SP:2] CLI/TUI command mapping proposal — specs/task-lsp-cli-tui-mapping-proposal.md + +Phase 5: Multi-Language and Robustness + +- [SP:3] Multi-server routing policy — specs/task-lsp-routing-multi-server-policy.md +- [SP:2] Graceful fallback when unsupported — specs/task-lsp-fallback-unsupported.md +- [SP:3] Performance (timeouts, batching, large edits) — specs/task-lsp-performance-timeouts-batching.md +- [SP:2] Logging/observability — specs/task-lsp-logging-observability.md + +Phase 6: Validation and Tests + +- [SP:3] Unit tests: navigation/references/symbols — specs/task-lsp-tests-mock-navigation-references-symbols.md +- [SP:3] Unit tests: WorkspaceEdit conversion — specs/task-lsp-tests-workspaceedit-conversion.md +- [SP:2] Unit tests: tool schemas — specs/task-lsp-tests-tool-schemas.md +- [SP:3] Integration: go-to-definition — specs/task-lsp-inttest-go-to-definition.md +- [SP:3] Integration: find-references — specs/task-lsp-inttest-find-references.md +- [SP:3] Integration: rename multi-file — specs/task-lsp-inttest-rename-multifile.md +- [SP:3] Integration: code action edits — specs/task-lsp-inttest-code-action-edits.md +- [SP:2] Documentation: tools and examples — specs/task-lsp-docs-tools-and-examples.md + +Phases and Stories (with Story Points) + +Phase 1: Foundations and Capabilities + +- [SP:2] Inventory current LSP capabilities and gaps (hover/diagnostics present; symbols client OK; server symbol API disabled) +- [SP:2] Define MVP operations and capability detection (definition, references, symbols, rename, code actions) +- LSP client helpers + - [SP:3] Add navigation helpers: textDocument/definition, typeDefinition, declaration (normalized locations) + - [SP:2] Add textDocument/references helper (includeDeclaration flag, dedupe/sort) + - [SP:2] Ensure textDocument/documentSymbol normalization handles both SymbolInformation and DocumentSymbol + - [SP:3] Add textDocument/prepareRename + textDocument/rename helpers (return WorkspaceEdit) + - [SP:2] Add textDocument/codeAction helper (limit to edit-producing actions; collect edits) + - [SP:2] Shared error/timeout handling and result normalization utilities + +Phase 2: Tool Abstractions (Server-Side) + +- [SP:2] Specify tool IDs, inputs/outputs (Zod) for: + - lsp-definition, lsp-references, lsp-symbols (document/workspace), lsp-rename, lsp-code-action +- [SP:3] Implement LspDefinitionTool (single primary target; multiple targets supported as list) +- [SP:3] Implement LspReferencesTool (dedupe/sort; include file, range, snippet if possible) +- [SP:2] Implement LspSymbolsTool (document symbols for a file; workspace symbols by query) +- [SP:3] Implement LspRenameTool (uses prepareRename when available; returns WorkspaceEdit) +- [SP:3] Implement LspCodeActionTool (returns actions that include edits only; no executeCommand) +- [SP:1] Register tools in tool registry and ensure provider/model enablement rules align with conventions + +Phase 3: Edit/Refactor Application Pipeline + +- WorkspaceEdit translation and application + - [SP:3] Convert LSP WorkspaceEdit/TextEdit to internal patch format grouped per file + - [SP:2] Ensure correct application order (reverse range apply per file) + - [SP:1] Validate files are known and writable (respect sandbox/permission model) +- Apply pipeline integration + - [SP:3] Rename flow: preview (dry‑run) + apply; atomic behavior across files + - [SP:3] Code action flow: preview + apply for edit-only actions +- Safety and user experience + - [SP:2] Conflict detection with unsaved or concurrently edited files; fail with guidance + - [SP:2] Dry‑run preview output format (summarize file edits; hunk counts; line ranges) + - [SP:2] Transactional apply wrapper to avoid partial writes on failure + +Phase 4: Search and Navigation UX + +- [SP:2] Re-enable /find/symbol server API (capability gated; fallback to []) +- [SP:2] Document symbol listing tool: returns name, kind, container (if available), location +- [SP:2] Navigation helpers: jump-to-definition tool output prioritization (primary target first; then others) +- [SP:3] References listing output: pagination-ready structure and stable ordering +- [SP:2] CLI/TUI command mapping proposal (/def, /refs, /symbols, /rename, /codeaction) with argument shapes; defer UI wiring to follow-on PR + +Phase 5: Multi-Language and Robustness + +- [SP:3] Multi-server routing policy (choose server by extension/root matching and capability) +- [SP:2] Graceful fallback when method/capability not supported; clear messages +- [SP:3] Performance: add request timeouts; debounce/batch workspace symbol queries; ensure large WorkspaceEdit remains efficient +- [SP:2] Logging/observability around LSP requests and edit application (Log.create) + +Phase 6: Validation and Tests + +- Unit tests + - [SP:3] Mock LSP client methods for navigation/references/symbols + - [SP:3] Test WorkspaceEdit -> patch conversion (multi-hunk, multi-file) + - [SP:2] Tool input/output validation tests (Zod schemas) +- Integration tests + - [SP:3] Go-to-definition happy path with a sample server + - [SP:3] Find-references across files (dedupe/sort) + - [SP:3] Rename that produces multi-file edits (dry‑run + apply) + - [SP:3] Code action producing edits (dry‑run + apply) +- Documentation + - [SP:2] Tool docs with JSON schema examples and example flows + +Cross-Issue Alignment + +- #247 need server api for fuzzy searching workspace symbols (lsp): addressed by enabling /find/symbol and symbol tools. +- Future: add issues to track definition/references/rename/codeAction tools and edit application pipeline if not already present. + +Risks and Mitigations + +- Varying server capability support -> Capability detection + graceful fallbacks. +- Large edit sets -> Dry‑run, per-file ordering, transactional apply. +- Multi-server overlaps -> Clear routing heuristics and server priority rules. + +Notes on Implementation Order + +- Prefer to land Phase 1 + Phase 4 (/find/symbol) first to unblock #247, then Phase 2/3 for editing/refactor. diff --git a/specs/task-lsp-api-enable-find-symbol.md b/specs/task-lsp-api-enable-find-symbol.md new file mode 100644 index 000000000000..ef6f78432ab6 --- /dev/null +++ b/specs/task-lsp-api-enable-find-symbol.md @@ -0,0 +1,20 @@ +# Task: Re-enable /find/symbol Server API + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 2 +Status: pending + +Description + +- Wire server route /find/symbol to LSP.workspaceSymbol with capability gating; fallback to [] when unsupported or no active clients. + +Acceptance Criteria + +- Endpoint returns filtered/limited symbols as defined in epic. +- Integration test covers supported and unsupported cases. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/issues/247 +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-cli-tui-mapping-proposal.md b/specs/task-lsp-cli-tui-mapping-proposal.md new file mode 100644 index 000000000000..53308160d9b2 --- /dev/null +++ b/specs/task-lsp-cli-tui-mapping-proposal.md @@ -0,0 +1,21 @@ +# Task: CLI/TUI Command Mapping Proposal + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 2 +Status: pending + +Description + +- Propose UX for commands: /def, /refs, /symbols, /rename, /codeaction. Specify argument shapes and how they map to tool/server APIs. + +Acceptance Criteria + +- Document with examples for each command. +- Reviewed against existing completion UX (symbols in @ menu). + +Relevant Issues/PRs + +- https://github.com/sst/opencode/issues/711 +- https://github.com/sst/opencode/issues/247 +- https://github.com/sst/opencode/pull/36 diff --git a/specs/task-lsp-docs-tools-and-examples.md b/specs/task-lsp-docs-tools-and-examples.md new file mode 100644 index 000000000000..c75a176b6b59 --- /dev/null +++ b/specs/task-lsp-docs-tools-and-examples.md @@ -0,0 +1,21 @@ +# Task: Documentation – Tools and Examples + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 2 +Status: pending + +Description + +- Document each tool (IDs, schemas) and provide example flows for definition, references, rename with dry-run/apply, and code actions. + +Acceptance Criteria + +- New docs linked from AGENTS.md or README as appropriate. +- JSON schema examples included. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/issues/711 +- https://github.com/sst/opencode/issues/247 +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-edit-application-order.md b/specs/task-lsp-edit-application-order.md new file mode 100644 index 000000000000..8b12e398ea58 --- /dev/null +++ b/specs/task-lsp-edit-application-order.md @@ -0,0 +1,19 @@ +# Task: Ensure Correct Application Order Per File + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 2 +Status: pending + +Description + +- Apply per-file edits in reverse-sorted order by range start to avoid offset shifts while applying multiple edits. + +Acceptance Criteria + +- Deterministic order computed and used in apply pipeline. +- Unit tests cover overlapping/adjacent edits. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-edit-code-action-flow.md b/specs/task-lsp-edit-code-action-flow.md new file mode 100644 index 000000000000..6d0731902641 --- /dev/null +++ b/specs/task-lsp-edit-code-action-flow.md @@ -0,0 +1,20 @@ +# Task: Code Action Flow (Preview + Apply) + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 3 +Status: pending + +Description + +- End-to-end support for edit-only code actions: list, preview dry-run, apply edits using the shared pipeline. + +Acceptance Criteria + +- Dry-run output mirrors rename flow formatting. +- Apply uses same ordering/atomic guarantees. +- Integration tests for an edit-producing action. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-edit-conflict-detection.md b/specs/task-lsp-edit-conflict-detection.md new file mode 100644 index 000000000000..8755c8165bd2 --- /dev/null +++ b/specs/task-lsp-edit-conflict-detection.md @@ -0,0 +1,20 @@ +# Task: Conflict Detection with Unsaved/Concurrent Changes + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 2 +Status: pending + +Description + +- Detect when target files diverge since symbol resolution; fail with guidance instead of partially applying conflicting edits. + +Acceptance Criteria + +- Detect staleness via file timestamps or content hash. +- Friendly error instructs to retry after refreshing context. +- Unit tests simulate concurrent modification. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-edit-convert-workspaceedit.md b/specs/task-lsp-edit-convert-workspaceedit.md new file mode 100644 index 000000000000..b6781921ece1 --- /dev/null +++ b/specs/task-lsp-edit-convert-workspaceedit.md @@ -0,0 +1,20 @@ +# Task: Convert WorkspaceEdit/TextEdit to Internal Patch Format + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 3 +Status: pending + +Description + +- Translate LSP WorkspaceEdit/TextEdit into per-file patch structures compatible with existing patch/multiedit tools for atomic application. + +Acceptance Criteria + +- Conversion groups edits per file with correct ranges and text. +- Handles both changes and documentChanges variants. +- Unit tests for single/multi-file cases. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-edit-dry-run-preview.md b/specs/task-lsp-edit-dry-run-preview.md new file mode 100644 index 000000000000..27e7367ecef1 --- /dev/null +++ b/specs/task-lsp-edit-dry-run-preview.md @@ -0,0 +1,19 @@ +# Task: Dry-Run Preview Output Format + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 2 +Status: pending + +Description + +- Define a concise, machine- and human-readable preview of edits: per-file hunk count, line ranges, and summaries without dumping full diffs. + +Acceptance Criteria + +- Consistent format reused by rename and code action flows. +- Covered by unit tests for formatting edge cases. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-edit-rename-flow.md b/specs/task-lsp-edit-rename-flow.md new file mode 100644 index 000000000000..1f2ffdd14312 --- /dev/null +++ b/specs/task-lsp-edit-rename-flow.md @@ -0,0 +1,20 @@ +# Task: Rename Flow (Preview + Apply, Atomic) + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 3 +Status: pending + +Description + +- Implement end-to-end rename: call prepare/rename, present dry-run preview, apply atomically across files. + +Acceptance Criteria + +- Dry-run includes per-file changes summary (counts, ranges). +- Apply is all-or-nothing; rollback on failure. +- Integration tests on sample project. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-edit-transactional-apply.md b/specs/task-lsp-edit-transactional-apply.md new file mode 100644 index 000000000000..4bb07c0613b5 --- /dev/null +++ b/specs/task-lsp-edit-transactional-apply.md @@ -0,0 +1,19 @@ +# Task: Transactional Apply Wrapper + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 2 +Status: pending + +Description + +- Wrap multi-file apply in a transactional sequence: stage changes, write, and rollback if any file fails to apply. + +Acceptance Criteria + +- Rollback implemented and verified in tests. +- Clear user-visible success/failure messages. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-edit-writability-validation.md b/specs/task-lsp-edit-writability-validation.md new file mode 100644 index 000000000000..181cedc6660a --- /dev/null +++ b/specs/task-lsp-edit-writability-validation.md @@ -0,0 +1,19 @@ +# Task: Validate Writability and Sandbox Constraints + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 1 +Status: pending + +Description + +- Before applying edits, ensure target files exist, are within writable roots, and satisfy permission model. + +Acceptance Criteria + +- Apply fails fast with clear message when file not writable. +- Unit tests simulate blocked writes. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-fallback-unsupported.md b/specs/task-lsp-fallback-unsupported.md new file mode 100644 index 000000000000..0276412b29e4 --- /dev/null +++ b/specs/task-lsp-fallback-unsupported.md @@ -0,0 +1,20 @@ +# Task: Graceful Fallback for Unsupported Methods/Capabilities + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 2 +Status: pending + +Description + +- When a server does not support a method (e.g., references, rename), return empty results and clear user messages instead of errors. + +Acceptance Criteria + +- Consistent behavior across all new helpers/tools. +- Unit tests that inject capability gaps. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/issues/4003 +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-foundation-inventory.md b/specs/task-lsp-foundation-inventory.md new file mode 100644 index 000000000000..f66c323974fa --- /dev/null +++ b/specs/task-lsp-foundation-inventory.md @@ -0,0 +1,21 @@ +# Task: Inventory Current LSP Capabilities and Gaps + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 2 +Status: pending + +Description + +- Review existing LSP integration to document supported methods (hover, diagnostics, symbols) and identify missing ones needed for symbolic navigation/refactor/search. + +Acceptance Criteria + +- Document lists current LSP client/server features and gaps in repo. +- Confirms workspace/document symbol support and notes /find/symbol API is disabled. +- Notes absence of definition/references/rename/codeAction helpers/tools. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 (Expose LSP API) +- https://github.com/sst/opencode/issues/438 (more LSP) diff --git a/specs/task-lsp-foundation-mvp-capabilities.md b/specs/task-lsp-foundation-mvp-capabilities.md new file mode 100644 index 000000000000..9d0ac4e98288 --- /dev/null +++ b/specs/task-lsp-foundation-mvp-capabilities.md @@ -0,0 +1,21 @@ +# Task: Define MVP Operations and Capability Detection + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 2 +Status: pending + +Description + +- Specify MVP methods: definition, references, symbols (document/workspace), rename (with prepare), code actions (edit-only). Define how to detect server capability/support and choose servers when multiple are available. + +Acceptance Criteria + +- Written spec for supported operations and capability checks. +- Policy for multi-server selection per file/extension. +- Error messaging guidance when capability missing. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 +- https://github.com/sst/opencode/issues/4003 (optional requests MethodNotFound) diff --git a/specs/task-lsp-helper-codeAction.md b/specs/task-lsp-helper-codeAction.md new file mode 100644 index 000000000000..ac977f195fe7 --- /dev/null +++ b/specs/task-lsp-helper-codeAction.md @@ -0,0 +1,20 @@ +# Task: Add Code Action Helper (textDocument/codeAction) + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 2 +Status: pending + +Description + +- Implement helper for textDocument/codeAction focusing on actions that include edits (no executeCommand handling initially). Collect any WorkspaceEdit from results. + +Acceptance Criteria + +- Returns list of actions with title and edit payload where available. +- Unit tests for edit-only actions. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 +- https://github.com/sst/opencode/issues/438 diff --git a/specs/task-lsp-helper-definition-type-declaration.md b/specs/task-lsp-helper-definition-type-declaration.md new file mode 100644 index 000000000000..03115a09d885 --- /dev/null +++ b/specs/task-lsp-helper-definition-type-declaration.md @@ -0,0 +1,21 @@ +# Task: Add Navigation Helpers (definition/typeDefinition/declaration) + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 3 +Status: pending + +Description + +- Implement LSP client helpers for textDocument/definition, textDocument/typeDefinition, and textDocument/declaration, normalizing results to a consistent internal location type. + +Acceptance Criteria + +- Helper functions return normalized list of locations (uri + range). +- Handles single vs multiple targets and Location vs LocationLink. +- Basic unit tests using mocked responses. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 +- https://github.com/sst/opencode/issues/438 diff --git a/specs/task-lsp-helper-documentSymbol-normalize.md b/specs/task-lsp-helper-documentSymbol-normalize.md new file mode 100644 index 000000000000..48fc9282abb7 --- /dev/null +++ b/specs/task-lsp-helper-documentSymbol-normalize.md @@ -0,0 +1,20 @@ +# Task: Normalize Document Symbols + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 2 +Status: pending + +Description + +- Ensure client wrapper for textDocument/documentSymbol returns a unified format whether server returns DocumentSymbol[] or SymbolInformation[]. + +Acceptance Criteria + +- Normalized result includes name, kind, and location range. +- Unit tests demonstrate both return shapes work. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 +- https://github.com/sst/opencode/issues/247 (workspace symbols context) diff --git a/specs/task-lsp-helper-errors-timeouts-normalization.md b/specs/task-lsp-helper-errors-timeouts-normalization.md new file mode 100644 index 000000000000..c79e347ea0d3 --- /dev/null +++ b/specs/task-lsp-helper-errors-timeouts-normalization.md @@ -0,0 +1,21 @@ +# Task: Shared Error/Timeout Handling and Normalization Utilities + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 2 +Status: pending + +Description + +- Provide shared utilities for request timeouts, capability checks, and consistent normalization of LSP responses. + +Acceptance Criteria + +- Timeout wrapper used by all new helpers. +- Capability missing returns empty results and friendly errors. +- Unit tests cover timeout path. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/issues/4003 (optional requests handling) +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-helper-references.md b/specs/task-lsp-helper-references.md new file mode 100644 index 000000000000..ca2407dac900 --- /dev/null +++ b/specs/task-lsp-helper-references.md @@ -0,0 +1,21 @@ +# Task: Add References Helper (textDocument/references) + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 2 +Status: pending + +Description + +- Implement client helper for textDocument/references with options (includeDeclaration). Dedupe and sort results by file and position. + +Acceptance Criteria + +- Returns unique references with stable ordering. +- Supports includeDeclaration flag. +- Unit tests with mocked responses. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 +- https://github.com/sst/opencode/issues/438 diff --git a/specs/task-lsp-helper-rename-prepare-rename.md b/specs/task-lsp-helper-rename-prepare-rename.md new file mode 100644 index 000000000000..4180ba80a6b2 --- /dev/null +++ b/specs/task-lsp-helper-rename-prepare-rename.md @@ -0,0 +1,21 @@ +# Task: Add PrepareRename and Rename Helpers + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 3 +Status: pending + +Description + +- Implement textDocument/prepareRename to validate positions and textDocument/rename to return a WorkspaceEdit for cross-file refactors. + +Acceptance Criteria + +- PrepareRename errors handled gracefully with clear messages. +- Rename returns WorkspaceEdit normalized to internal structure. +- Unit tests mocking multi-file rename responses. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 +- https://github.com/sst/opencode/issues/438 diff --git a/specs/task-lsp-inttest-code-action-edits.md b/specs/task-lsp-inttest-code-action-edits.md new file mode 100644 index 000000000000..2ee0333e1778 --- /dev/null +++ b/specs/task-lsp-inttest-code-action-edits.md @@ -0,0 +1,18 @@ +# Task: Integration Test – Code Action (Edit-Only) + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 3 +Status: pending + +Description + +- End-to-end test where a code action returns edits; verify preview and apply. + +Acceptance Criteria + +- Confirms action selection and resulting edits match expectations. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-inttest-find-references.md b/specs/task-lsp-inttest-find-references.md new file mode 100644 index 000000000000..0ab932e4a686 --- /dev/null +++ b/specs/task-lsp-inttest-find-references.md @@ -0,0 +1,18 @@ +# Task: Integration Test – Find References + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 3 +Status: pending + +Description + +- End-to-end references test across files, verifying dedupe and stable ordering. + +Acceptance Criteria + +- Confirms expected reference count and order. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-inttest-go-to-definition.md b/specs/task-lsp-inttest-go-to-definition.md new file mode 100644 index 000000000000..9759e11cac68 --- /dev/null +++ b/specs/task-lsp-inttest-go-to-definition.md @@ -0,0 +1,18 @@ +# Task: Integration Test – Go to Definition + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 3 +Status: pending + +Description + +- End-to-end test for definition resolution using a sample or mock LSP server and the LspDefinitionTool or server endpoint. + +Acceptance Criteria + +- Asserts correct primary target and optional alternates. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-inttest-rename-multifile.md b/specs/task-lsp-inttest-rename-multifile.md new file mode 100644 index 000000000000..8cb03a1d475c --- /dev/null +++ b/specs/task-lsp-inttest-rename-multifile.md @@ -0,0 +1,19 @@ +# Task: Integration Test – Rename (Multi-File) + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 3 +Status: pending + +Description + +- End-to-end rename producing edits in multiple files; verify dry-run summary and atomic apply behavior. + +Acceptance Criteria + +- Dry-run shows expected files and ranges; successful apply modifies all files. +- Failure triggers rollback (no partial writes). + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-logging-observability.md b/specs/task-lsp-logging-observability.md new file mode 100644 index 000000000000..5577af29f107 --- /dev/null +++ b/specs/task-lsp-logging-observability.md @@ -0,0 +1,20 @@ +# Task: Logging and Observability for LSP Requests and Edits + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 2 +Status: pending + +Description + +- Add Log.create calls around LSP requests and the edit application pipeline; provide concise, useful logs without noise. + +Acceptance Criteria + +- Logs include request type, latency, result count, and failures. +- Toggle verbosity via config. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2364 (log enabled lsps) +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-nav-jump-to-definition.md b/specs/task-lsp-nav-jump-to-definition.md new file mode 100644 index 000000000000..a4c1c5baa976 --- /dev/null +++ b/specs/task-lsp-nav-jump-to-definition.md @@ -0,0 +1,19 @@ +# Task: Navigation Output Prioritization (Jump-to-Definition) + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 2 +Status: pending + +Description + +- When multiple definition targets are returned, choose primary target consistently (same file proximity, non-declaration first), with others listed. + +Acceptance Criteria + +- Deterministic priority logic documented and implemented. +- Unit tests exercising multiple-target scenarios. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-nav-references-listing.md b/specs/task-lsp-nav-references-listing.md new file mode 100644 index 000000000000..8faa18989692 --- /dev/null +++ b/specs/task-lsp-nav-references-listing.md @@ -0,0 +1,19 @@ +# Task: References Listing Output (Pagination-Ready) + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 3 +Status: pending + +Description + +- Define output shape for references suited to pagination and stable ordering; include file, range, and optional snippet. + +Acceptance Criteria + +- Deterministic ordering strategy defined and tested. +- Suitable for TUI/SDK pagination in future. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-performance-timeouts-batching.md b/specs/task-lsp-performance-timeouts-batching.md new file mode 100644 index 000000000000..3a9e877208b1 --- /dev/null +++ b/specs/task-lsp-performance-timeouts-batching.md @@ -0,0 +1,22 @@ +# Task: Performance (Timeouts, Debounce/Batching, Large Edits) + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 3 +Status: pending + +Description + +- Add per-request timeouts, debounce or batch workspace symbol queries, and ensure large WorkspaceEdit application remains efficient. + +Acceptance Criteria + +- Configurable timeouts used by helpers/tools. +- Measurable improvement in responsiveness under load. +- Unit tests simulate slow/hanging servers. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/issues/3598 (clangd hangs) +- https://github.com/sst/opencode/issues/3628 (pyright hangs) +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-routing-multi-server-policy.md b/specs/task-lsp-routing-multi-server-policy.md new file mode 100644 index 000000000000..5f95ce100c12 --- /dev/null +++ b/specs/task-lsp-routing-multi-server-policy.md @@ -0,0 +1,21 @@ +# Task: Multi-Server Routing Policy + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 3 +Status: pending + +Description + +- Define and implement selection of appropriate LSP client per file/language when multiple servers could handle a request. Consider extension matching, root, and capability. + +Acceptance Criteria + +- Policy documented and enforced in helpers/tools. +- Unit tests simulate overlapping servers. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/issues/4003 +- https://github.com/sst/opencode/pull/2975 +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-tests-mock-navigation-references-symbols.md b/specs/task-lsp-tests-mock-navigation-references-symbols.md new file mode 100644 index 000000000000..46a7c19dc835 --- /dev/null +++ b/specs/task-lsp-tests-mock-navigation-references-symbols.md @@ -0,0 +1,20 @@ +# Task: Unit Tests for Navigation/References/Symbols (Mocked) + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 3 +Status: pending + +Description + +- Mock LSP client to test definition, references, document/workspace symbols helpers and tools. + +Acceptance Criteria + +- Coverage for success and fallback paths. +- Deterministic outputs verified. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/issues/247 +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-tests-tool-schemas.md b/specs/task-lsp-tests-tool-schemas.md new file mode 100644 index 000000000000..0e2d8d72b8a7 --- /dev/null +++ b/specs/task-lsp-tests-tool-schemas.md @@ -0,0 +1,18 @@ +# Task: Unit Tests for Tool Schemas (Zod) + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 2 +Status: pending + +Description + +- Validate input/output schemas for new tools (definition, references, symbols, rename, code action) and provider/model enablement. + +Acceptance Criteria + +- Tests fail on invalid inputs and pass on valid shapes. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-tests-workspaceedit-conversion.md b/specs/task-lsp-tests-workspaceedit-conversion.md new file mode 100644 index 000000000000..462b055eb998 --- /dev/null +++ b/specs/task-lsp-tests-workspaceedit-conversion.md @@ -0,0 +1,18 @@ +# Task: Unit Tests for WorkspaceEdit Conversion + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 3 +Status: pending + +Description + +- Thorough tests for converting WorkspaceEdit/TextEdit to internal patch format, including multi-hunk, multi-file, and edge cases. + +Acceptance Criteria + +- High coverage; validates order and grouping logic. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-tool-code-action.md b/specs/task-lsp-tool-code-action.md new file mode 100644 index 000000000000..50bcce38dc7a --- /dev/null +++ b/specs/task-lsp-tool-code-action.md @@ -0,0 +1,19 @@ +# Task: Implement LspCodeActionTool (Edit-Only) + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 3 +Status: pending + +Description + +- Tool that fetches code actions for a range and returns actions that include edits (no executeCommand), ready for preview/apply pipelines. + +Acceptance Criteria + +- Returns actions with titles and their edits. +- Unit tests for edit-only actions. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-tool-definition.md b/specs/task-lsp-tool-definition.md new file mode 100644 index 000000000000..e563f8102f93 --- /dev/null +++ b/specs/task-lsp-tool-definition.md @@ -0,0 +1,20 @@ +# Task: Implement LspDefinitionTool + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 3 +Status: pending + +Description + +- Tool to resolve symbol definition(s) from a file+position and return primary target and any additional targets. + +Acceptance Criteria + +- Returns normalized locations; primary target first. +- Handles multiple LSP clients gracefully. +- Unit tests for single/multiple results. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-tool-document-symbol-listing.md b/specs/task-lsp-tool-document-symbol-listing.md new file mode 100644 index 000000000000..2c887df192e6 --- /dev/null +++ b/specs/task-lsp-tool-document-symbol-listing.md @@ -0,0 +1,19 @@ +# Task: Document Symbol Listing Tool + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 2 +Status: pending + +Description + +- Tool to list symbols for a given file (outline). Output includes name, kind, container (if any), and location. + +Acceptance Criteria + +- Supports both DocumentSymbol and SymbolInformation via normalization. +- Unit tests for representative languages. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-tool-references.md b/specs/task-lsp-tool-references.md new file mode 100644 index 000000000000..df42c37c8a64 --- /dev/null +++ b/specs/task-lsp-tool-references.md @@ -0,0 +1,20 @@ +# Task: Implement LspReferencesTool + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 3 +Status: pending + +Description + +- Tool to list references for a symbol, deduped and sorted, returning file path, range, and optional snippet. + +Acceptance Criteria + +- Deterministic ordering (definition/local before external where sensible). +- Pagination-ready output structure. +- Unit tests on mocked results. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-tool-rename.md b/specs/task-lsp-tool-rename.md new file mode 100644 index 000000000000..a17b8f2b805f --- /dev/null +++ b/specs/task-lsp-tool-rename.md @@ -0,0 +1,20 @@ +# Task: Implement LspRenameTool (with Prepare) + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 3 +Status: pending + +Description + +- Tool that validates rename at position (prepareRename) and requests rename to produce a WorkspaceEdit; returns structured edit for preview/apply. + +Acceptance Criteria + +- PrepareRename support where available; friendly failure otherwise. +- Returns WorkspaceEdit grouped by file. +- Unit tests for multi-file rename responses. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-tool-symbols.md b/specs/task-lsp-tool-symbols.md new file mode 100644 index 000000000000..36332d4916ed --- /dev/null +++ b/specs/task-lsp-tool-symbols.md @@ -0,0 +1,22 @@ +# Task: Implement LspSymbolsTool (Document/Workspace) + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 2 +Status: pending + +Description + +- Tool that returns document symbols for a file and workspace symbols for a query, normalized. + +Acceptance Criteria + +- Document: returns name, kind, location range. +- Workspace: honors filter and limit; kinds aligned with epic. +- Unit tests for both. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/issues/247 +- https://github.com/sst/opencode/pull/2708 +- https://github.com/sst/opencode/pull/36 (LSP symbols in completion) diff --git a/specs/task-lsp-tools-register.md b/specs/task-lsp-tools-register.md new file mode 100644 index 000000000000..8e8756fc3b25 --- /dev/null +++ b/specs/task-lsp-tools-register.md @@ -0,0 +1,19 @@ +# Task: Register LSP Tools in Registry + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 1 +Status: pending + +Description + +- Register new LSP tools with the tool registry and ensure provider/model enablement follows conventions; add brief descriptions. + +Acceptance Criteria + +- Tools appear in /experimental/tool endpoints with schema. +- Enabled via Wildcard rules consistent with existing tools. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 diff --git a/specs/task-lsp-tools-spec-ids-schemas.md b/specs/task-lsp-tools-spec-ids-schemas.md new file mode 100644 index 000000000000..50291b4ea804 --- /dev/null +++ b/specs/task-lsp-tools-spec-ids-schemas.md @@ -0,0 +1,20 @@ +# Task: Specify Tool IDs and Schemas (Zod) + +Epic: [LSP Symbolic Editing, Refactoring, and Search](./epic-lsp-symbolic-tools.md) + +SP: 2 +Status: pending + +Description + +- Define tool IDs and Zod input/output schemas for: lsp-definition, lsp-references, lsp-symbols (document/workspace), lsp-rename, lsp-code-action. + +Acceptance Criteria + +- Tool spec doc listing IDs, descriptions, inputs/outputs. +- Parameter schemas aligned with existing Tool.define() conventions. + +Relevant Issues/PRs + +- https://github.com/sst/opencode/pull/2708 +- https://github.com/sst/opencode/issues/711 (usage clarity)