Skip to content
Snippets Groups Projects
Commit e25a84c5 authored by Per's avatar Per
Browse files

polishing

parent f99f113a
Branches master
No related tags found
No related merge requests found
...@@ -59,11 +59,11 @@ There is also another (old) crate named `rustfmt`, that can be compiled with the ...@@ -59,11 +59,11 @@ There is also another (old) crate named `rustfmt`, that can be compiled with the
# Rust Crates # Rust Crates
A *crate* is a unit of compilation, being either a *library* or an application. Crates are managed (compiled, installed, removed, updated, etc.) by the [cargo](https://crates.io/) tool. A *crate* is a unit of compilation, being either a *library* or an exectuable *application* (binary). Crates are managed (compiled, installed, removed, updated, etc.) by the [cargo](https://crates.io/) tool.
`*.toml` files are used throughtout Rust developments for giving configuration (meta) information (essentially replacing the need of Makefiles). The `Cargo.lock` file shows the cashed dependencies (you may delete the `Cargo.lock` file to force updating dependencies, `cargo clean` may not be enough). `*.toml` files are used throughtout Rust developments for giving configuration (meta) information (essentially replacing the need of Makefiles). The `Cargo.lock` file shows the cashed dependencies (you may delete the `Cargo.lock` file to force updating dependencies, `cargo clean` may not be enough).
Dependencies (may) include a minimal version, eg `itm = "0.1.1"` indicates that at least version `0.1.1` in required (so `0.1.1`, `0.1.2`, `0.2.3` is Ok, while `0.1.0` will not suffice, and a version `1.0.0` would be considered a breaking change (major number changed) and not considered. Rust follows the [semver](http://semver.org/) versioning standard. Dependencies (may) include a minimal version, following the [semver](http://semver.org/) versioning standard.
# VSCODE support # VSCODE support
## RLS ## RLS
...@@ -71,7 +71,7 @@ Dependencies (may) include a minimal version, eg `itm = "0.1.1"` indicates that ...@@ -71,7 +71,7 @@ Dependencies (may) include a minimal version, eg `itm = "0.1.1"` indicates that
See [rls](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust) for installing the RLS extension. See [rls](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust) for installing the RLS extension.
You will need to pin the specific toolchain version used, by setting the `"rust-client.channel": "nightly-2017-10-24"` in your `vscode` *user* settings (this will be stored in a file `~/.config/Code/User/settings.json` and used for all your `vscode` projects. Settings may be set individually for each *workspace*, overriding the defaults. To the end of the `"rust-client.channel"` setting, a *workspace* setting would force the specific version, and may not work when code is distributed (as other developers may be on other toolchains). You will need to pin the specific toolchain version used, by setting the `"rust-client.channel": "nightly-2017-10-24"` in your `vscode` *user* settings (this will be stored in a file `~/.config/Code/User/settings.json` and used for all your `vscode` projects. Settings may be set individually for each *workspace*, overriding the defaults. Regarding the `"rust-client.channel"` setting, a *workspace* setting would force the specific version (overriding the default), and may not work when code is distributed (as other developers may be on other toolchains).
For RLS to work, `vscode` need a path to the `rls-preview` library (using the environment variable `LD_LIBRARY_PATH`). For RLS to work, `vscode` need a path to the `rls-preview` library (using the environment variable `LD_LIBRARY_PATH`).
``` ```
...@@ -79,7 +79,7 @@ export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib ...@@ -79,7 +79,7 @@ export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib
``` ```
You may add this to your `~/.bash_profile`, and start vscode (`code` is the name of the executable) in a new terminal (to ensure that the `LD_LIBRARY_PATH` is correctly set). If `code` is run from your window manager (e.g., `plasma`), make sure that the environment is set correctly. You may add this to your `~/.bash_profile`, and start vscode (`code` is the name of the executable) in a new terminal (to ensure that the `LD_LIBRARY_PATH` is correctly set). If `code` is run from your window manager (e.g., `plasma`), make sure that the environment is set correctly.
Under the hood, `rustc --print sysroot` gives you the path to the root of the current toolchain. So its important that the toolchain is set correctsy by `rustup` for this to work. Under the hood: `rustc --print sysroot` gives you the path to the root of the current toolchain. So its important that the toolchain is set correctsy by `rustup` for this to work.
## GIT ## GIT
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment