diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-05-27 12:56:26 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-27 12:56:26 +0100 |
commit | d0a4ba294ccf0c925a5ff1115c19a60c6a24b734 (patch) | |
tree | 5caf7619e3486f68516d81971abc3018ddee5323 /crates/ide | |
parent | bfb06e17acd4bcb623ad5656490a7a1971980441 (diff) | |
parent | 196cb65ead398f81340de431400103224d7de660 (diff) |
Merge #8997
8997: internal: stop expanding UseTrees during ItemTree lowering r=jonas-schievink a=jonas-schievink
Closes https://github.com/rust-analyzer/rust-analyzer/issues/8908
Messy diff, but `ItemTree` lowering got simpler, since we now have a strict 1-to-1 mapping between `ast::Item` and `ModItem`.
The most messy part is mapping a single `UseTree` back to its `ast::UseTree` counterpart for diagnostics, but I think the ad-hoc source map built during lowering does the job.
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/ide')
-rw-r--r-- | crates/ide/src/diagnostics.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/ide/src/diagnostics.rs b/crates/ide/src/diagnostics.rs index dcac7c76d..6cf5810fa 100644 --- a/crates/ide/src/diagnostics.rs +++ b/crates/ide/src/diagnostics.rs | |||
@@ -311,6 +311,7 @@ mod tests { | |||
311 | /// * a diagnostic is produced | 311 | /// * a diagnostic is produced |
312 | /// * the first diagnostic fix trigger range touches the input cursor position | 312 | /// * the first diagnostic fix trigger range touches the input cursor position |
313 | /// * that the contents of the file containing the cursor match `after` after the diagnostic fix is applied | 313 | /// * that the contents of the file containing the cursor match `after` after the diagnostic fix is applied |
314 | #[track_caller] | ||
314 | pub(crate) fn check_fix(ra_fixture_before: &str, ra_fixture_after: &str) { | 315 | pub(crate) fn check_fix(ra_fixture_before: &str, ra_fixture_after: &str) { |
315 | check_nth_fix(0, ra_fixture_before, ra_fixture_after); | 316 | check_nth_fix(0, ra_fixture_before, ra_fixture_after); |
316 | } | 317 | } |
@@ -325,6 +326,7 @@ mod tests { | |||
325 | } | 326 | } |
326 | } | 327 | } |
327 | 328 | ||
329 | #[track_caller] | ||
328 | fn check_nth_fix(nth: usize, ra_fixture_before: &str, ra_fixture_after: &str) { | 330 | fn check_nth_fix(nth: usize, ra_fixture_before: &str, ra_fixture_after: &str) { |
329 | let after = trim_indent(ra_fixture_after); | 331 | let after = trim_indent(ra_fixture_after); |
330 | 332 | ||