commit 008ba87a49feddc03adf951f065f1716641fd289 Author: OBJNULL Date: Thu Jun 20 13:03:55 2024 -0400 Base Upload diff --git a/Dockerfile b/Dockerfile new file mode 100755 index 0000000..a569a72 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +## INSTALL ## +FROM rust + +RUN rustup component add rust-src +RUN wget https://github.com/rust-lang/rust-analyzer/releases/download/2024-06-17/rust-analyzer-x86_64-unknown-linux-gnu.gz -O /tmp/rust-analyzer.gz +RUN gunzip -c /tmp/rust-analyzer.gz > /usr/bin/rust-analyzer +RUN chmod 755 /usr/bin/rust-analyzer + +## RUNTIME ## +ENTRYPOINT ["/usr/bin/rust-analyzer"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..f6096e8 --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +# Rust-LS +A Dockerized Rust Language Server + +## Install steps +1. Build the docker image with the following command: +```bash +docker build . -t rust-ls +``` +2. Initilize your project's *Cargo.lock* file by creating a project with `Cargo Init [PROJECT_NAME]` and replace the following section of the **rust-ls** file *(Delete the text inside [])*: +```bash +docker run -i --rm -u $(stat -c '%u:%g' .) -v "$PWD:$PWD:[ro,z]Z" -w "$PWD" rust-ls "$@" +``` +3. Open Visual Studio Code with the *rust-analyzer* extension, and edit the rust-analyzer server directory to where the **rust-ls** file is. Open your project directory and let it initilize. +4. Delete the junk *target* folder. and modify your **rust-ls* back to the original state +```bash +docker run -i --rm -u $(stat -c '%u:%g' .) -v "$PWD:$PWD:Z" -w "$PWD" rust-ls "$@" +``` + +### You should be all set! \ No newline at end of file diff --git a/rust-ls b/rust-ls new file mode 100755 index 0000000..f337164 --- /dev/null +++ b/rust-ls @@ -0,0 +1 @@ +docker run -i --rm -u $(stat -c '%u:%g' .) -v "$PWD:$PWD:ro,z" -w "$PWD" rust-ls "$@"