diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-11-11 16:21:55 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-11 16:21:55 +0000 |
commit | f742803c6a5a632af6e0aecb123920d1962e5fee (patch) | |
tree | 1b0f7c7b0f430d4174ca05e5464b3af98128bafe /crates/ra_ide_api/src/references | |
parent | a599147b4232c0d4f6b071a3a96e86f903f4cf52 (diff) | |
parent | c5a18c44e5211282c22b9ca7aae8700ee8ca1817 (diff) |
Merge #2213
2213: Hir generic param r=flodiebold a=matklad
r? @flodiebold
This should make the life of IDE easier: before, it got `GenericParam(u32)` which was of questionable utility. Now, it's a proper code_model type, so it can gain `source`, `name`, `module` and all the other hir methods, should the IDE need them. Moreover, IDE now doesn't care about internal representation of generic param, which seems like a long-term win.
The problem is, of course, that we now have to types named `GenericParam` in hir: this code_model type, and an internal type with an index which doesn't know about the parent. I think it's fine for the time being, but, after we finish cratefication of hir, this local `GenericParam` should move to `hir_def` or `hir_ty`, and *maybe* restrucured as `ParamId / PramData` pair.
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/references')
-rw-r--r-- | crates/ra_ide_api/src/references/name_definition.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_ide_api/src/references/name_definition.rs b/crates/ra_ide_api/src/references/name_definition.rs index 450f7ea9b..ccd75278a 100644 --- a/crates/ra_ide_api/src/references/name_definition.rs +++ b/crates/ra_ide_api/src/references/name_definition.rs | |||
@@ -4,7 +4,8 @@ | |||
4 | //! Note that the reference search is possible for not all of the classified items. | 4 | //! Note that the reference search is possible for not all of the classified items. |
5 | 5 | ||
6 | use hir::{ | 6 | use hir::{ |
7 | Adt, AssocItem, HasSource, Local, MacroDef, Module, ModuleDef, StructField, Ty, VariantDef, | 7 | Adt, AssocItem, GenericParam, HasSource, Local, MacroDef, Module, ModuleDef, StructField, Ty, |
8 | VariantDef, | ||
8 | }; | 9 | }; |
9 | use ra_syntax::{ast, ast::VisibilityOwner}; | 10 | use ra_syntax::{ast, ast::VisibilityOwner}; |
10 | 11 | ||
@@ -18,7 +19,7 @@ pub enum NameKind { | |||
18 | Def(ModuleDef), | 19 | Def(ModuleDef), |
19 | SelfType(Ty), | 20 | SelfType(Ty), |
20 | Local(Local), | 21 | Local(Local), |
21 | GenericParam(u32), | 22 | GenericParam(GenericParam), |
22 | } | 23 | } |
23 | 24 | ||
24 | #[derive(PartialEq, Eq)] | 25 | #[derive(PartialEq, Eq)] |