Skip to content

Conversation

@riatzukiza
Copy link
Owner

@riatzukiza riatzukiza commented Nov 9, 2025

Summary

Added comprehensive specifications for LSP symbolic tools to support fuzzy searching, workspace symbol navigation, and enhanced code action capabilities in the OpenCode development environment.

Details

This PR creates extensive documentation for LSP symbolic tools including:

Core Specifications

  • LSP API Enable/Find Symbol - Fuzzy search capabilities for workspace symbols
  • LSP CLI/TUI Mapping Proposal - Command-line interface integration
  • LSP Docs Tools and Examples - Documentation and usage examples
  • LSP Edit Application Order - Consistent edit operation sequencing
  • LSP Edit Code Action Flow - Transactional edit operations
  • LSP Edit Conflict Detection - Concurrent edit handling
  • LSP Edit Convert WorkspaceEdit - Workspace transformation utilities

Advanced Features

  • LSP Edit Dry Run Preview - Preview functionality for edits
  • LSP Edit Rename Flow - Symbol rename operations
  • LSP Edit Transactional Apply - Atomic edit transactions
  • LSP Fallback Unsupported - Graceful degradation
  • LSP Foundation Inventory - Capability discovery
  • LSP Foundation MVP Capabilities - Minimum viable product scope

Helper Functions

  • LSP Helper Code Action - Code action execution utilities
  • LSP Helper Definition Type Declaration - Type system integration
  • LSP Helper Document Symbol Normalize - Symbol standardization
  • LSP Helper Errors Timeouts Normalization - Error handling patterns
  • LSP Helper References - Reference resolution utilities

Navigation & References

  • LSP Nav Jump to Definition - Definition navigation
  • LSP Nav References Listing - Reference browsing
  • LSP Performance Timeouts Batching - Performance optimization
  • LSP Routing Multi Server Policy - Multi-server support

Testing & Tools

  • LSP Tests Mock Navigation References Symbols - Mock navigation testing
  • LSP Tests Tool Schemas - Schema validation
  • LSP Tool Code Action - Code action tooling
  • LSP Tool Definition - Definition navigation
  • LSP Tool Document Symbol Listing - Symbol listing
  • LSP Tool References - Reference resolution
  • LSP Tool Rename - Symbol renaming
  • LSP Tool Symbols - Symbol search tools
  • LSP Tools Register - Tool registration system
  • LSP Tools Spec IDs Schemas - Schema specifications

Related Issues


Mirrored from sst/opencode PR anomalyco#4087

Summary by CodeRabbit

  • Documentation
    • Added comprehensive specification roadmap for LSP symbolic editing, refactoring, and search capabilities including foundation inventory, helper tools (definition, references, symbols, rename, code actions), edit application pipeline, navigation UX, integration tests, and performance optimizations.
    • Established multi-phase implementation plan with phased goals, acceptance criteria, and task breakdowns.

@coderabbitai
Copy link

coderabbitai bot commented Nov 9, 2025

Walkthrough

Comprehensive MVP specification for LSP-based symbolic editing, refactoring, and search. Introduces an epic document outlining phased roadmap and 40+ task specifications covering helper implementations, tool definitions, edit application pipeline, navigation UX, routing policy, performance optimizations, integration tests, and documentation requirements.

Changes

