Skip to content

[BUG] find_workspace_symbols fails with "No Project" error - missing ensureFileOpen #43

@roman-compote

Description

@roman-compote

Description

find_workspace_symbols always fails with TypeScript Server Error: No Project. regardless of the query.

Root Cause

The workspaceSymbol() method in the cclsp source does not call ensureFileOpen() before sending the workspace/symbol LSP request. Without a file being opened first, the TypeScript language server never loads the project context and returns a "No Project" error.

This is the same root cause as #27, which was fixed for find_references in PR #30 by adding ensureFileOpen(). The fix was not applied to workspaceSymbol().

Environment

  • cclsp: 0.7.0 (latest)
  • typescript-language-server: 5.1.3
  • Node.js: 22
  • OS: macOS 15 (Darwin 25.2.0)
  • Claude Code: latest

Steps to Reproduce

  1. Install cclsp and configure it as an MCP server in Claude Code
  2. Open a TypeScript project
  3. Call find_workspace_symbols with any query (e.g., { "query": "useState" })
  4. Observe error: TypeScript Server Error: No Project.

Workaround

Call any file-based tool first (e.g., get_diagnostics, find_definition, or get_hover on any project file) to prime the TypeScript server with project context. After that, find_workspace_symbols works correctly for the remainder of the session.

Suggested Fix

Add an ensureFileOpen() call (or equivalent) at the beginning of the workspaceSymbol() method, matching the pattern used in find_references after PR #30. For example, open tsconfig.json or the first .ts file found in the project root before sending the workspace/symbol request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions