VS Code problem matcher are restricted to be static "regexes". You can't
create a problem matcher dynamically, and you can't use custom code in
lieu of problem matcher.
This creates a problem for rust/cargo compiler errors. They use paths
relative to the root of the Cargo workspace, but VS Code doesn't
necessary know where that root is.
Luckily, there's a way out: our current problem matcher is defined like
this:
"fileLocation": [ "autoDetect", "${workspaceRoot}" ],
That means that relative pahts would be resoleved relative to workspace
root. VS Code allows to specify a command inside `${}`. So we can plug
custom logic there to fetch Cargo's workspace root!
And that's exactly what this PR is doing!
|
||
|---|---|---|
| .. | ||
| ast_inspector.ts | ||
| client.ts | ||
| commands.ts | ||
| config.ts | ||
| ctx.ts | ||
| debug.ts | ||
| lsp_ext.ts | ||
| main.ts | ||
| persistent_state.ts | ||
| run.ts | ||
| snippets.ts | ||
| tasks.ts | ||
| toolchain.ts | ||
| util.ts | ||