diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-21 15:28:40 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-21 15:28:40 +0000 |
commit | 47a70aadcedbcf28ad6d1ea59b77bf0e11493de0 (patch) | |
tree | e5f494422dacc1a6bcae2b696d06f937b64d9163 /crates/ide_db/src | |
parent | 323138f32ea74cfe9f5381e9e170cf87e7592818 (diff) | |
parent | ec4a1dc297eb90dde4c22c682a35606aaa50b4d4 (diff) |
Merge #7375
7375: Add support for running name resolution in block expressions r=jonas-schievink a=jonas-schievink
This adds a `block_def_map` query that runs the name resolution algorithm on a block expression, and returns a `DefMap` that stores links to the parent `DefMap` (either the containing block or the crate-level `DefMap`). Blocks with no inner items return the parent's `DefMap` as-is, to avoid creating unnecessarily long `DefMap` chains.
Path resolution is updated to recurse into the parent `DefMap` after looking up a path in the original `DefMap`.
I've added a few new tests for this, but outside of those this isn't used yet.
bors r+
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/ide_db/src')
-rw-r--r-- | crates/ide_db/src/apply_change.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crates/ide_db/src/apply_change.rs b/crates/ide_db/src/apply_change.rs index c770a236b..9d9b6de7a 100644 --- a/crates/ide_db/src/apply_change.rs +++ b/crates/ide_db/src/apply_change.rs | |||
@@ -149,6 +149,7 @@ impl RootDatabase { | |||
149 | 149 | ||
150 | // DefDatabase | 150 | // DefDatabase |
151 | hir::db::ItemTreeQuery | 151 | hir::db::ItemTreeQuery |
152 | hir::db::BlockDefMapQuery | ||
152 | hir::db::CrateDefMapQueryQuery | 153 | hir::db::CrateDefMapQueryQuery |
153 | hir::db::StructDataQuery | 154 | hir::db::StructDataQuery |
154 | hir::db::UnionDataQuery | 155 | hir::db::UnionDataQuery |