diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-22 00:54:47 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-04-22 00:54:47 +0100 |
commit | 1f1a1ce4f57076be38d18f0a6defddb9c690bb1c (patch) | |
tree | c5859e4eb7334478b5e9ba58329b67df43e39305 /docs | |
parent | 32491c09787fa3b386d067f0ce95d744c1480e0b (diff) | |
parent | 72718bc2d7113874536b8bcd486aa5bd7dacafe6 (diff) |
Merge #8595
8595: Diagnostic paths support specifying `remapPrefix` r=rickvanprim a=rickvanprim
Currently VSCode Problem Matchers will resolve a path like `//foo_crate/src/main.rs` if `${workspaceFolder}/foo_crate/src/main.rs` exists. Presumably their behavior is functionally a string concatenation that would produce `${workspaceFolder///foo_crate/src/main.rs` and repeated path separators get ignored.
This PR attempts to mimic this behavior by stripping any `Component::RootDir` from `file_name` before joining it to `workspace_root`, and then checking if the file exists. If it does, this path is used, and if not, the behavior falls through to the existing Rust path join behavior.
Co-authored-by: James Leitch <[email protected]>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/user/generated_config.adoc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/user/generated_config.adoc b/docs/user/generated_config.adoc index e0ee35b4e..e28423e99 100644 --- a/docs/user/generated_config.adoc +++ b/docs/user/generated_config.adoc | |||
@@ -147,6 +147,12 @@ have more false positives than usual. | |||
147 | -- | 147 | -- |
148 | List of rust-analyzer diagnostics to disable. | 148 | List of rust-analyzer diagnostics to disable. |
149 | -- | 149 | -- |
150 | [[rust-analyzer.diagnostics.remapPrefix]]rust-analyzer.diagnostics.remapPrefix (default: `{}`):: | ||
151 | + | ||
152 | -- | ||
153 | Map of prefixes to be substituted when parsing diagnostic file paths. | ||
154 | This should be the reverse mapping of what is passed to `rustc` as `--remap-path-prefix`. | ||
155 | -- | ||
150 | [[rust-analyzer.diagnostics.warningsAsHint]]rust-analyzer.diagnostics.warningsAsHint (default: `[]`):: | 156 | [[rust-analyzer.diagnostics.warningsAsHint]]rust-analyzer.diagnostics.warningsAsHint (default: `[]`):: |
151 | + | 157 | + |
152 | -- | 158 | -- |