Cohort / File(s) Summary
Epic & Foundation
specs/epic-lsp-symbolic-tools.md
Epic spec defining goals, phased roadmap (Foundation, Tool Abstractions, Edit Pipeline, Navigation UX, Multi-Language, Validation), and cross-issue alignment.
Foundation Groundwork
specs/task-lsp-foundation-inventory.md, specs/task-lsp-foundation-mvp-capabilities.md
Tasks to inventory current LSP capabilities/gaps and define MVP methods (definition, references, symbols, rename, code actions).
API & Enablement
specs/task-lsp-api-enable-find-symbol.md, specs/task-lsp-cli-tui-mapping-proposal.md
Tasks to re-enable /find/symbol server API and map CLI/TUI commands to LSP tooling APIs.
LSP Helper Implementations
specs/task-lsp-helper-definition-type-declaration.md, specs/task-lsp-helper-references.md, specs/task-lsp-helper-rename-prepare-rename.md, specs/task-lsp-helper-codeAction.md, specs/task-lsp-helper-documentSymbol-normalize.md, specs/task-lsp-helper-errors-timeouts-normalization.md
Tasks to implement client-side LSP helpers with result normalization, deduplication, and shared error/timeout handling.
LSP Tool Specifications
specs/task-lsp-tool-definition.md, specs/task-lsp-tool-references.md, specs/task-lsp-tool-symbols.md, specs/task-lsp-tool-rename.md, specs/task-lsp-tool-code-action.md, specs/task-lsp-tool-document-symbol-listing.md, specs/task-lsp-tools-spec-ids-schemas.md, specs/task-lsp-tools-register.md
Tasks defining tool implementations (LspDefinitionTool, LspReferencesTool, LspSymbolsTool, LspRenameTool, LspCodeActionTool) with schemas and registration.
Edit Application Pipeline
specs/task-lsp-edit-convert-workspaceedit.md, specs/task-lsp-edit-transactional-apply.md, specs/task-lsp-edit-application-order.md, specs/task-lsp-edit-rename-flow.md, specs/task-lsp-edit-code-action-flow.md, specs/task-lsp-edit-dry-run-preview.md, specs/task-lsp-edit-conflict-detection.md, specs/task-lsp-edit-writability-validation.md
Tasks for end-to-end edit handling: WorkspaceEdit conversion, transactional apply with rollback, deterministic ordering, dry-run preview formatting, and safety validations.
Navigation & Routing
specs/task-lsp-nav-jump-to-definition.md, specs/task-lsp-nav-references-listing.md, specs/task-lsp-routing-multi-server-policy.md
Tasks for definition target prioritization, pagination-ready reference listing, and multi-server selection policy.
Performance & Observability
specs/task-lsp-performance-timeouts-batching.md, specs/task-lsp-logging-observability.md, specs/task-lsp-fallback-unsupported.md
Tasks for configurable timeouts/batching, request logging/observability, and graceful fallback for unsupported methods.
Testing & Validation
specs/task-lsp-tests-workspaceedit-conversion.md, specs/task-lsp-tests-tool-schemas.md, specs/task-lsp-tests-mock-navigation-references-symbols.md
Unit test tasks for WorkspaceEdit conversion, tool schemas (Zod), and mocked LSP client testing.
Integration Tests
specs/task-lsp-inttest-go-to-definition.md, specs/task-lsp-inttest-find-references.md, specs/task-lsp-inttest-rename-multifile.md, specs/task-lsp-inttest-code-action-edits.md
Integration test specifications for definition resolution, reference finding with deduplication, multi-file rename with dry-run/apply, and code action edits.
Documentation
specs/task-lsp-docs-tools-and-examples.md
Task to document each tool with schemas, example flows (definition, references, rename, code actions), and JSON schema examples.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • All changes are specification/documentation files with no code logic or public API modifications.
  • Homogeneous content: 40+ markdown files following consistent structure (Epic, SP, Status, Description, Acceptance Criteria, Related Issues/PRs).
  • Low complexity: Reading and validating specification completeness, cross-references, and terminology alignment.
  • Minimal dependencies: Files are self-contained documentation; no code or manifest changes to review.

Poem

🐰 Hoppy Specs for Symbolic Hops!

Forty tasks now drafted clear,
With LSP symbol tools so dear,
From definition hops to rename leaps,
Our editor's refactoring runs deep.
Code actions, edits, previews too—
The roadmap that rabbits pursue! 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the primary change: adding comprehensive specification documents for LSP symbolic tools, which aligns with all the added spec files covering editing, refactoring, search, and related functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch epic/lsp-symbols

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (38)
specs/task-lsp-helper-errors-timeouts-normalization.md (1)

20-21: Wrap bare URLs in angle brackets per markdown formatting standards.

Lines 20–21 contain bare URLs that should be formatted as <URL> or markdown links to comply with MD034.

Apply this diff to fix the markdown formatting:

 Relevant Issues/PRs
 
-- https://github.com/sst/opencode/issues/4003 (optional requests handling)
-- https://github.com/sst/opencode/pull/2708
+- <https://github.com/sst/opencode/issues/4003> (optional requests handling)
+- <https://github.com/sst/opencode/pull/2708>
specs/task-lsp-logging-observability.md (1)

19-20: Wrap bare URLs in angle brackets per markdown formatting standards.

Lines 19–20 contain bare URLs that should be formatted as <URL> or markdown links to comply with MD034.

Apply this diff to fix the markdown formatting:

 Relevant Issues/PRs
 
-- https://github.com/sst/opencode/pull/2364 (log enabled lsps)
-- https://github.com/sst/opencode/pull/2708
+- <https://github.com/sst/opencode/pull/2364> (log enabled lsps)
+- <https://github.com/sst/opencode/pull/2708>
specs/task-lsp-edit-rename-flow.md (1)

19-19: Wrap bare URL in angle brackets per markdown formatting standards.

