Skip to content

Commit

Permalink
Merge pull request #6352 from B-Teague/rename-roc-language-server
Browse files Browse the repository at this point in the history
lsp names renamed to roc_language_server
  • Loading branch information
rtfeldman authored Feb 12, 2024
2 parents ec93892 + 87ff159 commit 05823cd
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nightly_linux_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly_linux_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly_macos_apple_silicon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly_macos_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions ci/package_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion crates/lang_srv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.0.1"
edition = "2021"

[[bin]]
name = "roc_ls"
name = "roc_language_server"
path = "src/server.rs"

[dev-dependencies]
Expand Down
10 changes: 5 additions & 5 deletions crates/lang_srv/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# roc_ls
# roc_language_server

This is a basic language server for Roc.

Expand Down Expand Up @@ -36,21 +36,21 @@ 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

Follow the [building from source](https://github.com/roc-lang/roc/blob/main/BUILDING_FROM_SOURCE.md) instructions for roc. Then run:

```
# 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
Expand All @@ -65,7 +65,7 @@ Add the following to your coc JSON configuration file:
{
"languageserver": {
"roc": {
"command": "<path to binary folder>/roc_ls",
"command": "<path to binary folder>/roc_language_server",
"filetypes": ["roc"]
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/lang_srv/debug_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion nix/builder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion nix/templates/simple/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
'';
};
};
Expand Down

0 comments on commit 05823cd

Please sign in to comment.