Stream: contributing

Topic: Fix LSP highlighting


view this post on Zulip MMMaellon (May 13 2026 at 05:11):

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.

view this post on Zulip Ian McLerran (May 13 2026 at 05:17):

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!

view this post on Zulip Tobias Steckenborn (May 13 2026 at 05:59):

Is it about the old or new compiler?

view this post on Zulip MMMaellon (May 13 2026 at 06:00):

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.

view this post on Zulip MMMaellon (May 13 2026 at 06:27):

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?

view this post on Zulip MMMaellon (May 13 2026 at 06:44):

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.

view this post on Zulip Luke Boswell (May 13 2026 at 12:28):

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.

view this post on Zulip MMMaellon (May 14 2026 at 01:49):

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.

view this post on Zulip MMMaellon (May 14 2026 at 01:52):

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