Skip to content

LSP shutdown and exit notifications do not stop the server loop #2830

Description

@Widthdom

Summary

The LSP implementation records shutdown but never uses it to stop the read loop. exit returns null and also leaves Run blocked on further input, so clients cannot terminate the server through normal LSP lifecycle messages.

Evidence

  • src/CodeIndex/Lsp/LspServer.cs:55 handles exit as null only.
  • src/CodeIndex/Lsp/LspServer.cs:71 sets _shutdownRequested = true for shutdown.
  • src/CodeIndex/Lsp/LspServer.cs:29 loops only on TryReadMessage and does not observe _shutdownRequested.
  • src/CodeIndex/Lsp/LspServer.cs:393 only reads _shutdownRequested in Dispose.

Expected

After shutdown and exit, the LSP server should leave the message loop and return cleanly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions