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 /editors | |
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 'editors')
-rw-r--r-- | editors/code/package.json | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/editors/code/package.json b/editors/code/package.json index 06ed62d8d..fa5632f90 100644 --- a/editors/code/package.json +++ b/editors/code/package.json | |||
@@ -565,6 +565,11 @@ | |||
565 | }, | 565 | }, |
566 | "uniqueItems": true | 566 | "uniqueItems": true |
567 | }, | 567 | }, |
568 | "rust-analyzer.diagnostics.remapPrefix": { | ||
569 | "markdownDescription": "Map of prefixes to be substituted when parsing diagnostic file paths.\nThis should be the reverse mapping of what is passed to `rustc` as `--remap-path-prefix`.", | ||
570 | "default": {}, | ||
571 | "type": "object" | ||
572 | }, | ||
568 | "rust-analyzer.diagnostics.warningsAsHint": { | 573 | "rust-analyzer.diagnostics.warningsAsHint": { |
569 | "markdownDescription": "List of warnings that should be displayed with info severity.\n\nThe warnings will be indicated by a blue squiggly underline in code\nand a blue icon in the `Problems Panel`.", | 574 | "markdownDescription": "List of warnings that should be displayed with info severity.\n\nThe warnings will be indicated by a blue squiggly underline in code\nand a blue icon in the `Problems Panel`.", |
570 | "default": [], | 575 | "default": [], |
@@ -1195,4 +1200,4 @@ | |||
1195 | ] | 1200 | ] |
1196 | } | 1201 | } |
1197 | } | 1202 | } |
1198 | } \ No newline at end of file | 1203 | } |