diff options
author | Aleksey Kladov <[email protected]> | 2019-11-28 09:50:26 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-11-28 09:50:26 +0000 |
commit | ccd1b0800a5de5e046e6e9a4b6f49030c1ce3639 (patch) | |
tree | e878f88aebf11c0e54eff2e107dfaa4d192ab272 /crates/ra_ide/src/expand_macro.rs | |
parent | 2702fa1c5d6d8ad504c0d7703b6363ea09ba5570 (diff) |
Rename Source -> InFile
Diffstat (limited to 'crates/ra_ide/src/expand_macro.rs')
-rw-r--r-- | crates/ra_ide/src/expand_macro.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_ide/src/expand_macro.rs b/crates/ra_ide/src/expand_macro.rs index abc602244..862c03304 100644 --- a/crates/ra_ide/src/expand_macro.rs +++ b/crates/ra_ide/src/expand_macro.rs | |||
@@ -22,7 +22,7 @@ pub(crate) fn expand_macro(db: &RootDatabase, position: FilePosition) -> Option< | |||
22 | let name_ref = find_node_at_offset::<ast::NameRef>(file.syntax(), position.offset)?; | 22 | let name_ref = find_node_at_offset::<ast::NameRef>(file.syntax(), position.offset)?; |
23 | let mac = name_ref.syntax().ancestors().find_map(ast::MacroCall::cast)?; | 23 | let mac = name_ref.syntax().ancestors().find_map(ast::MacroCall::cast)?; |
24 | 24 | ||
25 | let source = hir::Source::new(position.file_id.into(), mac.syntax()); | 25 | let source = hir::InFile::new(position.file_id.into(), mac.syntax()); |
26 | let expanded = expand_macro_recur(db, source, source.with_value(&mac))?; | 26 | let expanded = expand_macro_recur(db, source, source.with_value(&mac))?; |
27 | 27 | ||
28 | // FIXME: | 28 | // FIXME: |
@@ -34,8 +34,8 @@ pub(crate) fn expand_macro(db: &RootDatabase, position: FilePosition) -> Option< | |||
34 | 34 | ||
35 | fn expand_macro_recur( | 35 | fn expand_macro_recur( |
36 | db: &RootDatabase, | 36 | db: &RootDatabase, |
37 | source: hir::Source<&SyntaxNode>, | 37 | source: hir::InFile<&SyntaxNode>, |
38 | macro_call: hir::Source<&ast::MacroCall>, | 38 | macro_call: hir::InFile<&ast::MacroCall>, |
39 | ) -> Option<SyntaxNode> { | 39 | ) -> Option<SyntaxNode> { |
40 | let analyzer = hir::SourceAnalyzer::new(db, source, None); | 40 | let analyzer = hir::SourceAnalyzer::new(db, source, None); |
41 | let expansion = analyzer.expand(db, macro_call)?; | 41 | let expansion = analyzer.expand(db, macro_call)?; |
@@ -46,7 +46,7 @@ fn expand_macro_recur( | |||
46 | let mut replaces = FxHashMap::default(); | 46 | let mut replaces = FxHashMap::default(); |
47 | 47 | ||
48 | for child in children.into_iter() { | 48 | for child in children.into_iter() { |
49 | let node = hir::Source::new(macro_file_id, &child); | 49 | let node = hir::InFile::new(macro_file_id, &child); |
50 | if let Some(new_node) = expand_macro_recur(db, source, node) { | 50 | if let Some(new_node) = expand_macro_recur(db, source, node) { |
51 | // Replace the whole node if it is root | 51 | // Replace the whole node if it is root |
52 | // `replace_descendants` will not replace the parent node | 52 | // `replace_descendants` will not replace the parent node |