You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 19, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: src/docs/languages/rust.md
+28-54Lines changed: 28 additions & 54 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,15 +8,18 @@ Rust is a first-class language in Gitpod, and we believe that Gitpod is a great
8
8
* The blazing-fast workspace search is powered by [ripgrep](https://github.com/BurntSushi/ripgrep)
9
9
10
10
## Rust Version
11
-
Both Rust `v1.39.0 stable` and `nightly` are pre-installed in Gitpod. Stable is the default, but you can switch to the nightly version of Rust by running `rustup default nightly` in a terminal.
12
11
13
-
Note: If you try to use `rustup` in your Dockerfile, you might get the following error:
12
+
Gitpod always comes with the latest available Rust toolchain pre-installed using [rustup](https://rustup.rs/). (As of 11 Sep 2020, the Rust version is `1.46.0`, and it's updated [semi-automatically](https://github.com/gitpod-io/workspace-images/pull/282/files) on every official Rust release.)
13
+
14
+
You can also use `rustup` yourself in Gitpod in order to switch to a different Rust version, or to install extra components. See the [the rustup book](https://rust-lang.github.io/rustup/index.html) to learn more about `rustup` itself.
15
+
16
+
Note: If you try to use `rustup` in your repository's [.gitpod.Dockerfile](/docs/config-docker/), you might get the following error:
14
17
15
18
```
16
19
/bin/sh: rustup command not found
17
20
```
18
21
19
-
To fix this you'll need to wrap the `rustup` command in a login shell, like so:
22
+
To fix this, simply wrap the `rustup` command in a login Bash shell, like so:
20
23
21
24
```Dockerfile
22
25
RUN bash -cl "rustup toolchain install nightly"
@@ -38,83 +41,54 @@ Here are a few Rust example projects that are already automated with Gitpod:
38
41
|---------|------------|-----|
39
42
|[MathLang](https://github.com/JesterOrNot/mathlang)| Basic maths language in Rust |[](https://gitpod.io/#https://github.com/JesterOrNot/MathLang)|
40
43
|[NuShell](https://github.com/nushell/nushell/)| A next-gen shell for the GitHub era |[](https://gitpod.io/#https://github.com/nushell/nushell)|
41
-
|[Servo](https://github.com/servo/servo) | The Servo Browser Engine | [](https://gitpod.io/#https://github.com/servo/servo)
44
+
|[Servo](https://github.com/servo/servo)| The Servo Browser Engine |[](https://gitpod.io/#https://github.com/servo/servo)|
42
45
43
46
</div>
44
47
45
-
## Workspace Configuration
48
+
## VSCode Extensions
46
49
47
-
### VSCode Extensions
50
+
The most popular Rust VSCode extensions are already pre-installed in Gitpod. But here are a few "nice to have" extensions you may choose to install as well.
48
51
49
-
The most popular Rust VSCode extensions come prebuilt in Gitpod but here are some "nice to have" extensions:
52
+
In order to install one of these extensions for your repository, simply head to Gitpod's [Extensions panel](/docs/vscode-extensions/) (find it in the IDE's left vertical menu), then search for the desired extension by name, and install it for your project. This will add an entry to your [.gitpod.yml](/docs/config-gitpod-file/) file that ensures all future Gitpod workspaces for your repository will already have this extension pre-installed.
50
53
51
-
####Rust Test Explorer
54
+
### Rust Test Explorer
52
55

53
56
<br>
54
57
<br>
55
-
The Rust Test Explorer makes it easy to run Rust tests. To install this extension to your repository, add the following to your [.gitpod.yml](https://www.gitpod.io/docs/41_config_gitpod_file/):
The Rust Test Explorer makes it easy to run Rust tests.
59
+
60
+
### Crates
63
61
> ***Note: This extension outputs emojis by default if the crate version is set at the latest. You can disable this by using `crates.upToDateDecorator` option in your preferences***
The VSCode extension Crates makes it easier to manage your Cargo dependency versions. To install this extension to your repository add the following to your [.gitpod.yml](https://www.gitpod.io/docs/41_config_gitpod_file/)
65
+
The VSCode extension Crates makes it easier to manage your Cargo dependency versions.

76
69
77
-
Do you have an idea of a library you want to use but don't know the version well just type in the name of the library and Search Crates.io will get the version. To install this extension to your repository add the following to your [.gitpod.yml](https://www.gitpod.io/docs/41_config_gitpod_file/)
Do you have an idea of a library you want to use but don't know the version well just type in the name of the library and Search Crates.io will get the version.
Better TOML adds syntax highlighting to your `Cargo.toml`. To install Better TOML to your repository, add the following to your [.gitpod.yml](https://www.gitpod.io/docs/config-gitpod-file/) file:
75
+
Better TOML adds syntax highlighting to your `Cargo.toml`.
TODO. See also [MUSL support for fully static binaries](https://doc.rust-lang.org/edition-guide/rust-2018/platform-and-target-support/musl-support-for-fully-static-binaries.html).
94
80
95
81
## Debugging
96
82
97
83
In this section we will show you how to configure your project for debugging in Gitpod.
98
84
99
-
First, before we get to that we need to get some prerequisites set-up first we'll add the needed extension
100
-
101
-
If you haven't added extensions to your repository already add the following snippet to your [.gitpod.yml](https://www.gitpod.io/docs/config-gitpod-file/) file:
85
+
First, before we get to that we need to get some prerequisites set-up.
First we'll install the needed extension. If you haven't already, head over to Gitpod's [Extensions panel](/docs/vscode-extensions/) (left vertical menu in the IDE) and search for an extension called `Native Debug` by webfreak. When you see it, click to install it for your project.
114
88
115
-
The last prerequisite is a docker configuration.
89
+
The next prerequisite is a Docker configuration.
116
90
117
-
If you already have a [.gitpod.Dockerfile](https://www.gitpod.io/docs/config-docker/) just add the following:
91
+
If you already have a [.gitpod.Dockerfile](/docs/config-docker/) just add the following:
118
92
119
93
```Dockerfile
120
94
RUN sudo apt-get -q update \
@@ -126,7 +100,7 @@ RUN sudo apt-get -q update \
126
100
ENV RUST_LLDB=/usr/bin/lldb-8
127
101
```
128
102
129
-
If not there are two steps first create a file called `.gitpod.Dockerfile` with the following content:
103
+
If not there are two steps. First, create a file called `.gitpod.Dockerfile` with the following content:
130
104
131
105
```Dockerfile
132
106
FROM gitpod/workspace-full
@@ -142,7 +116,7 @@ RUN sudo apt-get -q update \
142
116
ENV RUST_LLDB=/usr/bin/lldb-8
143
117
```
144
118
145
-
Next add the following to your [.gitpod.yml](https://www.gitpod.io/docs/config-gitpod-file/) file:
119
+
Next, add the following to your [.gitpod.yml](/docs/config-gitpod-file/) file:
0 commit comments