Line 19 contains a bare URL that should be formatted as <URL> or a markdown link to comply with MD034.

Apply this diff to fix the markdown formatting:

 Relevant Issues/PRs
 
-- https://github.com/sst/opencode/pull/2708
+- <https://github.com/sst/opencode/pull/2708>
specs/task-lsp-performance-timeouts-batching.md (1)

19-22: Wrap bare URLs in angle brackets per markdown formatting standards.

Lines 19–22 contain bare URLs that should be formatted as <URL> to comply with MD034.

Apply this diff to fix the markdown formatting:

 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
+- <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>
specs/task-lsp-helper-references.md (1)

20-21: Wrap bare URLs in angle brackets per markdown formatting standards.

Lines 20–21 contain bare URLs that should be formatted as <URL> to comply with MD034.

Apply this diff to fix the markdown formatting:

 Relevant Issues/PRs
 
-- https://github.com/sst/opencode/pull/2708
-- https://github.com/sst/opencode/issues/438
+- <https://github.com/sst/opencode/pull/2708>
+- <https://github.com/sst/opencode/issues/438>
specs/task-lsp-fallback-unsupported.md (1)

19-20: Wrap bare URLs in angle brackets per markdown formatting standards.

Lines 19–20 contain bare URLs that should be formatted as <URL> to comply with MD034.

Apply this diff to fix the markdown formatting:

 Relevant Issues/PRs
 
-- https://github.com/sst/opencode/issues/4003
-- https://github.com/sst/opencode/pull/2708
+- <https://github.com/sst/opencode/issues/4003>
+- <https://github.com/sst/opencode/pull/2708>
specs/task-lsp-helper-documentSymbol-normalize.md (1)

19-20: Wrap bare URLs in markdown link syntax.

The references section uses bare URLs which violate markdown linting rules (MD034). Wrap URLs in link syntax for consistency with markdown best practices.

  Relevant Issues/PRs
  
