haskell / lsp

Haskell library for the Microsoft Language Server Protocol
364 stars 90 forks source link

Fix extraneous `asdf` in `withProgress` output #372

Closed heitor-lassarote closed 2 years ago

heitor-lassarote commented 2 years ago

I was pretty surprised that after using withProgress, I started seeing in VS Code's Log (Window) the following output:

[2021-12-06 15:37:36.746] [renderer1] [error] Header must provide a Content-Length property.: Error: Header must provide a Content-Length property.
    at lo.onData (/home/heitor/.vscode/extensions/ligolang-publish.ligo-vscode-0.4.6/client/out/extension.js:2:14350)
    at Socket.<anonymous> (/home/heitor/.vscode/extensions/ligolang-publish.ligo-vscode-0.4.6/client/out/extension.js:2:14080)
    at Socket.emit (events.js:315:20)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
    at Socket.Readable.push (internal/streams/readable.js:223:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)

Taking a look at the code for withProgress, I noticed a weird putStrLn "asdf". I removed this line locally and tested it once again and now withProgress was working as intended.

My guess is that lsp redirects control to stdout and this asdf string ended up being there, which caused VS Code to fail.

heitor-lassarote commented 2 years ago

@jneira, all checks have passed and it's been some days, are any actions required from my side before this can be merged?

jneira commented 2 years ago

No, it is fine to merge, i wanted to wait to some other maintainer review but will merge, thanks!

heitor-lassarote commented 2 years ago

Great, thank you! And sorry about the ping. Have a nice weekend!