ebkalderon / tower-lsp

Language Server Protocol implementation written in Rust
Apache License 2.0
951 stars 54 forks source link

Header must provide a Content-Length property #410

Closed OceanBelongsToMe closed 4 months ago

OceanBelongsToMe commented 5 months ago

Client Language Server Example: connection to server is erroring. Header must provide a Content-Length property. {"{\"jsonrpc\"":"\"2.0\",\"result\":{\"contents\":\"## test1\n\n- test\n | a | b | c |\n | --- | --- | --- |\n | ss | ss | ss |\n | ss | ss | ss |\",\"range\":{\"end\":{\"character\":6,\"line\":7},\"start\":{\"character\":6,\"line\":7}}},\"id\":25}Content-Length: 39"} Shutting down server.

image
OceanBelongsToMe commented 5 months ago
let (service, socket) = LspService::new(|client| Backend {
        client,
        trie: Default::default(),
    });
    Server::new(stdin, stdout, socket).serve(service).await;
attila-lin commented 4 months ago

I think you may printed something.

remove all print/dbg if you use stdio/stdout

OceanBelongsToMe commented 4 months ago

I think you may printed something.

remove all print/dbg if you use stdio/stdout

yes you are right, thanks for your help!