-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Describe the bug
I have a very large C# solution, and I'm trying to use the OmniSharp LSP via the lsp-config.json so the model can do language-aware analysis.
However, I keep seeing error messages like this every time the model tries to invoke the language server:
Error: LSP csharp server for <filepath>:: Server initialize timed out after 60000ms. The language server may need more time for initial project analysis.
The model then attempts to do things like "sleep for 1-2 minutes, try again", but it seems every time the model goes to invoke OmniSharp a new process is launched, which puts me right back into the broken loop because the new process must load the solution all over again... (I now have 6 instances of the OmniSharp process sitting at 2GB of memory usage 😄)
It seems we need 1 of 2 things here:
- A configurable
initializeTimeoutfor LSP servers, so users can account for large projects that take awhile to load. - Copilot CLI needs to stop launching new instances of the Language Server for each request. If the initial request times out, wait and attempt to contact the same instance again.
Affected version
0.0.406
Steps to reproduce the behavior
- Install OmniSharp via
choco install omnisharp - Configure
~/lsp-config.jsonwith:{ "lspServers": { "csharp": { "command": "omnisharp", "args": ["--languageserver"], "fileExtensions": { ".cs": "csharp", ".csx": "csharp", ".sln": "csharp", ".csproj": "csharp", ".props": "csharp", ".targets": "csharp" } } } } - Run a new session and ask Copilot to use the LSP to reason about a very large C# project.
Expected behavior
Either:
- Copilot CLI stops launching new processes and instead gives the original one more time to load.
- Copilot CLI needs a new option so users can account for long-starting LSPs when loading very large projects.
Additional context
- Running on Windows Terminal, PowerShell Core 7.5.4
- OmniSharp installed via
choco -
=== Codebase Statistics === Solutions (.sln): 1 Projects (.csproj): 67 C# files (.cs): 2,076 C# lines of code: 254,733 src: 1,535 files | 156,449 lines test: 408 files | 96,559 lines