mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Rename NomialDef -> AdtDef
This commit is contained in:
parent
3d28292157
commit
76202a2c73
5 changed files with 28 additions and 28 deletions
|
@ -23,7 +23,7 @@ pub(crate) fn goto_implementation(
|
|||
|
||||
let krate = sema.to_module_def(position.file_id)?.krate();
|
||||
|
||||
if let Some(nominal_def) = find_node_at_offset::<ast::NominalDef>(&syntax, position.offset) {
|
||||
if let Some(nominal_def) = find_node_at_offset::<ast::AdtDef>(&syntax, position.offset) {
|
||||
return Some(RangeInfo::new(
|
||||
nominal_def.syntax().text_range(),
|
||||
impls_for_def(&sema, &nominal_def, krate)?,
|
||||
|
@ -40,13 +40,13 @@ pub(crate) fn goto_implementation(
|
|||
|
||||
fn impls_for_def(
|
||||
sema: &Semantics<RootDatabase>,
|
||||
node: &ast::NominalDef,
|
||||
node: &ast::AdtDef,
|
||||
krate: Crate,
|
||||
) -> Option<Vec<NavigationTarget>> {
|
||||
let ty = match node {
|
||||
ast::NominalDef::StructDef(def) => sema.to_def(def)?.ty(sema.db),
|
||||
ast::NominalDef::EnumDef(def) => sema.to_def(def)?.ty(sema.db),
|
||||
ast::NominalDef::UnionDef(def) => sema.to_def(def)?.ty(sema.db),
|
||||
ast::AdtDef::StructDef(def) => sema.to_def(def)?.ty(sema.db),
|
||||
ast::AdtDef::EnumDef(def) => sema.to_def(def)?.ty(sema.db),
|
||||
ast::AdtDef::UnionDef(def) => sema.to_def(def)?.ty(sema.db),
|
||||
};
|
||||
|
||||
let impls = ImplDef::all_in_crate(sema.db, krate);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue