Skip to content

Keep language callback output off the LSP protocol stream - #242

Merged
dannypsnl merged 1 commit into
jeapostrophe:masterfrom
lamestllama:fix/language-callback-stdout
Sep 29, 2026
Merged

dannypsnl merged 1 commit into
jeapostrophe:masterfrom
lamestllama:fix/language-callback-stdout

Conversation

@lamestllama

Copy link
Copy Markdown
Contributor

A language reader, lexer or formatting hook that prints to stdout can interleave plain text with Content-Length frames and corrupt the LSP connection.

Discard callback stdout during request dispatch and scheduled work. The separate response writer retains the protocol output port, and stderr is preserved. Both scopes are needed because the scheduler thread exists before request dispatch establishes its output scope.

A server-subprocess regression exercises a noisy reader through initialization, document open and edit, semantic-token requests, diagnostics, formatting and shutdown. It requires exact protocol framing, useful token/formatting results, and preserved reader stderr. Negative controls fail on contaminated protocol headers when either output scope is removed.

Validation: 431 local tests passed on Racket 9.1 CS/Linux ARM64; formatting checked with fixw. Optional fmt, Resyntax, Nanopass and Pie integrations were unavailable locally and remain covered by CI.

Contain stdout during request dispatch and scheduled work while preserving the protocol writer and stderr. Exercise noisy reader, lexer and formatting callbacks through the server subprocess.
@6cdh
6cdh requested a review from dannypsnl September 29, 2026 04:17
Comment thread lsp/scheduler.rkt
@dannypsnl
dannypsnl merged commit 0c9e826 into jeapostrophe:master Sep 29, 2026
14 checks passed
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.

3 participants