You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I searched issues and couldn’t find anything (or linked relevant results below)
Problem
If the server uses the stdio protocol for communication, stdout is used for communication. However, console.log() etc statements also write to stdout. This causes the following error:
node_modules/vscode-jsonrpc/lib/common/messageReader.js:138
throw new Error('Header must provide a Content-Length property.');
^
Error: Header must provide a Content-Length property.
at StreamMessageReader.onData (node_modules/vscode-jsonrpc/lib/common/messageReader.js:138:27)
at Socket.<anonymous> (node_modules/vscode-jsonrpc/lib/common/messageReader.js:122:18)
at Socket.emit (node:events:520:28)
The language server simply shouldn’t use console.log(), but third party plugins or other third party packages might do so.
Solution
The language server can rewrite the global console, so its calls are rerouted to connection.console.
Alternatives
The output could be disabled entirely.
The text was updated successfully, but these errors were encountered:
Initial checklist
Problem
If the server uses the stdio protocol for communication, stdout is used for communication. However,
console.log()
etc statements also write to stdout. This causes the following error:The language server simply shouldn’t use
console.log()
, but third party plugins or other third party packages might do so.Solution
The language server can rewrite the global console, so its calls are rerouted to
connection.console
.Alternatives
The output could be disabled entirely.
The text was updated successfully, but these errors were encountered: