diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-27 21:41:35 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-04-27 21:41:35 +0100 |
commit | fb45d2adeccfc6732b702cd8fa2911b385bc15b7 (patch) | |
tree | 41ab22e69528ccb346bc01b913f9251a24925960 /editors/code/src/config.ts | |
parent | e2b87735cc4b54ca530e7a99070da585d480b1c3 (diff) | |
parent | 1b4197cb3520e4a71f118aac61a83bab1a6f5931 (diff) |
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 <[email protected]>
Diffstat (limited to 'editors/code/src/config.ts')
-rw-r--r-- | editors/code/src/config.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index 03f7d7cc3..e858f80bc 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts | |||
@@ -135,8 +135,12 @@ export class Config { | |||
135 | } | 135 | } |
136 | 136 | ||
137 | get debug() { | 137 | get debug() { |
138 | // "/rustc/<id>" used by suggestions only. | 138 | let sourceFileMap = this.get<Record<string, string> | "auto">("debug.sourceFileMap"); |
139 | const { ["/rustc/<id>"]: _, ...sourceFileMap } = this.get<Record<string, string>>("debug.sourceFileMap"); | 139 | if (sourceFileMap !== "auto") { |
140 | // "/rustc/<id>" used by suggestions only. | ||
141 | const { ["/rustc/<id>"]: _, ...trimmed } = this.get<Record<string, string>>("debug.sourceFileMap"); | ||
142 | sourceFileMap = trimmed; | ||
143 | } | ||
140 | 144 | ||
141 | return { | 145 | return { |
142 | engine: this.get<string>("debug.engine"), | 146 | engine: this.get<string>("debug.engine"), |