diff options
author | Florian Diebold <[email protected]> | 2019-01-12 23:19:20 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-01-19 15:02:06 +0000 |
commit | 5862542dedd5aca9bbdcba19c5f8cd895591005d (patch) | |
tree | 58fb630e97583db371eed1111d2c067bde2982b4 /crates/ra_hir/src/code_model_impl | |
parent | 688a45e00b53412a7a16360c6d678a5d91a95789 (diff) |
Add AST/HIR for type args in path segments
Diffstat (limited to 'crates/ra_hir/src/code_model_impl')
-rw-r--r-- | crates/ra_hir/src/code_model_impl/module.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/crates/ra_hir/src/code_model_impl/module.rs b/crates/ra_hir/src/code_model_impl/module.rs index 7215236f9..2014f1090 100644 --- a/crates/ra_hir/src/code_model_impl/module.rs +++ b/crates/ra_hir/src/code_model_impl/module.rs | |||
@@ -147,7 +147,7 @@ impl Module { | |||
147 | .def_id, | 147 | .def_id, |
148 | ); | 148 | ); |
149 | 149 | ||
150 | for name in path.segments.iter() { | 150 | for segment in path.segments.iter() { |
151 | let curr = match curr_per_ns.as_ref().take_types() { | 151 | let curr = match curr_per_ns.as_ref().take_types() { |
152 | Some(r) => r, | 152 | Some(r) => r, |
153 | None => { | 153 | None => { |
@@ -163,15 +163,17 @@ impl Module { | |||
163 | curr_per_ns = match curr.resolve(db) { | 163 | curr_per_ns = match curr.resolve(db) { |
164 | Def::Module(m) => { | 164 | Def::Module(m) => { |
165 | let scope = m.scope(db); | 165 | let scope = m.scope(db); |
166 | match scope.get(&name) { | 166 | match scope.get(&segment.name) { |
167 | Some(r) => r.def_id, | 167 | Some(r) => r.def_id, |
168 | None => PerNs::none(), | 168 | None => PerNs::none(), |
169 | } | 169 | } |
170 | } | 170 | } |
171 | Def::Enum(e) => { | 171 | Def::Enum(e) => { |
172 | // enum variant | 172 | // enum variant |
173 | let matching_variant = | 173 | let matching_variant = e |
174 | e.variants(db).into_iter().find(|(n, _variant)| n == name); | 174 | .variants(db) |
175 | .into_iter() | ||
176 | .find(|(n, _variant)| n == &segment.name); | ||
175 | 177 | ||
176 | match matching_variant { | 178 | match matching_variant { |
177 | Some((_n, variant)) => PerNs::both(variant.def_id(), e.def_id()), | 179 | Some((_n, variant)) => PerNs::both(variant.def_id(), e.def_id()), |