How can I setup format on save with VS Code?
If you use the unofficial vscode extension (https://github.com/ivan-demchenko/roc-vscode-unofficial) with LSP configured then something like this works for me:
{
"roc-lang.language-server.exe": "/path/to/roc_ls",
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file"
}
I tried this, and I believe the LSP is working because I'm getting warnings in my code, but it's still not formatting on save
I also have the Roc (Unofficial) extension installed by Ivan
Does the formatting work at all?
Can you manually format a roc file?
E.g. when you run "command pallete (ctrl/cmd + shift + p)" -> "Format Document"
Thanks, I had prettier set as my formatter, changed it to Roc and now it works :)
Last updated: Jul 06 2025 at 12:14 UTC