From e8eb029e52c7a1ccf7373916cdc2417f53b45aff Mon Sep 17 00:00:00 2001 From: Maddox Werts Date: Sun, 19 Jan 2025 10:13:05 -0500 Subject: [PATCH] Updated README --- README.md | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index f6096e8..731e9ad 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,30 @@ -# Rust-LS -A Dockerized Rust Language Server +

Rust-LS

+

A Dockerized Rust Language Server

+ +# Install steps +## Setting up Virtual Environments +The first and most important steps are to build the docker images, as they are the boilerplate of this language server. Just run the following commands while in the **Rust-LS** directory. -## 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 "$@" +./scripts/cargo/docker.sh +./scripts/rust-analyzer/docker.sh ``` -### You should be all set! \ No newline at end of file +After that, you'll want to trick your system into thinking you already have both installed on your actual machine. To do that, just run the following commands: + +```bash +sudo ln -s /path/to/scripts/cargo/cargo /bin/cargo +sudo ln -s /path/to/scripts/rust-analyzer/rust-ls /bin/rust-anaylzer +``` + +To test if your setup works as intended, just run `rust-analyzer --version` and `cargo --version` and they should both spit back their respective versions. + +## Setting up IDE +Download the *Rust-Analyzer* extension from the VSCode store and set the following paths: + +Field|Path +---|--- +Cargo|/bin/cargo +Server|/bin/rust-analyzer + +After that, it *should* work as intended! \ No newline at end of file