Stream: beginners

Topic: Ensuring I've activated the language server properly


view this post on Zulip Alex Kelley (Jan 01 2024 at 01:27):

I installed Roc (MacOS Apple Silicon). As expected, it created a "nightly" directory, and inside that directory there are two executables roc and roc_lang_server. Now, I'm trying to get my editor configuration to see and start the language server. Is the language server command roc_ls or roc_lang_server? According to the README in the lang_srv crate directory, the language server executable should be roc_ls. But neither naming convention appears to work in my editor (Helix). Thanks for your help.

view this post on Zulip mkrieger1 (Jan 01 2024 at 02:13):

The name of the executable that is included in the nightly is roc_lang_server. You need to make sure that it's in the PATH.

view this post on Zulip mkrieger1 (Jan 01 2024 at 02:19):

Occasionally the server crashes or seems to not respond, so that makes it more difficult to check if the setup is working.

view this post on Zulip mkrieger1 (Jan 01 2024 at 02:44):

roc_ls is renamed to roc_lang_server in package_release.sh

view this post on Zulip rudolf (Jan 01 2024 at 09:13):

If you use VSCode Proper / Codium, you can add full path in the settings JSON: "roc-lang.language-server.exe": "..."

view this post on Zulip Anton (Jan 01 2024 at 10:00):

I've created good first issue #6330 to rename roc_ls to roc_lang_server everywhere. Descriptive names are nicer :)

view this post on Zulip Alex Kelley (Jan 01 2024 at 15:02):

Alex Kelley said:

I installed Roc (MacOS Apple Silicon). As expected, it created a "nightly" directory, and inside that directory there are two executables roc and roc_lang_server. Now, I'm trying to get my editor configuration to see and start the language server. Is the language server command roc_ls or roc_lang_server? According to the README in the lang_srv crate directory, the language server executable should be roc_ls. But neither naming convention appears to work in my editor (Helix). Thanks for your help.

Thanks everyone. It looks like I had my language.toml file (Helix editor) specified incorrectly.

For those using Helix, here's what's working for me:

[language-server.roc-ls]
 command = "roc_lang_server"

 [[language]]
name = "roc"
scope = "source.roc"
injection-regex = "roc"
file-types = ["roc"]
shebangs = ["roc"]
roots = []
auto-format = false
comment-token = "#"
language-servers = [ "roc-ls" ]
indent = { tab-width = 2, unit = "  " }
auto-pairs = {'(' = ')', '{' = '}', '[' = ']', '"' = '"'}

[[grammar]]
name = "roc"
source.git = "https://github.com/adkelley/tree-sitter-roc"
source.rev = "d0c812eca21bd75005004bcef383a59ae6d5dc0e"

Note the commit hash (i.e., source.rev) is subject to change

After updating your language.toml file. Do the following:

  1. Build up on the shell
$ hx -g fetch
$ hx -g build
  1. Copy the query files
$ mkdir -p $HELIX/runtime/queries/roc # or make your query directory
$ cp -r $HELIX/runtime/grammars/sources/roc/queries $HELIX/runtime/queries/roc

view this post on Zulip Anton (Jan 01 2024 at 15:23):

Thanks for sharing @Alex Kelley :)

view this post on Zulip Alexander Pyattaev (Jan 01 2024 at 19:38):

Can you package the language server binary into nightly builds? This would make it possible to pull it into things like AUR packages.

view this post on Zulip mkrieger1 (Jan 01 2024 at 19:47):

@Alexander Pyattaev It is since c85b97d

view this post on Zulip Alexander Pyattaev (Jan 03 2024 at 20:25):

Silly me. Now in AUR=)


Last updated: Jul 06 2025 at 12:14 UTC