Base Upload

This commit is contained in:
Maddox Werts 2024-06-20 13:03:55 -04:00
commit 008ba87a49
3 changed files with 30 additions and 0 deletions

10
Dockerfile Executable file
View file

@ -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"]

19
README.md Normal file
View file

@ -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!

1
rust-ls Executable file
View file

@ -0,0 +1 @@
docker run -i --rm -u $(stat -c '%u:%g' .) -v "$PWD:$PWD:ro,z" -w "$PWD" rust-ls "$@"