mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Merge #8624
8624: Automatically detect rust library source file map r=vsrs a=vsrs This PR adds a new possible `rust-analyzer.debug.sourceFileMap` value: ```json { "rust-analyzer.debug.sourceFileMap": "auto" } ``` I did not make it the default because it uses two shell calls (`rustc --print sysroot` and `rustc -V -v`). First one can be slow (https://github.com/rust-lang/rustup/issues/783) Fixes #8619 Co-authored-by: vsrs <vit@conrlab.com>
This commit is contained in:
commit
fb45d2adec
5 changed files with 60 additions and 8 deletions
|
@ -135,8 +135,12 @@ export class Config {
|
|||
}
|
||||
|
||||
get debug() {
|
||||
// "/rustc/<id>" used by suggestions only.
|
||||
const { ["/rustc/<id>"]: _, ...sourceFileMap } = this.get<Record<string, string>>("debug.sourceFileMap");
|
||||
let sourceFileMap = this.get<Record<string, string> | "auto">("debug.sourceFileMap");
|
||||
if (sourceFileMap !== "auto") {
|
||||
// "/rustc/<id>" used by suggestions only.
|
||||
const { ["/rustc/<id>"]: _, ...trimmed } = this.get<Record<string, string>>("debug.sourceFileMap");
|
||||
sourceFileMap = trimmed;
|
||||
}
|
||||
|
||||
return {
|
||||
engine: this.get<string>("debug.engine"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue