Stream: beginners

Topic: ✔ How to install roc_lang_server?


view this post on Zulip Anton (Jan 29 2024 at 14:11):

You can use the lang server in a flake like this:

{
    inputs = {
        nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
        flake-utils.url = "github:numtide/flake-utils";
        roc.url = "github:roc-lang/roc";
    };

    outputs = {nixpkgs, roc, flake-utils, ...}:
        flake-utils.lib.eachDefaultSystem (system:
            let
                pkgs = import nixpkgs { inherit system; };
                rocPkgs = roc.packages.${system};
            in
            {
                devShells = {
                    default = pkgs.mkShell {
                        buildInputs = with pkgs;
                        [
                            rocPkgs.cli
                            rocPkgs.lang-server
                        ];
                    };
                };
            }
        );
}

view this post on Zulip Anton (Jan 29 2024 at 14:13):

If you do nix develop followed by whcih roc_ls, you'll get the path of the lang_server, which you'll need to provide in the settings for the vscode roc plugin.

view this post on Zulip Andrew Bucknall (Jan 29 2024 at 14:30):

That did the trick, thank you!!

view this post on Zulip Notification Bot (Jan 29 2024 at 14:30):

Andrew Bucknall has marked this topic as resolved.


Last updated: Jul 06 2025 at 12:14 UTC