diff --git a/containers/rust/.vscode/launch.json b/containers/rust/.vscode/launch.json index 678d53a18f..f1ded7532f 100644 --- a/containers/rust/.vscode/launch.json +++ b/containers/rust/.vscode/launch.json @@ -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": { diff --git a/containers/rust/README.md b/containers/rust/README.md index 7491827d22..bd0df0d7be 100644 --- a/containers/rust/README.md +++ b/containers/rust/README.md @@ -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 F1 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 F1 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 F1, and select **Remote-Containers: Open Folder in Container...** +4. Select the `containers/rust` folder. +5. After the folder has opened in the container, press F5 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). \ No newline at end of file diff --git a/containers/rust/test-project/Cargo.lock b/containers/rust/test-project/Cargo.lock index 6086891478..a01e7044b1 100644 --- a/containers/rust/test-project/Cargo.lock +++ b/containers/rust/test-project/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. [[package]] -name = "hello_world" +name = "hello_remote_world" version = "0.1.0" diff --git a/containers/rust/test-project/Cargo.toml b/containers/rust/test-project/Cargo.toml index 8c6d626f2b..0595fdae0d 100644 --- a/containers/rust/test-project/Cargo.toml +++ b/containers/rust/test-project/Cargo.toml @@ -1,4 +1,4 @@ [package] -name = "hello_world" +name = "hello_remote_world" version = "0.1.0" authors = ["VS Code "] diff --git a/containers/rust/test-project/src/main.rs b/containers/rust/test-project/src/main.rs index 682859219f..5f6ffe1992 100644 --- a/containers/rust/test-project/src/main.rs +++ b/containers/rust/test-project/src/main.rs @@ -5,6 +5,6 @@ fn main() { - let name = "VS Code Remote"; + let name = "VS Code Remote - Containers"; println!("Hello, {}!", name); } \ No newline at end of file