- - https://github.com/sst/opencode/pull/2708
- - https://github.com/sst/opencode/issues/247
+ - [PR #2708](https://github.com/sst/opencode/pull/2708)
+ - [Issue #247](https://github.com/sst/opencode/issues/247)
specs/task-lsp-nav-references-listing.md (1)

15-15: Fix grammar issue and wrap bare URL.

Two formatting issues:

  1. Line 15: "in future" should be "in the future" (American English convention)
  2. Line 19: Bare URL needs markdown link syntax (MD034)
- Suitable for TUI/SDK pagination in future.
+ Suitable for TUI/SDK pagination in the future.

  Relevant Issues/PRs
  
- - https://github.com/sst/opencode/pull/2708
+ - [PR #2708](https://github.com/sst/opencode/pull/2708)

Also applies to: 19-19

specs/task-lsp-tests-workspaceedit-conversion.md (1)

18-18: Wrap bare URL in markdown link syntax.

The reference section uses a bare URL which violates markdown linting rule MD034.

  Relevant Issues/PRs
  
- - https://github.com/sst/opencode/pull/2708
+ - [PR #2708](https://github.com/sst/opencode/pull/2708)
specs/task-lsp-tools-register.md (1)

19-19: Wrap bare URL in markdown link syntax.

The reference section uses a bare URL which violates markdown linting rule MD034.

  Relevant Issues/PRs
  
- - https://github.com/sst/opencode/pull/2708
+ - [PR #2708](https://github.com/sst/opencode/pull/2708)
specs/task-lsp-inttest-find-references.md (1)

18-18: Wrap bare URL in markdown link syntax.

The reference section uses a bare URL which violates markdown linting rule MD034.

  Relevant Issues/PRs
  
- - https://github.com/sst/opencode/pull/2708
+ - [PR #2708](https://github.com/sst/opencode/pull/2708)
specs/task-lsp-edit-code-action-flow.md (1)

20-20: Wrap bare URL in markdown link syntax.

The reference section uses a bare URL which violates markdown linting rule MD034.

  Relevant Issues/PRs
  
- - https://github.com/sst/opencode/pull/2708
+ - [PR #2708](https://github.com/sst/opencode/pull/2708)
specs/task-lsp-api-enable-find-symbol.md (1)

19-20: Wrap bare URLs in markdown link syntax.

The references section uses bare URLs which violate markdown linting rule MD034. Wrap both URLs in link syntax for consistency.

  Relevant Issues/PRs
  
- - https://github.com/sst/opencode/issues/247
- - https://github.com/sst/opencode/pull/2708
+ - [Issue #247](https://github.com/sst/opencode/issues/247)
+ - [PR #2708](https://github.com/sst/opencode/pull/2708)
specs/task-lsp-inttest-code-action-edits.md (1)

18-18: Wrap bare URL in markdown link syntax.

The reference section uses a bare URL which violates markdown linting rule MD034.

  Relevant Issues/PRs
  
- - https://github.com/sst/opencode/pull/2708
+ - [PR #2708](https://github.com/sst/opencode/pull/2708)
specs/task-lsp-tool-document-symbol-listing.md (1)

19-19: Wrap bare URL in angle brackets per markdown linting.

Line 19 has a bare URL that violates MD034. Wrap it in angle brackets or convert to a markdown link.

- https://github.com/sst/opencode/pull/2708
+ <https://github.com/sst/opencode/pull/2708>
specs/task-lsp-edit-conflict-detection.md (1)

20-20: Wrap bare URL in angle brackets per markdown linting.

Line 20 has a bare URL that violates MD034. Wrap it in angle brackets or convert to a markdown link.

- https://github.com/sst/opencode/pull/2708
+ <https://github.com/sst/opencode/pull/2708>
specs/task-lsp-edit-application-order.md (1)

19-19: Wrap bare URL in angle brackets per markdown linting.

Line 19 has a bare URL that violates MD034. Wrap it in angle brackets or convert to a markdown link.

- https://github.com/sst/opencode/pull/2708
+ <https://github.com/sst/opencode/pull/2708>
specs/task-lsp-nav-jump-to-definition.md (1)

19-19: Wrap bare URL in angle brackets per markdown linting.

Line 19 has a bare URL that violates MD034. Wrap it in angle brackets or convert to a markdown link.

- https://github.com/sst/opencode/pull/2708
+ <https://github.com/sst/opencode/pull/2708>
specs/task-lsp-tool-symbols.md (1)

20-22: Wrap bare URLs in angle brackets per markdown linting.

Lines 20-22 have bare URLs that violate MD034. Wrap them in angle brackets or convert to markdown links.

- - 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)
+ - <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)
specs/task-lsp-routing-multi-server-policy.md (1)

19-21: Wrap bare URLs in angle brackets per markdown linting.

Lines 19-21 have bare URLs that violate MD034. Wrap them in angle brackets or convert to markdown links.

- - https://github.com/sst/opencode/issues/4003
- - https://github.com/sst/opencode/pull/2975
- - https://github.com/sst/opencode/pull/2708
+ - <https://github.com/sst/opencode/issues/4003>
+ - <https://github.com/sst/opencode/pull/2975>
+ - <https://github.com/sst/opencode/pull/2708>
specs/task-lsp-edit-writability-validation.md (1)

19-19: Wrap bare URL in angle brackets to comply with markdown linting.

Add angle brackets around the URL to resolve the MD034 linting warning.

- https://github.com/sst/opencode/pull/2708
+ <https://github.com/sst/opencode/pull/2708>
specs/task-lsp-tests-tool-schemas.md (1)

18-18: Wrap bare URL in angle brackets to comply with markdown linting.

Add angle brackets around the URL to resolve the MD034 linting warning.

- https://github.com/sst/opencode/pull/2708
+ <https://github.com/sst/opencode/pull/2708>
specs/task-lsp-helper-codeAction.md (1)

19-20: Wrap bare URLs in angle brackets to comply with markdown linting.

Add angle brackets around the URLs to resolve the MD034 linting warnings.

- https://github.com/sst/opencode/pull/2708
- https://github.com/sst/opencode/issues/438
+ <https://github.com/sst/opencode/pull/2708>
+ <https://github.com/sst/opencode/issues/438>
specs/task-lsp-inttest-rename-multifile.md (1)

19-19: Wrap bare URL in angle brackets to comply with markdown linting.

Add angle brackets around the URL to resolve the MD034 linting warning.

- https://github.com/sst/opencode/pull/2708
+ <https://github.com/sst/opencode/pull/2708>
specs/task-lsp-edit-convert-workspaceedit.md (1)

20-20: Wrap bare URL in angle brackets to comply with markdown linting.

Add angle brackets around the URL to resolve the MD034 linting warning.

- https://github.com/sst/opencode/pull/2708
+ <https://github.com/sst/opencode/pull/2708>
specs/task-lsp-edit-dry-run-preview.md (1)

19-19: Wrap bare URL in angle brackets to comply with markdown linting.

Add angle brackets around the URL to resolve the MD034 linting warning.

- https://github.com/sst/opencode/pull/2708
+ <https://github.com/sst/opencode/pull/2708>
specs/task-lsp-docs-tools-and-examples.md (1)

19-21: Wrap bare URLs in angle brackets to comply with markdown linting.

Add angle brackets around the URLs to resolve the MD034 linting warnings.

- https://github.com/sst/opencode/issues/711
- https://github.com/sst/opencode/issues/247
- https://github.com/sst/opencode/pull/2708
+ <https://github.com/sst/opencode/issues/711>
+ <https://github.com/sst/opencode/issues/247>
+ <https://github.com/sst/opencode/pull/2708>
specs/task-lsp-tool-code-action.md (1)

19-19: Wrap bare URL in angle brackets to comply with markdown linting.

Add angle brackets around the URL to resolve the MD034 linting warning.

- https://github.com/sst/opencode/pull/2708
+ <https://github.com/sst/opencode/pull/2708>
specs/task-lsp-foundation-inventory.md (1)

20-21: Wrap bare URLs in markdown link syntax.

URLs at lines 20–21 should be wrapped with markdown link syntax [text](url) to comply with markdown linting standards (MD034).

Apply this diff:

  Relevant Issues/PRs
  
- - https://github.com/sst/opencode/pull/2708 (Expose LSP API)
- - https://github.com/sst/opencode/issues/438 (more LSP)
+ - [sst/opencode#2708 Expose LSP API](https://github.com/sst/opencode/pull/2708)
+ - [sst/opencode#438 more LSP](https://github.com/sst/opencode/issues/438)
specs/task-lsp-tool-references.md (1)

20-20: Wrap bare URL in markdown link syntax.

URL at line 20 should be wrapped with markdown link syntax [text](url) to comply with markdown linting standards (MD034).

Apply this diff:

  Relevant Issues/PRs
  
- - https://github.com/sst/opencode/pull/2708
+ - [sst/opencode#2708 Expose LSP API](https://github.com/sst/opencode/pull/2708)
specs/task-lsp-tool-definition.md (1)

20-20: Wrap bare URL in markdown link syntax.

URL at line 20 should be wrapped with markdown link syntax [text](url) to comply with markdown linting standards (MD034).

Apply this diff:

  Relevant Issues/PRs
  
- - https://github.com/sst/opencode/pull/2708
+ - [sst/opencode#2708 Expose LSP API](https://github.com/sst/opencode/pull/2708)
specs/task-lsp-cli-tui-mapping-proposal.md (1)

19-21: Wrap bare URLs in markdown link syntax.

URLs at lines 19–21 should be wrapped with markdown link syntax [text](url) to comply with markdown linting standards (MD034).

Apply this diff:

  Relevant Issues/PRs
  
- - https://github.com/sst/opencode/issues/711
- - https://github.com/sst/opencode/issues/247
- - https://github.com/sst/opencode/pull/36
+ - [sst/opencode#711](https://github.com/sst/opencode/issues/711)
+ - [sst/opencode#247](https://github.com/sst/opencode/issues/247)
+ - [sst/opencode#36](https://github.com/sst/opencode/pull/36)
specs/task-lsp-foundation-mvp-capabilities.md (1)

20-21: Wrap bare URLs in markdown link syntax.

URLs at lines 20–21 should be wrapped with markdown link syntax [text](url) to comply with markdown linting standards (MD034).

Apply this diff:

  Relevant Issues/PRs
  
- - https://github.com/sst/opencode/pull/2708
- - https://github.com/sst/opencode/issues/4003 (optional requests MethodNotFound)
+ - [sst/opencode#2708 Expose LSP API](https://github.com/sst/opencode/pull/2708)
+ - [sst/opencode#4003 optional requests MethodNotFound](https://github.com/sst/opencode/issues/4003)
specs/task-lsp-tools-spec-ids-schemas.md (1)

19-20: Wrap bare URLs in markdown link syntax.

URLs at lines 19–20 should be wrapped with markdown link syntax [text](url) to comply with markdown linting standards (MD034).

Apply this diff:

  Relevant Issues/PRs
  
- - https://github.com/sst/opencode/pull/2708
- - https://github.com/sst/opencode/issues/711 (usage clarity)
+ - [sst/opencode#2708 Expose LSP API](https://github.com/sst/opencode/pull/2708)
+ - [sst/opencode#711 usage clarity](https://github.com/sst/opencode/issues/711)
specs/task-lsp-tool-rename.md (1)

20-20: Wrap bare URL in markdown link syntax.

URL at line 20 should be wrapped with markdown link syntax [text](url) to comply with markdown linting standards (MD034).

Apply this diff:

  Relevant Issues/PRs
  
- - https://github.com/sst/opencode/pull/2708
+ - [sst/opencode#2708 Expose LSP API](https://github.com/sst/opencode/pull/2708)
specs/task-lsp-edit-transactional-apply.md (1)

19-19: Wrap bare URL in markdown link syntax.

URL at line 19 should be wrapped with markdown link syntax [text](url) to comply with markdown linting standards (MD034).

Apply this diff:

  Relevant Issues/PRs
  
- - https://github.com/sst/opencode/pull/2708
+ - [sst/opencode#2708 Expose LSP API](https://github.com/sst/opencode/pull/2708)
specs/epic-lsp-symbolic-tools.md (2)

12-15: Clarify scope of "simple edit actions."

Line 14 states "Execute command-based code actions (workspace/executeCommand) beyond simple edit actions" — but what constitutes a "simple" edit action? Does this exclude multi-file transforms, structured edits (e.g., AST rewrites), or only command-based actions like "run linter"?

Consider specifying one or two examples of supported vs. unsupported actions for clarity.


163-176: Risks are appropriate but could be more concrete.

The identified risks (capability variance, large edits, multi-server overlap) are valid, and mitigations (capability detection, dry-run, routing heuristics) are sensible. However, consider whether Phase 5 should specify concrete thresholds — e.g., timeout durations, max edit size, batch limits for workspace symbol queries — to inform implementation tasks and acceptance criteria.

The implementation order (Phase 1 + 4 first) is pragmatic for unblocking anomalyco#247 without over-committing Phase 2/3 complexity upfront.

If you would like, I can help refine the risks/mitigations section with concrete performance thresholds and edge-case scenarios to guide the Phase 5 and Phase 6 task specs.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 969af4d and f47eb12.

📒 Files selected for processing (41)
  • specs/epic-lsp-symbolic-tools.md (1 hunks)
  • specs/task-lsp-api-enable-find-symbol.md (1 hunks)
  • specs/task-lsp-cli-tui-mapping-proposal.md (1 hunks)
  • specs/task-lsp-docs-tools-and-examples.md (1 hunks)
  • specs/task-lsp-edit-application-order.md (1 hunks)
  • specs/task-lsp-edit-code-action-flow.md (1 hunks)
  • specs/task-lsp-edit-conflict-detection.md (1 hunks)
  • specs/task-lsp-edit-convert-workspaceedit.md (1 hunks)
  • specs/task-lsp-edit-dry-run-preview.md (1 hunks)
  • specs/task-lsp-edit-rename-flow.md (1 hunks)
  • specs/task-lsp-edit-transactional-apply.md (1 hunks)
  • specs/task-lsp-edit-writability-validation.md (1 hunks)
  • specs/task-lsp-fallback-unsupported.md (1 hunks)
  • specs/task-lsp-foundation-inventory.md (1 hunks)
  • specs/task-lsp-foundation-mvp-capabilities.md (1 hunks)
  • specs/task-lsp-helper-codeAction.md (1 hunks)
  • specs/task-lsp-helper-definition-type-declaration.md (1 hunks)
  • specs/task-lsp-helper-documentSymbol-normalize.md (1 hunks)
  • specs/task-lsp-helper-errors-timeouts-normalization.md (1 hunks)
  • specs/task-lsp-helper-references.md (1 hunks)
  • specs/task-lsp-helper-rename-prepare-rename.md (1 hunks)
  • specs/task-lsp-inttest-code-action-edits.md (1 hunks)
  • specs/task-lsp-inttest-find-references.md (1 hunks)
  • specs/task-lsp-inttest-go-to-definition.md (1 hunks)
  • specs/task-lsp-inttest-rename-multifile.md (1 hunks)
  • specs/task-lsp-logging-observability.md (1 hunks)
  • specs/task-lsp-nav-jump-to-definition.md (1 hunks)
  • specs/task-lsp-nav-references-listing.md (1 hunks)
  • specs/task-lsp-performance-timeouts-batching.md (1 hunks)
  • specs/task-lsp-routing-multi-server-policy.md (1 hunks)
  • specs/task-lsp-tests-mock-navigation-references-symbols.md (1 hunks)
  • specs/task-lsp-tests-tool-schemas.md (1 hunks)
  • specs/task-lsp-tests-workspaceedit-conversion.md (1 hunks)
  • specs/task-lsp-tool-code-action.md (1 hunks)
  • specs/task-lsp-tool-definition.md (1 hunks)
  • specs/task-lsp-tool-document-symbol-listing.md (1 hunks)
  • specs/task-lsp-tool-references.md (1 hunks)
  • specs/task-lsp-tool-rename.md (1 hunks)
  • specs/task-lsp-tool-symbols.md (1 hunks)
  • specs/task-lsp-tools-register.md (1 hunks)
  • specs/task-lsp-tools-spec-ids-schemas.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
specs/task-lsp-nav-references-listing.md

[locale-violation] ~15-~15: The phrase ‘in future’ is British English. Did you mean: “in the future”?
Context: ...sted. - Suitable for TUI/SDK pagination in future. Relevant Issues/PRs - https://github...

(IN_FUTURE)

🪛 markdownlint-cli2 (0.18.1)
specs/task-lsp-logging-observability.md

19-19: Bare URL used

(MD034, no-bare-urls)


20-20: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-edit-writability-validation.md

19-19: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-inttest-find-references.md

18-18: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-helper-codeAction.md

20-20: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-docs-tools-and-examples.md

19-19: Bare URL used

(MD034, no-bare-urls)


20-20: Bare URL used

(MD034, no-bare-urls)


21-21: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-edit-convert-workspaceedit.md

20-20: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-api-enable-find-symbol.md

19-19: Bare URL used

(MD034, no-bare-urls)


20-20: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-performance-timeouts-batching.md

19-19: Bare URL used

(MD034, no-bare-urls)


20-20: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-edit-transactional-apply.md

19-19: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-edit-dry-run-preview.md

19-19: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-nav-jump-to-definition.md

19-19: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-tool-document-symbol-listing.md

19-19: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-routing-multi-server-policy.md

19-19: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-helper-documentSymbol-normalize.md

19-19: Bare URL used

(MD034, no-bare-urls)


20-20: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-edit-application-order.md

19-19: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-tool-definition.md

20-20: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-tool-symbols.md

20-20: Bare URL used

(MD034, no-bare-urls)


21-21: Bare URL used

(MD034, no-bare-urls)


22-22: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-tools-spec-ids-schemas.md

19-19: Bare URL used

(MD034, no-bare-urls)


20-20: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-helper-references.md

20-20: Bare URL used

(MD034, no-bare-urls)


21-21: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-helper-errors-timeouts-normalization.md

20-20: Bare URL used

(MD034, no-bare-urls)


21-21: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-edit-rename-flow.md

19-19: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-nav-references-listing.md

19-19: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-tools-register.md

19-19: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-tool-rename.md

20-20: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-tool-code-action.md

19-19: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-cli-tui-mapping-proposal.md

19-19: Bare URL used

(MD034, no-bare-urls)


20-20: Bare URL used

(MD034, no-bare-urls)


21-21: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-fallback-unsupported.md

20-20: Bare URL used

(MD034, no-bare-urls)

specs/task-lsp-inttest-code-action-edits.md

18-18: Bare URL used

(MD034, no-bare-urls)

🔇 Additional comments (4)
specs/task-lsp-inttest-go-to-definition.md (1)

1-19: Spec is well-structured and clear.

The integration test specification is appropriately defined with clear acceptance criteria for verifying primary and alternate definition targets. No issues identified.

specs/task-lsp-tests-mock-navigation-references-symbols.md (1)

1-20: Spec is well-structured and clear.

Unit test specification appropriately defines mocking scope and acceptance criteria for testing navigation, references, and symbols helpers/tools across success and fallback paths.

specs/epic-lsp-symbolic-tools.md (2)

31-94: Story point distribution and phase structure are well-scoped.

The 6-phase breakdown organizes ~40 tasks with reasonable granularity. Story points adhere to the stated convention (1, 2, 3, or 5). Phase ordering is pragmatic: Foundations → Tool Abstractions → Edit Pipeline → Navigation/Search → Robustness → Testing, with cross-dependencies clearly implied.

The prioritization note (line 174–176) to land Phase 1 + Phase 4 first before Phase 2/3 is a sensible way to unblock anomalyco#247 (workspace symbol search) while building foundational helpers.


24-30: Definition of Done is clear and testable.

The MVP outcomes are concrete: five observable capabilities (definition, references, symbols, rename, code actions), live /find/symbol results with graceful fallback, atomic WorkspaceEdit application with dry-run preview, and core flow test coverage (definition, references, rename multi-file, code action). This scope is realistic and well-aligned with issue anomalyco#247.

Comment on lines +17 to +23
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

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify that cited repository files exist and match current state.

The References section cites specific repository files (e.g., src/lsp/index.ts, src/session/prompt.ts, src/server/server.ts). Before finalizing, confirm these files exist in the codebase and that their descriptions (e.g., "Server symbol API is stubbed") remain accurate.


🏁 Script executed:

#!/bin/bash
# Verify existence of cited repository files and check their current state

echo "Checking existence of referenced files:"
fd -t f src/lsp/index.ts src/session/prompt.ts src/server/server.ts src/tool/lsp-hover.ts src/tool/lsp-diagnostics.ts

echo ""
echo "Checking for workspaceSymbol and documentSymbol in src/lsp/index.ts:"
rg -n "workspaceSymbol|documentSymbol" src/lsp/index.ts

echo ""
echo "Checking if /find/symbol endpoint exists in src/server/server.ts:"
rg -n "find/symbol|/find/symbol" src/server/server.ts

Length of output: 612


I need to explore the repository structure first since the cited files don't exist at the specified paths. Let me search more broadly for the relevant files and functionality.


🏁 Script executed:

#!/bin/bash
# Explore repository structure and search for LSP-related files

echo "=== Repository structure (top-level) ==="
ls -la

echo ""
echo "=== Search for files containing 'lsp' in name ==="
fd -t f -i lsp

echo ""
echo "=== Search for files containing 'symbol' in name ==="
fd -t f -i symbol

echo ""
echo "=== Search for server files ==="
fd -t f -i "server\\.ts"

echo ""
echo "=== Search for prompt files ==="
fd -t f -i "prompt\\.ts"

echo ""
echo "=== Search for workspaceSymbol or documentSymbol anywhere in codebase ==="
rg -l "workspaceSymbol|documentSymbol" --type ts --type js

Length of output: 5724


Now let me verify the content and descriptions of these files to ensure the cited information is accurate:


🏁 Script executed:

#!/bin/bash
# Verify content and descriptions of cited files

echo "=== packages/opencode/src/lsp/index.ts (workspaceSymbol, documentSymbol exports) ==="
rg -n "workspaceSymbol|documentSymbol" packages/opencode/src/lsp/index.ts -C2

echo ""
echo "=== packages/opencode/src/session/prompt.ts (documentSymbol usage) ==="
rg -n "documentSymbol" packages/opencode/src/session/prompt.ts -C3

echo ""
echo "=== packages/opencode/src/server/server.ts (/find/symbol endpoint) ==="
rg -n "/find/symbol|find/symbol" packages/opencode/src/server/server.ts -C3

echo ""
echo "=== packages/opencode/src/tool/lsp-hover.ts (exists) ==="
head -5 packages/opencode/src/tool/lsp-hover.ts

echo ""
echo "=== packages/opencode/src/tool/lsp-diagnostics.ts (exists) ==="
head -5 packages/opencode/src/tool/lsp-diagnostics.ts

Length of output: 1657


Let me verify the /find/symbol endpoint implementation to confirm it's stubbed:


🏁 Script executed:

#!/bin/bash
# Check /find/symbol endpoint implementation

echo "=== packages/opencode/src/server/server.ts (/find/symbol endpoint implementation) ==="
sed -n '1152,1180p' packages/opencode/src/server/server.ts

Length of output: 840


Update file paths to reflect correct monorepo structure.

The References section cites files without the packages/opencode/ prefix. All descriptions are accurate, but paths must be corrected for developers to locate them:

  • src/lsp/index.tspackages/opencode/src/lsp/index.ts
  • src/session/prompt.tspackages/opencode/src/session/prompt.ts
  • src/server/server.tspackages/opencode/src/server/server.ts
  • src/tool/lsp-hover.tspackages/opencode/src/tool/lsp-hover.ts
  • src/tool/lsp-diagnostics.tspackages/opencode/src/tool/lsp-diagnostics.ts
References (repo)

- Client LSP symbols exist: packages/opencode/src/lsp/index.ts (workspaceSymbol, documentSymbol)
- Symbol range fallback: packages/opencode/src/session/prompt.ts (uses documentSymbol to expand ranges)
- Server symbol API is stubbed: packages/opencode/src/server/server.ts (/find/symbol returns [])
- Existing tools: packages/opencode/src/tool/lsp-hover.ts, packages/opencode/src/tool/lsp-diagnostics.ts
🤖 Prompt for AI Agents
In specs/epic-lsp-symbolic-tools.md around lines 17 to 23, the References
section lists repository file paths missing the monorepo package prefix; update
each referenced path to include packages/opencode/ (e.g., change
src/lsp/index.ts to packages/opencode/src/lsp/index.ts, src/session/prompt.ts to
packages/opencode/src/session/prompt.ts, src/server/server.ts to
packages/opencode/src/server/server.ts, and src/tool/lsp-hover.ts and
src/tool/lsp-diagnostics.ts to packages/opencode/src/tool/lsp-hover.ts and
packages/opencode/src/tool/lsp-diagnostics.ts respectively) so developers can
locate the files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: sometimes clangd lsp hangs

2 participants