]> git.lizzy.rs Git - rust.git/commitdiff
Merge #8595
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Wed, 21 Apr 2021 23:54:47 +0000 (23:54 +0000)
committerGitHub <noreply@github.com>
Wed, 21 Apr 2021 23:54:47 +0000 (23:54 +0000)
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>

Trivial merge