In my Dev Container environment after installing nightly roc in a respective directory, I am trying to use this value /workspaces/project/cli-roc/roc_nightly-linux_x86_64/roc_language_server
for setting roc-lang.language-server.exe
of VS Code extention IvanDemchenko.roc-lang-unofficial , but the Language Server won't start even when launching manually - "Starting Roc Language Server" notification is running continuously. What am I doing wrong?
I am applying the setting specifically for a DevContainer context
Hey, can you set the ROCLS_LOG
environment variable in the container to debug
and see if you get any logs in the vscode logs view?
If that doesn't do anything try running it directly in the terminal like so:
export ROCLS_LOG=debug
roc_language_server
Then if you type something the server should crash showing something like this:
eli@eli-nixos-xps ~/C/r/book-of-examples (eli-changes)> roc_language_server
hi
[2024-03-21T04:53:47Z ERROR tower_lsp::transport] failed to decode message: failed to parse headers: invalid header name
Content-Length: 75
{"jsonrpc":"2.0","error":{"code":-32700,"message":"Parse error"},"id":null}⏎
the logs from the log view should look something like this :
image.png
Ok, so I actually specified the setting in VS Code UI, and plugin needs it specified in a workspace file settings.json. I needed to reinstall the extention after adding the configuration, and manually re-start the language server, and then it worked!
On the first start language server crashed with:
[2024-03-21T05:23:46Z DEBUG roc_language_server::registry] Finished doc analysis for doc: file:///workspaces/project/cli-roc/main.roc
[2024-03-21T05:23:46Z DEBUG roc_language_server] V1:finished document change process
[2024-03-21T05:23:46Z DEBUG roc_language_server] Applied_changes getting and returning diagnostics
[Error - 5:23:46 AM] Client roc-lang: connection to server is erroring.
Header must provide a Content-Length property.
{"{\"jsonrpc\"":"\"2.0\",\"result\":null,\"id\":2}Downloading \u001b[36mhttps://github.com/lukewilliamboswell/roc-json/releases/download/0.6.0/hJySbEhJV026DlVCHXGOZNOeoOl7468y9F9Buhj0J18.tar.br\u001b[0m\n into /home/user/.cache/roc/packages\n\nContent-Length: 9700"}
Shutting down server.
Karakatiza has marked this topic as resolved.
Last updated: Jul 06 2025 at 12:14 UTC