I plan to fix the issue where the LSP highlights the entire file when there's an error on just one line. Leaving a message here per the contributing docs.
I remember hitting this issue fairly often when I was doing heavy work on roc code. It'll be nice to have this issue fixed up if and when I go back to touch up some of that old code in preparation for migration to the new compiler!
Is it about the old or new compiler?
I think the lsp is only in the old compiler right now, right? I see it under crates/roc/language_server but I don't see a build target for it in the zig files.
JK I think the zig version of the LSP is under /src/lsp. It appears it's not a separate executable anymore and it's now part of the zig version of the roc cli?
So the lsp is now run with roc experimental-lsp but it has a ton of issues. Every file I've tried it with, including a simple hello world nevermind hello world works. Other files don't though:
main! = |_args| {
echo!("Hello, World!")
Ok({})
}
lights up with errors even though running the same file with roc works fine. I think I'm just going to focus on improving the old version of the lsp and let someone else fix up the experimental lsp.
Re the above... I suspect we need to update the LSP to detect and support the builtin "echo" platform. That builtin platform was added recently and after the last rpund of changes on the LSP so its probably something simple in there thats missing.
I don't think it's an issue with "echo" I mispoke when I said hello world didn't work. This was one of the errors I got yesterday that I saved:
├╴E TOO FEW TYPE ARGUMENTS
│
│ The `Result` alias expects 2 type arguments, but it got 1
│ instead:
│
│ 13│ init! : {} => Result(Model, [])
│ ^^^^^^^^^^^^^^^^^
│
│ Are there missing parentheses? [13, 15]
It really confused me for a while, because I am passing Result 2 arguments, Model and []
But today, that exact line works fine. Not sure what changed.
Not that it matters though. My main motivation for implementing this fix was because i wanted to try out roc lang and I wanted proper LSP error highlighting to make my life easier as I learn the ropes. This new experimental lsp is, as advertised, very experimental and unreliable, so I am more interested in fixing up the old lsp for now.
Last updated: May 23 2026 at 12:51 UTC