Skip to content

Fix LSP stdout framing corruption#2629

Merged
plajjan merged 1 commit into
mainfrom
fix-lsp-stdio
Feb 11, 2026
Merged

Fix LSP stdout framing corruption#2629
plajjan merged 1 commit into
mainfrom
fix-lsp-stdio

Conversation

@plajjan

@plajjan plajjan commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

The LSP server communicates over stdio, so any non-protocol output on stdout can corrupt JSON-RPC framing and make VS Code lose sync with messages like "Header must provide a Content-Length property".

We had compiler paths that could emit plain text to stdout during LSP-triggered compile work (especially dependency-related output), which can interleave with LSP packets and break parsing. This originated from the compiler legacy where this was all in the old "actonc" that outputted messages meant for human consumption, then we moved it into a common library for use by the LSP-server as well but never removed the messages that were unconditionally printed.

We now add conditions to silence messages based on the quiet options or output errors to stderr instead of stdout as to not interfere with the LSP communication.

Fixes #2627

The LSP server communicates over stdio, so any non-protocol output on
stdout can corrupt JSON-RPC framing and make VS Code lose sync
with messages like "Header must provide a Content-Length property".

We had compiler paths that could emit plain text to stdout during
LSP-triggered compile work (especially dependency-related output),
which can interleave with LSP packets and break parsing. This originated
from the compiler legacy where this was all in the old "actonc" that
outputted messages meant for human consumption, then we moved it into a
common library for use by the LSP-server as well but never removed the
messages that were unconditionally printed.

We now add conditions to silence messages based on the quiet options or
output errors to stderr instead of stdout as to not interfere with the
LSP communication.
@plajjan plajjan enabled auto-merge February 11, 2026 10:29
@plajjan plajjan merged commit 6ebff84 into main Feb 11, 2026
36 of 37 checks passed
@plajjan plajjan deleted the fix-lsp-stdio branch February 11, 2026 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LSP must provide a Content-Length property

1 participant