diff options
author | Aleksey Kladov <[email protected]> | 2020-12-17 11:36:15 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-12-17 11:36:15 +0000 |
commit | 2ae31e34b1a345ceea23198a7e9e32e557cdbb4d (patch) | |
tree | b8849bc4765766dc43e92a12f52ab287680528f5 /crates/ide/src | |
parent | d641bccb0ffec543fa444ba523e8d4b63078fa53 (diff) |
Rename ImplDef -> Impl
We used to have `Def` suffix for all symbols, but we moved off from
that. `FunctionDef` isn't better than `Function`. Looks like we've
forgot to change `Impl` though!
Diffstat (limited to 'crates/ide/src')
-rw-r--r-- | crates/ide/src/display/navigation_target.rs | 2 | ||||
-rw-r--r-- | crates/ide/src/doc_links.rs | 2 | ||||
-rw-r--r-- | crates/ide/src/goto_implementation.rs | 6 | ||||
-rw-r--r-- | crates/ide/src/hover.rs | 2 | ||||
-rw-r--r-- | crates/ide/src/runnables.rs | 2 |
5 files changed, 7 insertions, 7 deletions
diff --git a/crates/ide/src/display/navigation_target.rs b/crates/ide/src/display/navigation_target.rs index ce0f4214c..54b33a98e 100644 --- a/crates/ide/src/display/navigation_target.rs +++ b/crates/ide/src/display/navigation_target.rs | |||
@@ -245,7 +245,7 @@ impl ToNav for hir::Module { | |||
245 | } | 245 | } |
246 | } | 246 | } |
247 | 247 | ||
248 | impl ToNav for hir::ImplDef { | 248 | impl ToNav for hir::Impl { |
249 | fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { | 249 | fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { |
250 | let src = self.source(db); | 250 | let src = self.source(db); |
251 | let derive_attr = self.is_builtin_derive(db); | 251 | let derive_attr = self.is_builtin_derive(db); |
diff --git a/crates/ide/src/doc_links.rs b/crates/ide/src/doc_links.rs index 2b5794a31..79c081cac 100644 --- a/crates/ide/src/doc_links.rs +++ b/crates/ide/src/doc_links.rs | |||
@@ -112,7 +112,7 @@ fn get_doc_link(db: &RootDatabase, definition: Definition) -> Option<String> { | |||
112 | .as_assoc_item(db) | 112 | .as_assoc_item(db) |
113 | .and_then(|assoc| match assoc.container(db) { | 113 | .and_then(|assoc| match assoc.container(db) { |
114 | AssocItemContainer::Trait(t) => Some(t.into()), | 114 | AssocItemContainer::Trait(t) => Some(t.into()), |
115 | AssocItemContainer::ImplDef(impld) => { | 115 | AssocItemContainer::Impl(impld) => { |
116 | impld.target_ty(db).as_adt().map(|adt| adt.into()) | 116 | impld.target_ty(db).as_adt().map(|adt| adt.into()) |
117 | } | 117 | } |
118 | }) | 118 | }) |
diff --git a/crates/ide/src/goto_implementation.rs b/crates/ide/src/goto_implementation.rs index 68c628d31..6eac39639 100644 --- a/crates/ide/src/goto_implementation.rs +++ b/crates/ide/src/goto_implementation.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use hir::{Crate, ImplDef, Semantics}; | 1 | use hir::{Crate, Impl, Semantics}; |
2 | use ide_db::RootDatabase; | 2 | use ide_db::RootDatabase; |
3 | use syntax::{algo::find_node_at_offset, ast, AstNode}; | 3 | use syntax::{algo::find_node_at_offset, ast, AstNode}; |
4 | 4 | ||
@@ -49,7 +49,7 @@ fn impls_for_def( | |||
49 | ast::AdtDef::Union(def) => sema.to_def(def)?.ty(sema.db), | 49 | ast::AdtDef::Union(def) => sema.to_def(def)?.ty(sema.db), |
50 | }; | 50 | }; |
51 | 51 | ||
52 | let impls = ImplDef::all_in_crate(sema.db, krate); | 52 | let impls = Impl::all_in_crate(sema.db, krate); |
53 | 53 | ||
54 | Some( | 54 | Some( |
55 | impls | 55 | impls |
@@ -67,7 +67,7 @@ fn impls_for_trait( | |||
67 | ) -> Option<Vec<NavigationTarget>> { | 67 | ) -> Option<Vec<NavigationTarget>> { |
68 | let tr = sema.to_def(node)?; | 68 | let tr = sema.to_def(node)?; |
69 | 69 | ||
70 | let impls = ImplDef::for_trait(sema.db, krate, tr); | 70 | let impls = Impl::for_trait(sema.db, krate, tr); |
71 | 71 | ||
72 | Some(impls.into_iter().map(|imp| imp.to_nav(sema.db)).collect()) | 72 | Some(impls.into_iter().map(|imp| imp.to_nav(sema.db)).collect()) |
73 | } | 73 | } |
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index a01b0c894..e82aad6d5 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs | |||
@@ -295,7 +295,7 @@ fn definition_owner_name(db: &RootDatabase, def: &Definition) -> Option<String> | |||
295 | Definition::ModuleDef(md) => match md { | 295 | Definition::ModuleDef(md) => match md { |
296 | ModuleDef::Function(f) => match f.as_assoc_item(db)?.container(db) { | 296 | ModuleDef::Function(f) => match f.as_assoc_item(db)?.container(db) { |
297 | AssocItemContainer::Trait(t) => Some(t.name(db)), | 297 | AssocItemContainer::Trait(t) => Some(t.name(db)), |
298 | AssocItemContainer::ImplDef(i) => i.target_ty(db).as_adt().map(|adt| adt.name(db)), | 298 | AssocItemContainer::Impl(i) => i.target_ty(db).as_adt().map(|adt| adt.name(db)), |
299 | }, | 299 | }, |
300 | ModuleDef::EnumVariant(e) => Some(e.parent_enum(db).name(db)), | 300 | ModuleDef::EnumVariant(e) => Some(e.parent_enum(db).name(db)), |
301 | _ => None, | 301 | _ => None, |
diff --git a/crates/ide/src/runnables.rs b/crates/ide/src/runnables.rs index 646f63704..96462a7b0 100644 --- a/crates/ide/src/runnables.rs +++ b/crates/ide/src/runnables.rs | |||
@@ -130,7 +130,7 @@ fn runnable_fn( | |||
130 | hir::AssocItemContainer::Trait(trait_item) => { | 130 | hir::AssocItemContainer::Trait(trait_item) => { |
131 | Some(trait_item.name(sema.db).to_string()) | 131 | Some(trait_item.name(sema.db).to_string()) |
132 | } | 132 | } |
133 | hir::AssocItemContainer::ImplDef(impl_def) => impl_def | 133 | hir::AssocItemContainer::Impl(impl_def) => impl_def |
134 | .target_ty(sema.db) | 134 | .target_ty(sema.db) |
135 | .as_adt() | 135 | .as_adt() |
136 | .map(|adt| adt.name(sema.db).to_string()), | 136 | .map(|adt| adt.name(sema.db).to_string()), |