anomalyco / anomalyco/opencode

[BUG] LSP workspaceSymbol ignores filePath and active workspace

Open
#46,356 0 comments 0 reactions 1 assignee View on GitHub

@rekram1-node is already working on this.

Since Aug 31, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

The experimental LSP tool requires filePath for workspaceSymbol, but the service ignores that file and sends the query to every client that happens to be active. In a fresh process there may be no active client, so the same valid query returns an empty result until another LSP operation initializes one. In a multi-root repository it can instead return unrelated or duplicate symbols from other projects.

The result therefore depends on earlier LSP activity rather than the supplied file. workspaceSymbol should initialize/select the client for filePath and query only the matching workspace.

Plugins

None required

OpenCode version

1.18.25 and current dev

Steps to reproduce
  1. Enable the experimental LSP tool in a project with a working language server.
  2. In a fresh process, call workspaceSymbol for a known symbol and supply a valid source file.
  3. Observe an empty result because no client is active yet.
  4. Run hover or documentSymbol on that file to initialize its client.
  5. Repeat workspaceSymbol and observe that results now appear.
  6. In a multi-root repository, initialize another client and observe that workspaceSymbol queries both rather than the workspace for filePath.
Screenshot and/or share link

Not applicable

Operating System

macOS 26.6.2

Terminal

Not terminal-specific

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.