diff --git a/.github/workflows/nightly_linux_arm64.yml b/.github/workflows/nightly_linux_arm64.yml index 3454e0fdaf5..981d1c469af 100644 --- a/.github/workflows/nightly_linux_arm64.yml +++ b/.github/workflows/nightly_linux_arm64.yml @@ -25,7 +25,7 @@ jobs: run: ./ci/write_version.sh - name: build release with lto - run: cargo build --profile=release-with-lto --locked --bin roc --bin roc_ls + run: cargo build --profile=release-with-lto --locked --bin roc --bin roc_language_server - name: get commit SHA run: echo "SHA=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_ENV diff --git a/.github/workflows/nightly_linux_x86_64.yml b/.github/workflows/nightly_linux_x86_64.yml index b871064d604..a8905c93442 100644 --- a/.github/workflows/nightly_linux_x86_64.yml +++ b/.github/workflows/nightly_linux_x86_64.yml @@ -25,7 +25,7 @@ jobs: run: ./ci/write_version.sh - name: build release with lto - run: RUSTFLAGS="-C target-cpu=x86-64" cargo build --profile=release-with-lto --locked --bin roc --bin roc_ls + run: RUSTFLAGS="-C target-cpu=x86-64" cargo build --profile=release-with-lto --locked --bin roc --bin roc_language_server # target-cpu=x86-64 -> For maximal compatibility for all CPU's. This was also faster in our tests: https://roc.zulipchat.com/#narrow/stream/231635-compiler-development/topic/.2Ecargo.2Fconfig.2Etoml/near/325726299 - name: get commit SHA diff --git a/.github/workflows/nightly_macos_apple_silicon.yml b/.github/workflows/nightly_macos_apple_silicon.yml index 57f8ec1d53e..8fed1b70af9 100644 --- a/.github/workflows/nightly_macos_apple_silicon.yml +++ b/.github/workflows/nightly_macos_apple_silicon.yml @@ -42,7 +42,7 @@ jobs: run: ./ci/write_version.sh - name: build nightly release - run: cargo build --locked --profile=release-with-lto --bin roc --bin roc_ls + run: cargo build --locked --profile=release-with-lto --bin roc --bin roc_language_server - name: package release run: ./ci/package_release.sh ${{ env.RELEASE_FOLDER_NAME }} diff --git a/.github/workflows/nightly_macos_x86_64.yml b/.github/workflows/nightly_macos_x86_64.yml index 97fed5fb33d..fd5db9b53db 100644 --- a/.github/workflows/nightly_macos_x86_64.yml +++ b/.github/workflows/nightly_macos_x86_64.yml @@ -32,7 +32,7 @@ jobs: # this issue may be caused by using older versions of XCode - name: build release - run: RUSTFLAGS="-C target-cpu=x86-64" cargo build --profile=release-with-lto --locked --bin roc --bin roc_ls + run: RUSTFLAGS="-C target-cpu=x86-64" cargo build --profile=release-with-lto --locked --bin roc --bin roc_language_server # target-cpu=x86-64 -> For maximal compatibility for all CPU's. - name: get commit SHA diff --git a/Earthfile b/Earthfile index 485e7dbaa92..0829c090fe6 100644 --- a/Earthfile +++ b/Earthfile @@ -53,7 +53,7 @@ build-nightly-release: COPY --dir .git LICENSE LEGAL_DETAILS ci ./ # version.txt is used by the CLI: roc --version RUN ./ci/write_version.sh - RUN RUSTFLAGS=$RUSTFLAGS cargo build --profile=release-with-lto --locked --bin roc --bin roc_ls + RUN RUSTFLAGS=$RUSTFLAGS cargo build --profile=release-with-lto --locked --bin roc --bin roc_language_server RUN ./ci/package_release.sh $RELEASE_FOLDER_NAME RUN ls SAVE ARTIFACT ./$RELEASE_FOLDER_NAME.tar.gz AS LOCAL $RELEASE_FOLDER_NAME.tar.gz diff --git a/ci/package_release.sh b/ci/package_release.sh index 131e155b61c..534ab74bde7 100755 --- a/ci/package_release.sh +++ b/ci/package_release.sh @@ -5,19 +5,19 @@ set -euxo pipefail # this makes the binaries a lot smaller strip ./target/release-with-lto/roc -strip ./target/release-with-lto/roc_ls +strip ./target/release-with-lto/roc_language_server # to be able to delete "target" later cp target/release-with-lto/roc ./roc -cp target/release-with-lto/roc_ls ./roc_lang_server +cp target/release-with-lto/roc_language_server ./roc_language_server # delete unnecessary files and folders -git clean -fdx --exclude roc --exclude roc_lang_server +git clean -fdx --exclude roc --exclude roc_language_server mkdir $1 -mv roc roc_lang_server LICENSE LEGAL_DETAILS $1 +mv roc roc_language_server LICENSE LEGAL_DETAILS $1 mkdir $1/examples mv examples/helloWorld.roc examples/platform-switching examples/cli $1/examples diff --git a/crates/lang_srv/Cargo.toml b/crates/lang_srv/Cargo.toml index 0f53085688e..1bd963e9a87 100644 --- a/crates/lang_srv/Cargo.toml +++ b/crates/lang_srv/Cargo.toml @@ -4,7 +4,7 @@ version = "0.0.1" edition = "2021" [[bin]] -name = "roc_ls" +name = "roc_language_server" path = "src/server.rs" [dev-dependencies] diff --git a/crates/lang_srv/README.md b/crates/lang_srv/README.md index 0a71d9e12d2..c8b8a8cbaf1 100644 --- a/crates/lang_srv/README.md +++ b/crates/lang_srv/README.md @@ -1,4 +1,4 @@ -# roc_ls +# roc_language_server This is a basic language server for Roc. @@ -36,7 +36,7 @@ Note that the language server is a bit naïve: ## Installing -The roc_lang_server binary is included with the [nightly releases](https://github.com/roc-lang/roc/releases). We recommend using the same version of roc and roc_lang_server. +The roc_language_server binary is included with the [nightly releases](https://github.com/roc-lang/roc/releases). We recommend using the same version of roc and roc_language_server. ### Building from source @@ -44,13 +44,13 @@ Follow the [building from source](https://github.com/roc-lang/roc/blob/main/BUIL ``` # do `nix develop` first if you're using nix! -cargo build -p roc_lang_srv --release +cargo build -p roc_language_server --release ``` This will give you the language server binary at: ``` -target/release/roc_ls +target/release/roc_language_server ``` ### Configuring in your editor @@ -65,7 +65,7 @@ Add the following to your coc JSON configuration file: { "languageserver": { "roc": { - "command": "/roc_ls", + "command": "/roc_language_server", "filetypes": ["roc"] } } diff --git a/crates/lang_srv/debug_server.sh b/crates/lang_srv/debug_server.sh index f23ea57c7a2..3eb8439a974 100755 --- a/crates/lang_srv/debug_server.sh +++ b/crates/lang_srv/debug_server.sh @@ -2,4 +2,4 @@ SCRIPT_DIR=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd) RUST_LOG=debug -${SCRIPT_DIR}/../../target/debug/roc_ls "$@" 2> /tmp/roc_ls.err +${SCRIPT_DIR}/../../target/debug/roc_language_server "$@" 2> /tmp/roc_language_server.err diff --git a/nix/builder.nix b/nix/builder.nix index 262d3bc203f..212e838be7d 100644 --- a/nix/builder.nix +++ b/nix/builder.nix @@ -3,7 +3,7 @@ let inherit (compile-deps) zigPkg llvmPkgs llvmVersion llvmMajorMinorStr glibcPath libGccSPath; subPackagePath = if subPackage != null then "crates/${subPackage}" else null; - mainBin = if subPackage == "lang_srv" then "roc_ls" else "roc"; + mainBin = if subPackage == "lang_srv" then "roc_language_server" else "roc"; filteredSource = pkgs.callPackage ./fileFilter.nix { }; in rustPlatform.buildRustPackage { diff --git a/nix/templates/simple/flake.nix b/nix/templates/simple/flake.nix index 244687c428e..9bddcf6eebd 100644 --- a/nix/templates/simple/flake.nix +++ b/nix/templates/simple/flake.nix @@ -30,7 +30,7 @@ # For vscode plugin https://github.com/ivan-demchenko/roc-vscode-unofficial shellHook = '' - export ROC_LSP_PATH=${rocFull}/bin/roc_ls + export ROC_LANGUAGE_SERVER_PATH=${rocFull}/bin/roc_language_server ''; }; };