From 3cd4112bdc924c132cb0eab9d064511a215421ec Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 18:02:20 +0200 Subject: Finalize const&static grammar --- crates/ra_hir/src/semantics/source_to_def.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'crates/ra_hir/src/semantics') diff --git a/crates/ra_hir/src/semantics/source_to_def.rs b/crates/ra_hir/src/semantics/source_to_def.rs index b85a12680..782a03f9e 100644 --- a/crates/ra_hir/src/semantics/source_to_def.rs +++ b/crates/ra_hir/src/semantics/source_to_def.rs @@ -83,10 +83,10 @@ impl SourceToDefCtx<'_, '_> { pub(super) fn union_to_def(&mut self, src: InFile) -> Option { self.to_def(src, keys::UNION) } - pub(super) fn static_to_def(&mut self, src: InFile) -> Option { + pub(super) fn static_to_def(&mut self, src: InFile) -> Option { self.to_def(src, keys::STATIC) } - pub(super) fn const_to_def(&mut self, src: InFile) -> Option { + pub(super) fn const_to_def(&mut self, src: InFile) -> Option { self.to_def(src, keys::CONST) } pub(super) fn type_alias_to_def(&mut self, src: InFile) -> Option { @@ -178,11 +178,11 @@ impl SourceToDefCtx<'_, '_> { let def = self.union_to_def(container.with_value(it))?; VariantId::from(def).into() }, - ast::StaticDef(it) => { + ast::Static(it) => { let def = self.static_to_def(container.with_value(it))?; DefWithBodyId::from(def).into() }, - ast::ConstDef(it) => { + ast::Const(it) => { let def = self.const_to_def(container.with_value(it))?; DefWithBodyId::from(def).into() }, @@ -222,8 +222,8 @@ impl SourceToDefCtx<'_, '_> { for container in src.cloned().ancestors_with_macros(self.db.upcast()).skip(1) { let res: DefWithBodyId = match_ast! { match (container.value) { - ast::ConstDef(it) => self.const_to_def(container.with_value(it))?.into(), - ast::StaticDef(it) => self.static_to_def(container.with_value(it))?.into(), + ast::Const(it) => self.const_to_def(container.with_value(it))?.into(), + ast::Static(it) => self.static_to_def(container.with_value(it))?.into(), ast::Fn(it) => self.fn_to_def(container.with_value(it))?.into(), _ => continue, } -- cgit v1.2.3