aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-11-20 10:10:03 +0000
committerGitHub <[email protected]>2019-11-20 10:10:03 +0000
commit3d56e3d85516fe9061aea84571ac88c3322a687c (patch)
treebd923b623ffe43df04ef00e1f0662c00c0d919d1 /crates/ra_hir
parentfa50b16cb2309c0c4fcb4e90378993a1f3d2ffb6 (diff)
parent51baaf298d4ac56036062786bf070aeab7ab8e79 (diff)
Merge #2323
2323: Rename with_ast -> with_value r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/src/source_binder.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs
index 471b0b089..a1c1daacd 100644
--- a/crates/ra_hir/src/source_binder.rs
+++ b/crates/ra_hir/src/source_binder.rs
@@ -33,19 +33,19 @@ fn try_get_resolver_for_node(db: &impl HirDatabase, node: Source<&SyntaxNode>) -
33 match_ast! { 33 match_ast! {
34 match (node.value) { 34 match (node.value) {
35 ast::Module(it) => { 35 ast::Module(it) => {
36 let src = node.with_ast(it); 36 let src = node.with_value(it);
37 Some(crate::Module::from_declaration(db, src)?.resolver(db)) 37 Some(crate::Module::from_declaration(db, src)?.resolver(db))
38 }, 38 },
39 ast::SourceFile(it) => { 39 ast::SourceFile(it) => {
40 let src = node.with_ast(crate::ModuleSource::SourceFile(it)); 40 let src = node.with_value(crate::ModuleSource::SourceFile(it));
41 Some(crate::Module::from_definition(db, src)?.resolver(db)) 41 Some(crate::Module::from_definition(db, src)?.resolver(db))
42 }, 42 },
43 ast::StructDef(it) => { 43 ast::StructDef(it) => {
44 let src = node.with_ast(it); 44 let src = node.with_value(it);
45 Some(Struct::from_source(db, src)?.resolver(db)) 45 Some(Struct::from_source(db, src)?.resolver(db))
46 }, 46 },
47 ast::EnumDef(it) => { 47 ast::EnumDef(it) => {
48 let src = node.with_ast(it); 48 let src = node.with_value(it);
49 Some(Enum::from_source(db, src)?.resolver(db)) 49 Some(Enum::from_source(db, src)?.resolver(db))
50 }, 50 },
51 _ => match node.value.kind() { 51 _ => match node.value.kind() {
@@ -157,7 +157,7 @@ impl SourceAnalyzer {
157 let scopes = def.expr_scopes(db); 157 let scopes = def.expr_scopes(db);
158 let scope = match offset { 158 let scope = match offset {
159 None => scope_for(&scopes, &source_map, node), 159 None => scope_for(&scopes, &source_map, node),
160 Some(offset) => scope_for_offset(&scopes, &source_map, node.with_ast(offset)), 160 Some(offset) => scope_for_offset(&scopes, &source_map, node.with_value(offset)),
161 }; 161 };
162 let resolver = expr::resolver_for_scope(db, def, scope); 162 let resolver = expr::resolver_for_scope(db, def, scope);
163 SourceAnalyzer { 163 SourceAnalyzer {
@@ -173,7 +173,7 @@ impl SourceAnalyzer {
173 resolver: node 173 resolver: node
174 .value 174 .value
175 .ancestors() 175 .ancestors()
176 .find_map(|it| try_get_resolver_for_node(db, node.with_ast(&it))) 176 .find_map(|it| try_get_resolver_for_node(db, node.with_value(&it)))
177 .unwrap_or_default(), 177 .unwrap_or_default(),
178 body_owner: None, 178 body_owner: None,
179 body_source_map: None, 179 body_source_map: None,