haskell / vscode-haskell

VS Code extension for Haskell, powered by haskell-language-server
https://marketplace.visualstudio.com/items?itemName=haskell.haskell
Other
562 stars 90 forks source link

Parse error reported while restarting the server #927

Closed July541 closed 1 year ago

July541 commented 1 year ago

Open a Haskell project and then restart the server with the restart command, I got the following error:

[Info  - 10:45:08 PM] Stopping the server
[Info  - 10:45:08 PM] Starting the server
2023-07-31T14:45:08.809664Z | Error | LSP: incoming message parse error:
Error in $: parsing Language.LSP.Protocol.Message.Types.TNotificationMessage(TNotificationMessage) failed, key "params" not found
when processing
{"jsonrpc":"2.0","method":"exit"}
2023-07-31T14:45:08.809956Z | Info | Reactor thread stopped
2023-07-31T14:45:08.812236Z | Error | Got EOF
2023-07-31T14:45:08.938187Z | Info | haskell-language-server version: 2.1.0.0 (GHC: 9.6.2) (PATH: /Users/treee/Code/haskell-language-server/dist-newstyle/build/aarch64-osx/ghc-9.6.2/haskell-language-server-2.1.0.0/x/haskell-language-server/build/haskell-language-server/haskell-language-server) (GIT hash: e9cc4e07fcbb1ac4fee71b63c3da8ac70c5dda31)

Maybe related to #920.

I'm not sure if there has an alternative method instead of comparing the jsonrpc message for different client versions...

fendor commented 1 year ago

Can you retry with the options Haskell > Trace > Server set to Messages? It should contain the LSP messages that are sent from the client.

July541 commented 1 year ago

Can you retry with the options Haskell > Trace > Server set to Messages? It should contain the LSP messages that are sent from the client.

I've downgrade languageclient to 7.0.0(our original version), and can't repro #920, so #920 doesn't relate to HLS upgrade, #920 and this issue are separated.

[Info  - 11:14:17 PM] Stopping the server
[Trace - 11:14:17 PM] Sending request 'shutdown - (6)'.
2023-07-31T15:14:17.733832Z | Debug | Received shutdown message
2023-07-31T15:14:17.734044Z | Debug | Finished build session
AsyncCancelled
[Trace - 11:14:17 PM] Received response 'shutdown - (6)' in 2ms.
[Trace - 11:14:17 PM] Sending notification 'exit'.
[Info  - 11:14:17 PM] Starting the server
[Trace - 11:14:17 PM] Sending request 'initialize - (0)'.
2023-07-31T15:14:17.735521Z | Error | LSP: incoming message parse error:
Error in $: parsing Language.LSP.Protocol.Message.Types.TNotificationMessage(TNotificationMessage) failed, key "params" not found
when processing
{"jsonrpc":"2.0","method":"exit"}
2023-07-31T15:14:17.735574Z | Info | Reactor thread stopped
2023-07-31T15:14:17.738390Z | Error | Got EOF
2023-07-31T15:14:17.869328Z | Info | haskell-language-server version: 2.1.0.0 (GHC: 9.6.2) (PATH: /Users/treee/Code/haskell-language-server/dist-newstyle/build/aarch64-osx/ghc-9.6.2/haskell-language-server-2.1.0.0/x/haskell-language-server/build/haskell-language-server/haskell-language-server) (GIT hash: e9cc4e07fcbb1ac4fee71b63c3da8ac70c5dda31)
July541 commented 1 year ago

Resolved by https://github.com/haskell/lsp/issues/508