diff options
| author | bors <bors@rust-lang.org> | 2022-05-12 11:05:21 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-05-12 11:05:21 +0000 |
| commit | 927ef0ce7ed557187738e6a2f99e22f0e4628d1c (patch) | |
| tree | f7fcda01eb6ac8d92575a1704f4b75ecbcbbfd92 /src/test/debuginfo/enum-thinlto.rs | |
| parent | 7a55863c3dfda75dd51d2940b737818ba2fa2fcc (diff) | |
| parent | 33d2c8a3f9530d193bb3563ae9d11d329e8a4c62 (diff) | |
| download | rust-927ef0ce7ed557187738e6a2f99e22f0e4628d1c.tar.gz rust-927ef0ce7ed557187738e6a2f99e22f0e4628d1c.zip | |
Auto merge of #12215 - listochkin:Support-variable-substitution-in-vscode-settings, r=Veykril
feat: Support variable substitution in VSCode settings
Currently support a subset of [variables provided by VSCode](https://code.visualstudio.com/docs/editor/variables-reference) in `server.extraEnv` section of Rust-Analyzer settings:
* `workspaceFolder`
* `workspaceFolderBasename`
* `cwd`
* `execPath`
* `pathSeparator`
Also, this PR adds support for general environment variables resolution. You can declare environment variables and reference them from other variables like this:
```JSON
"rust-analyzer.server.extraEnv": {
"RUSTFLAGS": "-L${env:OPEN_XR_SDK_PATH}",
"OPEN_XR_SDK_PATH": "${workspaceFolder}\\..\\OpenXR-SDK\\build\\src\\loader\\Release"
},
```
The order of variable declaration doesn't matter, you can reference variables before defining them. If the variable is not present in `extraEnv` section, VSCode will search for them in your environment. Missing variables will be replaced with empty string. Circular references won't be resolved and will be passed to rust-analyzer server process as is.
Closes #9626, but doesn't address use cases where people want to use values provided by `rustc` or `cargo`, such as `${targetTriple}` proposal #11649
Diffstat (limited to 'src/test/debuginfo/enum-thinlto.rs')
0 files changed, 0 insertions, 0 deletions
