You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 <rickvanprim@gmail.com>
Copy file name to clipboardExpand all lines: editors/code/package.json
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -565,6 +565,11 @@
565
565
},
566
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
573
"rust-analyzer.diagnostics.warningsAsHint": {
569
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`.",
0 commit comments