From 98718e0544f42e55642d2838b00d6a7bef1e2414 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Fri, 15 Jan 2021 21:07:38 +0100 Subject: Wrap remaining self/super/crate in Name{Ref} --- crates/ide_db/src/defs.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'crates/ide_db/src') diff --git a/crates/ide_db/src/defs.rs b/crates/ide_db/src/defs.rs index 231e886a9..d9875ffef 100644 --- a/crates/ide_db/src/defs.rs +++ b/crates/ide_db/src/defs.rs @@ -117,13 +117,6 @@ impl NameClass { } } - pub fn classify_self_param( - sema: &Semantics, - self_param: &ast::SelfParam, - ) -> Option { - sema.to_def(self_param).map(Definition::Local).map(NameClass::Definition) - } - pub fn classify(sema: &Semantics, name: &ast::Name) -> Option { let _p = profile::span("classify_name"); @@ -186,6 +179,10 @@ impl NameClass { Some(NameClass::Definition(Definition::Local(local))) }, + ast::SelfParam(it) => { + let def = sema.to_def(&it)?; + Some(NameClass::Definition(Definition::Local(def.into()))) + }, ast::RecordField(it) => { let field: hir::Field = sema.to_def(&it)?; Some(NameClass::Definition(Definition::Field(field))) -- cgit v1.2.3