Skip to content

[BUG] C# LSP (csharp-ls) not working - missing workspace/configuration and other request handlers #16360

@paulditerwich

Description

@paulditerwich

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

The built-in LSP support doesn't work with csharp-ls (C# language server). The LSP client is missing handlers for several standard LSP requests that csharp-ls requires during initialization:

  1. workspace/configuration - Server requests configuration settings (specifically the solution path)
  2. client/registerCapability - Server dynamically registers capabilities
  3. window/workDoneProgress/create - Server creates progress tokens for indexing feedback

Additionally, the workspace configuration capability is disabled (configuration:!1 in cli.js).

Without these, the server fails to initialize properly and returns empty results for operations like documentSymbol, hover, etc.

What Should Happen?

The LSP client should handle these standard LSP protocol requests so that csharp-ls (and other language servers that use these features) work out of the box.

After manually patching cli.js to add these handlers, all LSP operations work correctly (documentSymbol, hover, goToDefinition, findReferences).

Error Messages/Logs

Steps to Reproduce

  1. Configure csharp-ls plugin in ~/.claude/plugins/csharp-lsp/config.json
  2. Open a C# project with a .sln file
  3. Try any LSP operation on a .cs file, e.g.: LSP documentSymbol
  4. Operation returns empty results or fails

Debug logs show:

  • Server sends workspace/configuration request → no handler
  • Server sends client/registerCapability request → no handler
  • Server sends window/workDoneProgress/create request → no handler

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.0.76

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Note: This issue persists even after applying the LSP initialize() fix from:
https://gist.github.com/Zamua/f7ca58ce5dd9ba61279ea195a01b190c

That fix addresses the empty initialize() function (issue #13952), but csharp-ls
still fails because it requires these additional LSP protocol handlers that the
client doesn't implement:

  1. workspace/configuration - needs to return solution path
  2. client/registerCapability - dynamic capability registration
  3. window/workDoneProgress/create - progress token creation

The gist fix enables LSP servers to load, but csharp-ls specifically needs these
request handlers to function. Other LSP servers (like typescript-lsp) may work
without them, but csharp-ls requires all three during initialization.

Workaround: Patch cli.js to:

  1. Enable capabilities.workspace.configuration: true
  2. Add handlers:
B.onRequest("workspace/configuration", (P) => {
  return P.items.map((b) => {
    if (b.section === "csharp") return { solution: "path/to/Solution.sln" };
    return {};
  });
});
B.onRequest("client/registerCapability", () => null);
B.onRequest("window/workDoneProgress/create", () => null);

Suggested fix: The LSP plugin config already has a solution field - this could be read by the workspace/configuration handler instead of requiring manual patching.

csharp-ls version: 0.19.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:toolsbugSomething isn't workinghas reproHas detailed reproduction stepsoncallplatform:macosIssue specifically occurs on macOS

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions