From 51baaf298d4ac56036062786bf070aeab7ab8e79 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 20 Nov 2019 13:09:21 +0300 Subject: Rename with_ast -> with_value --- crates/ra_ide_api/src/references/classify.rs | 32 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'crates/ra_ide_api/src/references') diff --git a/crates/ra_ide_api/src/references/classify.rs b/crates/ra_ide_api/src/references/classify.rs index 333264540..4a4b030f8 100644 --- a/crates/ra_ide_api/src/references/classify.rs +++ b/crates/ra_ide_api/src/references/classify.rs @@ -18,7 +18,7 @@ pub(crate) fn classify_name(db: &RootDatabase, name: Source<&ast::Name>) -> Opti match_ast! { match parent { ast::BindPat(it) => { - let src = name.with_ast(it); + let src = name.with_value(it); let local = hir::Local::from_source(db, src)?; Some(NameDefinition { visibility: None, @@ -28,7 +28,7 @@ pub(crate) fn classify_name(db: &RootDatabase, name: Source<&ast::Name>) -> Opti }, ast::RecordFieldDef(it) => { let ast = hir::FieldSource::Named(it); - let src = name.with_ast(ast); + let src = name.with_value(ast); let field = hir::StructField::from_source(db, src)?; Some(from_struct_field(db, field)) }, @@ -36,42 +36,42 @@ pub(crate) fn classify_name(db: &RootDatabase, name: Source<&ast::Name>) -> Opti let def = { if !it.has_semi() { let ast = hir::ModuleSource::Module(it); - let src = name.with_ast(ast); + let src = name.with_value(ast); hir::Module::from_definition(db, src) } else { - let src = name.with_ast(it); + let src = name.with_value(it); hir::Module::from_declaration(db, src) } }?; Some(from_module_def(db, def.into(), None)) }, ast::StructDef(it) => { - let src = name.with_ast(it); + let src = name.with_value(it); let def = hir::Struct::from_source(db, src)?; Some(from_module_def(db, def.into(), None)) }, ast::EnumDef(it) => { - let src = name.with_ast(it); + let src = name.with_value(it); let def = hir::Enum::from_source(db, src)?; Some(from_module_def(db, def.into(), None)) }, ast::TraitDef(it) => { - let src = name.with_ast(it); + let src = name.with_value(it); let def = hir::Trait::from_source(db, src)?; Some(from_module_def(db, def.into(), None)) }, ast::StaticDef(it) => { - let src = name.with_ast(it); + let src = name.with_value(it); let def = hir::Static::from_source(db, src)?; Some(from_module_def(db, def.into(), None)) }, ast::EnumVariant(it) => { - let src = name.with_ast(it); + let src = name.with_value(it); let def = hir::EnumVariant::from_source(db, src)?; Some(from_module_def(db, def.into(), None)) }, ast::FnDef(it) => { - let src = name.with_ast(it); + let src = name.with_value(it); let def = hir::Function::from_source(db, src)?; if parent.parent().and_then(ast::ItemList::cast).is_some() { Some(from_assoc_item(db, def.into())) @@ -80,7 +80,7 @@ pub(crate) fn classify_name(db: &RootDatabase, name: Source<&ast::Name>) -> Opti } }, ast::ConstDef(it) => { - let src = name.with_ast(it); + let src = name.with_value(it); let def = hir::Const::from_source(db, src)?; if parent.parent().and_then(ast::ItemList::cast).is_some() { Some(from_assoc_item(db, def.into())) @@ -89,7 +89,7 @@ pub(crate) fn classify_name(db: &RootDatabase, name: Source<&ast::Name>) -> Opti } }, ast::TypeAliasDef(it) => { - let src = name.with_ast(it); + let src = name.with_value(it); let def = hir::TypeAlias::from_source(db, src)?; if parent.parent().and_then(ast::ItemList::cast).is_some() { Some(from_assoc_item(db, def.into())) @@ -98,11 +98,11 @@ pub(crate) fn classify_name(db: &RootDatabase, name: Source<&ast::Name>) -> Opti } }, ast::MacroCall(it) => { - let src = name.with_ast(it); + let src = name.with_value(it); let def = hir::MacroDef::from_source(db, src.clone())?; let module_src = ModuleSource::from_child_node(db, src.as_ref().map(|it| it.syntax())); - let module = Module::from_definition(db, src.with_ast(module_src))?; + let module = Module::from_definition(db, src.with_value(module_src))?; Some(NameDefinition { visibility: None, @@ -149,9 +149,9 @@ pub(crate) fn classify_name_ref( } } - let ast = ModuleSource::from_child_node(db, name_ref.with_ast(&parent)); + let ast = ModuleSource::from_child_node(db, name_ref.with_value(&parent)); // FIXME: find correct container and visibility for each case - let container = Module::from_definition(db, name_ref.with_ast(ast))?; + let container = Module::from_definition(db, name_ref.with_value(ast))?; let visibility = None; if let Some(macro_call) = parent.ancestors().find_map(ast::MacroCall::cast) { -- cgit v1.2.3