Skip to content

Commit

Permalink
Improve VSCode instructions in CONTRIBUTING.md (#4560)
Browse files Browse the repository at this point in the history
Follow-up to #4486

---------

Co-authored-by: Robert Bastian <4706271+robertbastian@users.noreply.github.com>
  • Loading branch information
sffc and robertbastian authored Feb 22, 2024
1 parent 20d3f87 commit f4fe3c5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,21 @@ ICU4X can be edited using any text editor capable of editing Rust code.

Many ICU4X engineers use [Visual Studio Code](https://code.visualstudio.com/) with the [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) extension.

To build all code paths and improve build times in VSCode, we recommend the following settings. (Note: The second setting causes VSCode to build ICU4X with only the `und` locale, which reduces build times but also makes some tests fail; to run them normally, run `cargo test --all-features` on the command line.) To add these settings, choose "Preferences: Open Workspace Settings (JSON)" from the command palette (Ctrl+Shift+P):
To build all code paths and improve build times in VSCode, we recommend the following settings. To add them, choose "Preferences: Open Workspace Settings (JSON)" from the command palette (Ctrl+Shift+P):

```javascript
```json
"settings": {
"rust-analyzer.cargo.features": "all",
"rust-analyzer.cargo.extraEnv": {
// Path relative to `provider/baked/*/src/lib.rs`
"ICU4X_DATA_DIR": "../../../../provider/datagen/tests/data/baked"
"ICU4X_DATA_DIR": "../../../datagen/tests/data/baked"
}
}
```

Note: the path in `ICU4X_DATA_DIR` is relative to `provider/baked/*/src/lib.rs` and it causes VSCode to build ICU4X with only the `und` locale. This reduces build times but also makes some tests fail; to run them normally, run `cargo test --all-features` on the command line.

Note: you might also consider setting a custom value to the `CARGO_TARGET_DIR` environment variable so that VSCode writes to a different target directory than other programs or the command line.

## Contributing a Pull Request

The first step is to fork the repository to your namespace and create a branch off of the `main` branch to work with.
Expand Down

0 comments on commit f4fe3c5

Please sign in to comment.