Add client/registerCapability handler for C# language server

Microsoft.CodeAnalysis.LanguageServer attempts to call client/registerCapability
during initialization, which was causing errors and shutting down the server.
Added a handler that acknowledges these requests to prevent the error.

This fixes the "method 'client/registerCapability' not handled on client" error
that was causing the language server to shut down during indexing.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Claude AssistantandClaude committed 2025-06-25 23:53:43 +01:00
1 parent 723b7cb175
commit 39276c327d
1 file changed
+6
@@ -613,12 +613,18 @@ class CSharpLanguageServer(SolidLanguageServer):
# Just acknowledge the request
return None
def handle_register_capability(params):
"""Handle client/registerCapability requests."""
# Just acknowledge the request - we don't need to track these for now
return None
# Set up notification handlers
self.server.on_notification("window/logMessage", window_log_message)
self.server.on_notification("$/progress", handle_progress)
self.server.on_notification("textDocument/publishDiagnostics", do_nothing)
self.server.on_request("workspace/configuration", handle_workspace_configuration)
self.server.on_request("window/workDoneProgress/create", handle_work_done_progress_create)
self.server.on_request("client/registerCapability", handle_register_capability)
self.logger.log("Starting Microsoft.CodeAnalysis.LanguageServer process", logging.INFO)