Hi, just as a proof of concept, I'm trying to interact with SourceKit-LSP in the terminal, but can't get a response when I provide Content-Length:
followed by any JSON-object. The only way I have managed to get a response is by omitting the header part, which gives me an error message before the server exits.
Just to make sure, I tried the same thing in a simple app using LanguageClient. In the app
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"rootUri":"file:\/\/\/Users\/einar\/","capabilities":{},"processId":40312}}
returns
{"jsonrpc":"2.0","id":1,"result":{"capabilities":{"hoverProvider":true,"implementationProvider":true,"colorProvider":true,"codeActionProvider":true,"foldingRangeProvider":true,"documentHighlightProvider":true,"definitionProvider":true,"documentSymbolProvider":true,"executeCommandProvider":{"commands":["semantic.refactor.command"]},"completionProvider":{"resolveProvider":false,"triggerCharacters":["."]},"referencesProvider":true,"textDocumentSync":{"willSave":true,"save":{"includeText":false},"openClose":true,"change":2,"willSaveWaitUntil":false},"workspaceSymbolProvider":true,"workspace":{"workspaceFolders":{"changeNotifications":true,"supported":true}}}}}
But the same JSON (with the correct proc id for the server running) returns nothing when pasted/typed directly into the terminal. I have also tried controlling for backslash and byte count in the 'Content-Length:', and both with and without \r\n
, but still, nothing.
What am I doing wrong?