OmniSharp / OmniSharp/csharp-language-server-protocol

Language server stays silent when not calling Initialize on it

Open
#769 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
638
Forks
109
Avg merge
1m
Merged PRs (30d)
2

Description

I've just finished a pretty long debugging session when my language server stayed completely silent.

I'm not using LanguageServer.From(...), as I'm building my language server object using AddLanguageServer in the host builder. So I've just assumed I'd do

var server = host.Services.GetRequiredService<LanguageServer>();
await server.WaitForExit;

but the server just stays silent. Turns out, you need a server.Initialize(...) call that LanguageServer.From(...) does implicitly. Is it by design that the server doesn't warn me or throw at me when I try to await WaitForExit, when I haven't initialized the server?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by tracing the AddLanguageServer path and comparing it with LanguageServer.From(...), especially how Initialize(...) relates to WaitForExit. Done would require an agreed behavior for awaiting an uninitialized server, such as a diagnostic or exception, plus coverage for that path.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.