diff options
author | Aleksey Kladov <[email protected]> | 2019-11-20 06:40:36 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-11-20 06:42:30 +0000 |
commit | 36e3fc9d5413f7e6e17e82867aae1318645880a3 (patch) | |
tree | 166ee3c45f99611f7c20740c2a246f5b3bed41a3 /crates/ra_ide_api/src/references/classify.rs | |
parent | e975f6364cb3caf50467835afb0dafce887f51f0 (diff) |
Rename Source::ast -> Source::value
Diffstat (limited to 'crates/ra_ide_api/src/references/classify.rs')
-rw-r--r-- | crates/ra_ide_api/src/references/classify.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_ide_api/src/references/classify.rs b/crates/ra_ide_api/src/references/classify.rs index ea9d20e71..333264540 100644 --- a/crates/ra_ide_api/src/references/classify.rs +++ b/crates/ra_ide_api/src/references/classify.rs | |||
@@ -13,7 +13,7 @@ use crate::db::RootDatabase; | |||
13 | 13 | ||
14 | pub(crate) fn classify_name(db: &RootDatabase, name: Source<&ast::Name>) -> Option<NameDefinition> { | 14 | pub(crate) fn classify_name(db: &RootDatabase, name: Source<&ast::Name>) -> Option<NameDefinition> { |
15 | let _p = profile("classify_name"); | 15 | let _p = profile("classify_name"); |
16 | let parent = name.ast.syntax().parent()?; | 16 | let parent = name.value.syntax().parent()?; |
17 | 17 | ||
18 | match_ast! { | 18 | match_ast! { |
19 | match parent { | 19 | match parent { |
@@ -121,7 +121,7 @@ pub(crate) fn classify_name_ref( | |||
121 | ) -> Option<NameDefinition> { | 121 | ) -> Option<NameDefinition> { |
122 | let _p = profile("classify_name_ref"); | 122 | let _p = profile("classify_name_ref"); |
123 | 123 | ||
124 | let parent = name_ref.ast.syntax().parent()?; | 124 | let parent = name_ref.value.syntax().parent()?; |
125 | let analyzer = SourceAnalyzer::new(db, name_ref.map(|it| it.syntax()), None); | 125 | let analyzer = SourceAnalyzer::new(db, name_ref.map(|it| it.syntax()), None); |
126 | 126 | ||
127 | if let Some(method_call) = ast::MethodCallExpr::cast(parent.clone()) { | 127 | if let Some(method_call) = ast::MethodCallExpr::cast(parent.clone()) { |
@@ -142,7 +142,7 @@ pub(crate) fn classify_name_ref( | |||
142 | tested_by!(goto_definition_works_for_record_fields); | 142 | tested_by!(goto_definition_works_for_record_fields); |
143 | if let Some(record_lit) = record_field.syntax().ancestors().find_map(ast::RecordLit::cast) { | 143 | if let Some(record_lit) = record_field.syntax().ancestors().find_map(ast::RecordLit::cast) { |
144 | let variant_def = analyzer.resolve_record_literal(&record_lit)?; | 144 | let variant_def = analyzer.resolve_record_literal(&record_lit)?; |
145 | let hir_path = Path::from_name_ref(name_ref.ast); | 145 | let hir_path = Path::from_name_ref(name_ref.value); |
146 | let hir_name = hir_path.as_ident()?; | 146 | let hir_name = hir_path.as_ident()?; |
147 | let field = variant_def.field(db, hir_name)?; | 147 | let field = variant_def.field(db, hir_name)?; |
148 | return Some(from_struct_field(db, field)); | 148 | return Some(from_struct_field(db, field)); |
@@ -162,7 +162,7 @@ pub(crate) fn classify_name_ref( | |||
162 | } | 162 | } |
163 | } | 163 | } |
164 | 164 | ||
165 | let path = name_ref.ast.syntax().ancestors().find_map(ast::Path::cast)?; | 165 | let path = name_ref.value.syntax().ancestors().find_map(ast::Path::cast)?; |
166 | let resolved = analyzer.resolve_path(db, &path)?; | 166 | let resolved = analyzer.resolve_path(db, &path)?; |
167 | match resolved { | 167 | match resolved { |
168 | PathResolution::Def(def) => Some(from_module_def(db, def, Some(container))), | 168 | PathResolution::Def(def) => Some(from_module_def(db, def, Some(container))), |