Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Commit 2e02e45

Browse files
committed
Rust README and test project updates
1 parent d4d28c3 commit 2e02e45

File tree

5 files changed

+34
-34
lines changed

5 files changed

+34
-34
lines changed

containers/rust/.vscode/launch.json

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,12 @@
77
{
88
"type": "lldb",
99
"request": "launch",
10-
"name": "Debug executable 'hello_world'",
10+
"name": "Debug executable",
1111
"cargo": {
1212
"args": [
1313
"build",
14-
"--bin=hello_world",
15-
"--package=hello_world",
16-
"--manifest-path=test-project/Cargo.toml"
17-
],
18-
"filter": {
19-
"kind": "bin"
20-
}
21-
},
22-
"args": [],
23-
"cwd": "${workspaceFolder}/test-project"
24-
},
25-
{
26-
"type": "lldb",
27-
"request": "launch",
28-
"name": "Debug unit tests in executable 'hello_world'",
29-
"cargo": {
30-
"args": [
31-
"test",
32-
"--no-run",
33-
"--bin=hello_world",
34-
"--package=hello_world",
14+
"--bin=hello_remote_world",
15+
"--package=hello_remote_world",
3516
"--manifest-path=test-project/Cargo.toml"
3617
],
3718
"filter": {

containers/rust/README.md

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,40 @@
1010
| *Definition type* | Dockerfile |
1111
| *Languages, platforms* | Rust |
1212

13-
## Usage
13+
## Using this definition with an existing folder
1414

15-
[See here for information on adding it to your project.](../../README.md#using-a-definition). There is no extra steps to using this dev container.
15+
This definition does require any special steps to use. Just follow these steps:
1616

17-
### Try it!
17+
1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.
1818

19-
Just follow these steps to try out the test project:
19+
2. To use VS Code's copy of this definition:
20+
1. Start VS Code and open your project folder.
21+
2. Press <kbd>F1</kbd> select and **Remote-Containers: Create Container Configuration File...** from the command palette.
22+
3. Select the Rust definition.
2023

21-
1. Clone the vscode-dev-containers repository
22-
2. Start VS Code and run **Remote-Container: Open Folder in Container...** and select this folder
23-
3. Hit F5 or click on the Debug panel and start select "Debug executable 'hello world'"
24-
4. The project will run and output "Hello, VS Code Remote!"
24+
3. To use latest-and-greatest copy of this definition from the repository:
25+
1. Clone this repository.
26+
2. Copy the contents of `containers/rust/.devcontainer` to the root of your project folder.
27+
3. Start VS Code and open your project folder.
28+
29+
4. After following step 2 or 3, the contents of the `.devcontainer` folder in your project can be adapted to meet your needs.
30+
31+
5. Finally, press <kbd>F1</kbd> and run **Remote-Containers: Reopen Folder in Container** to start using the definition.
32+
33+
## Testing the definition
34+
35+
This definition includes some test code that will help you verify it is working as expected on your system. Follow these steps:
36+
37+
1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine.
38+
2. Clone this repository.
39+
3. Start VS Code, press <kbd>F1</kbd>, and select **Remote-Containers: Open Folder in Container...**
40+
4. Select the `containers/rust` folder.
41+
5. After the folder has opened in the container, press <kbd>F5</kbd> to start the project.
42+
6. You should see "Hello, VS Code Remote - Containers!" in the Debug Console after the program executes.
43+
7. From here, you can add breakpoints or edit the contents of the `test-project` folder to do further testing.
2544

2645
## License
2746

2847
Copyright (c) Microsoft Corporation. All rights reserved.
2948

30-
Licensed under the MIT License. See [LICENSE](../../LICENSE).
49+
Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE).

containers/rust/test-project/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[package]
2-
name = "hello_world"
2+
name = "hello_remote_world"
33
version = "0.1.0"
44
authors = ["VS Code <[email protected]>"]

containers/rust/test-project/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55

66

77
fn main() {
8-
let name = "VS Code Remote";
8+
let name = "VS Code Remote - Containers";
99
println!("Hello, {}!", name);
1010
}

0 commit comments

Comments
 (0)