Skip to content

Failed to parse message header #461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
saitmilk opened this issue Sep 28, 2022 · 2 comments · Fixed by #462
Closed

Failed to parse message header #461

saitmilk opened this issue Sep 28, 2022 · 2 comments · Fixed by #462

Comments

@saitmilk
Copy link
Contributor

saitmilk commented Sep 28, 2022

vim9 has implemented language server protocol, but the message is like:

'Content-Length: 799\r\nContent-Type: application/vim-jsonrpc; charset=utf-8\r\n\r\n{"method":"initialize","jsonrpc":"2.0","id":1,"params":{"workspaceFolders":[{"uri":"file:///home/s...

and haskell language server comes out:

2022-09-28T19:11:28.497691Z | Info | Starting server  
2022-09-28T19:11:28.499555Z | Error | Failed to parse message header : string

when i send message manually like:

'Content-Length: 799\r\n\r\n{"method":"initialize","jsonrpc":"2.0","id":1,"params":{"workspaceFolders":[{"uri":"file:///home/s...

haskell language server starts successfully:

2022-09-28T19:46:52.562221Z | Info | Starting server  
2022-09-28T19:46:52.566620Z | Info | Started LSP server in 0.01s

according to the specification of language server protocol, header field 'Content-Length' and 'Content-Type' are supported, they are terminated by '\r\n'. Could you please add support for parsing 'Content-Type' header field or just ignore it?

@michaelpj
Copy link
Collaborator

@saitmilk
Copy link
Contributor Author

saitmilk commented Sep 28, 2022

yes, no wonder i can't find how it parse message header in haskell-language-server, thank you very much.

@michaelpj michaelpj transferred this issue from haskell/haskell-language-server Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants