Stream: beginners

Topic: editors


view this post on Zulip Rayyan (Apr 13 2026 at 03:51):

hey! i'm just getting started with Roc and im exploring editors to use. I've used both Zed and VSCode so far, and I'm just wondering, is there no auto-indentation support as of now? and additionally, im not sure if this is just how it is, but the syntax highlighting sometimes colors everything, and then other times it only colors keywords.

view this post on Zulip Luke Boswell (Apr 13 2026 at 03:55):

There is an LSP built into the roc cli which provides semantic tokens for nicer highlighting. I know VS Code supports that, but I haven't tested it on the Zed extension.

Auto indentation should work... isn't that just using the format document action which delegates to roc fmt? I'm not sure I haven't looked to closely at that in a while.

view this post on Zulip Luke Boswell (Apr 13 2026 at 03:56):

Also -- it depends on if you are talking about the old rust or new zig compiler... :sweat_smile:

view this post on Zulip Rayyan (Apr 13 2026 at 18:57):

mm, whatever i installed from the archives on the website. im guessing the old rust compiler?

view this post on Zulip Rayyan (Apr 13 2026 at 21:12):

also, does the new language server work with vscode?

view this post on Zulip Anton (Apr 14 2026 at 12:19):

Looks like we need to make a new extension for that, can you confirm @Eli Dowling?

view this post on Zulip Luke Boswell (Apr 14 2026 at 12:20):

A new exention for vs code? ... I have been using @Ivan Demchenko's https://github.com/ivan-demchenko/roc-vscode-unofficial/pull/50

view this post on Zulip Anton (Apr 14 2026 at 12:24):

Should I just use path/roc experimental-lsp for the exe path in the extension settings?

view this post on Zulip Luke Boswell (Apr 14 2026 at 12:25):

I think that was basically the main change... and adding support for the --debug flag arguments our cli accepts

view this post on Zulip Anton (Apr 14 2026 at 13:44):

I get the following error:

LS executable path: Some(/Users/username/gitrepos/temp/roc_nightly-macos_apple_silicon-2026-04-14-c4161ad/roc experimental-lsp)
LS debug executable path: None
You are ready to Roc!Error: roc experimental-lsp received an unexpected argument: `--stdio`
[Error - 3:42:06 PM] Server process exited with code 1.
[Error - 3:42:06 PM] Server initialization failed.

view this post on Zulip Romain Lepert (Jun 20 2026 at 11:47):

I got the same error

LS executable path: Some(/Users/romain/Projects/roc-clay/roc_nightly-macos_apple_silicon-2026-06-16-6a21172/roc experimental-lsp)
LS debug executable path: None
You are ready to Roc!Error: roc experimental-lsp received an unexpected argument: `--stdio`
[Error - 13:46:49] Server initialization failed.

view this post on Zulip Anton (Jun 20 2026 at 17:53):

I'm taking a look at this @Romain Lepert

view this post on Zulip Anton (Jun 20 2026 at 18:18):

It is fixed in PR#9729 :)

view this post on Zulip Romain Lepert (Jun 21 2026 at 19:38):

Anton said:

It is fixed in PR#9729 :)

thank you Anton

LS executable path: Some(/Users/romain/.rocup/roc/roc experimental-lsp)
LS debug executable path: None
You are ready to Roc!Roc language server started

view this post on Zulip Romain Lepert (Jun 21 2026 at 20:37):

this looks the following issue is still ongoing for the language server.
#6792

suppose i have

# main.roc
app [Model, program] { rr: platform "https://github.com/lukewilliamboswell/roc-ray/releases/download/0.6/YsrMnLJw2ahDsyFXNEpipwWQfiM5DSxq5Ve6SyHczN7.tar.zst" }
# Foo.roc
import rr.Draw

Bar : Draw.Font

Then LSP type checks Foo.roc independently and therefore does not know about rr...

MODULE NOT FOUND

The type Font is qualified by the module rr.Draw, but that module was not found in this Roc project.

that means every module with a platform (that is not main) get an error report from the LSP :grimacing:

view this post on Zulip Romain Lepert (Jun 22 2026 at 14:23):

I plan from the issue it to add --main <path-to-main.roc> to the LSP

Start the experimental Roc language server (LSP)

Usage: roc experimental-lsp [OPTIONS]

Options:
      --stdio            Communicate over stdio (the default and only
                         transport; accepted for compatibility with LSP
                         clients that pass it explicitly)
      --debug-transport  Mirror all JSON-RPC traffic to a temp log file
      --debug-build      Log build environment actions to the debug log
      --debug-syntax     Log syntax/type checking steps to the debug log
      --debug-server     Log server lifecycle details to the debug log
  -h, --help            Print help

and then the vscode extension would be setup like

{
    "roc-lang.language-server.exe": "/Users/romain/.rocup/roc/roc experimental-lsp --main <path-to-main.roc>",
}
{
    "roc-lang.language-server.exe": "/Users/romain/.rocup/roc/roc experimental-lsp",
    "roc-lang.language-server.main": "<path-to-main.roc>",
}

Last updated: Jul 23 2026 at 13:15 UTC