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

Commit

Permalink
Rust README and test project updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuxel committed Apr 22, 2019
1 parent d4d28c3 commit 2e02e45
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 34 deletions.
25 changes: 3 additions & 22 deletions containers/rust/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,12 @@
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'hello_world'",
"name": "Debug executable",
"cargo": {
"args": [
"build",
"--bin=hello_world",
"--package=hello_world",
"--manifest-path=test-project/Cargo.toml"
],
"filter": {
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}/test-project"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'hello_world'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=hello_world",
"--package=hello_world",
"--bin=hello_remote_world",
"--package=hello_remote_world",
"--manifest-path=test-project/Cargo.toml"
],
"filter": {
Expand Down
37 changes: 28 additions & 9 deletions containers/rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,40 @@
| *Definition type* | Dockerfile |
| *Languages, platforms* | Rust |

## Usage
## Using this definition with an existing folder

[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.
This definition does require any special steps to use. Just follow these steps:

### Try it!
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.

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

1. Clone the vscode-dev-containers repository
2. Start VS Code and run **Remote-Container: Open Folder in Container...** and select this folder
3. Hit F5 or click on the Debug panel and start select "Debug executable 'hello world'"
4. The project will run and output "Hello, VS Code Remote!"
3. To use latest-and-greatest copy of this definition from the repository:
1. Clone this repository.
2. Copy the contents of `containers/rust/.devcontainer` to the root of your project folder.
3. Start VS Code and open your project folder.

4. After following step 2 or 3, the contents of the `.devcontainer` folder in your project can be adapted to meet your needs.

5. Finally, press <kbd>F1</kbd> and run **Remote-Containers: Reopen Folder in Container** to start using the definition.

## Testing the definition

This definition includes some test code that will help you verify it is working as expected on your system. Follow these steps:

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.
2. Clone this repository.
3. Start VS Code, press <kbd>F1</kbd>, and select **Remote-Containers: Open Folder in Container...**
4. Select the `containers/rust` folder.
5. After the folder has opened in the container, press <kbd>F5</kbd> to start the project.
6. You should see "Hello, VS Code Remote - Containers!" in the Debug Console after the program executes.
7. From here, you can add breakpoints or edit the contents of the `test-project` folder to do further testing.

## License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License. See [LICENSE](../../LICENSE).
Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE).
2 changes: 1 addition & 1 deletion containers/rust/test-project/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion containers/rust/test-project/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[package]
name = "hello_world"
name = "hello_remote_world"
version = "0.1.0"
authors = ["VS Code <vscode@microsoft.com>"]
2 changes: 1 addition & 1 deletion containers/rust/test-project/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@


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

0 comments on commit 2e02e45

Please sign in to comment.