OmniSharp / omnisharp-roslyn

OmniSharp server (HTTP, STDIO) based on Roslyn workspaces
MIT License
1.79k stars 420 forks source link

LSP server never starts and produces no logs #2538

Open manokara opened 1 year ago

manokara commented 1 year ago

Hi! So I'm running OmniSharp on Windows 10 (x64 build) with OmniSharp -v --languageserver and nothing comes out on the console, and as such the LSP server simply does not work, getting timeouts in the editor. It's as if it stuck waiting the LanguageServerHost to start. I'm not entirely familiar with OmniSharp's code but from a quick glance I find it weird how normal stdio mode has some extra boilerplate code and it works fine while LSP doesn't. What is going on?

ahihi commented 1 year ago

i am having the same problem on Windows 11 x64, both with v1.39.8 and the latest a0d6878.

indeed the LanguageServerHost.Start() call is getting stuck - the await on the task returned by LanguageServerHost.From() never completes. with some more debugging, i see this await in LanguageServer.Initialize() hanging, but the control flow leading up to here is beyond me so i am unable to dig any deeper.

ahihi commented 1 year ago

https://github.com/OmniSharp/csharp-language-server-protocol/issues/933 is presumably the same issue.

kaannt commented 4 months ago

Are you guys sending the initialize and initialized lsp requests?

JoeyGee commented 2 months ago

I got the same issues. My problem was a malformed initialize lsp request as mentioned by @kaannt . If you want to try it out send this into stdio:

Content-Length: 1031

{"jsonrpc":"2.0","id":"0","method":"initialize","params":{"capabilities":{"textDocument":{"hover":{"dynamicRegistration":true,"contentFormat":["plaintext","markdown"]},"moniker":{},"synchronization":{"dynamicRegistration":true,"willSave":false,"didSave":false,"willSaveWaitUntil":false},"completion":{"dynamicRegistration":true,"completionItem":{"snippetSupport":false,"commitCharactersSupport":true,"documentationFormat":["plaintext","markdown"],"deprecatedSupport":false,"preselectSupport":false},"contextSupport":false},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["plaintext","markdown"]}},"declaration":{"dynamicRegistration":true,"linkSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true}},"workspace":{"didChangeConfiguration":{"dynamicRegistration":true}}},"initializationOptions":null,"processId":null,"rootUri":"file:///"}}

image