diff options
author | Aleksey Kladov <[email protected]> | 2018-11-27 23:25:03 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-11-27 23:25:03 +0000 |
commit | ec45dfea1e37ba40ea3e2c8c6df0991a3d49213f (patch) | |
tree | d3538aa9f79e8145a246656a48c96ed63777171a /crates/ra_analysis/src/hir | |
parent | 65c064b2a99fb9c0589672ae6c9848aaa9e0efcf (diff) |
rename file_syntax -> source_file
Diffstat (limited to 'crates/ra_analysis/src/hir')
-rw-r--r-- | crates/ra_analysis/src/hir/module/mod.rs | 4 | ||||
-rw-r--r-- | crates/ra_analysis/src/hir/query_definitions.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_analysis/src/hir/module/mod.rs b/crates/ra_analysis/src/hir/module/mod.rs index a6b7a5466..83f176b32 100644 --- a/crates/ra_analysis/src/hir/module/mod.rs +++ b/crates/ra_analysis/src/hir/module/mod.rs | |||
@@ -49,7 +49,7 @@ impl Module { | |||
49 | db: &impl HirDatabase, | 49 | db: &impl HirDatabase, |
50 | position: FilePosition, | 50 | position: FilePosition, |
51 | ) -> Cancelable<Option<Module>> { | 51 | ) -> Cancelable<Option<Module>> { |
52 | let file = db.file_syntax(position.file_id); | 52 | let file = db.source_file(position.file_id); |
53 | let module_source = match find_node_at_offset::<ast::Module>(file.syntax(), position.offset) | 53 | let module_source = match find_node_at_offset::<ast::Module>(file.syntax(), position.offset) |
54 | { | 54 | { |
55 | Some(m) if !m.has_semi() => ModuleSource::new_inline(db, position.file_id, m), | 55 | Some(m) if !m.has_semi() => ModuleSource::new_inline(db, position.file_id, m), |
@@ -346,7 +346,7 @@ impl ModuleSource { | |||
346 | pub(crate) fn resolve(self, db: &impl HirDatabase) -> ModuleSourceNode { | 346 | pub(crate) fn resolve(self, db: &impl HirDatabase) -> ModuleSourceNode { |
347 | match self { | 347 | match self { |
348 | ModuleSource::SourceFile(file_id) => { | 348 | ModuleSource::SourceFile(file_id) => { |
349 | let syntax = db.file_syntax(file_id); | 349 | let syntax = db.source_file(file_id); |
350 | ModuleSourceNode::SourceFile(syntax.ast().owned()) | 350 | ModuleSourceNode::SourceFile(syntax.ast().owned()) |
351 | } | 351 | } |
352 | ModuleSource::Module(item_id) => { | 352 | ModuleSource::Module(item_id) => { |
diff --git a/crates/ra_analysis/src/hir/query_definitions.rs b/crates/ra_analysis/src/hir/query_definitions.rs index 6c633e9ab..e7fba5d72 100644 --- a/crates/ra_analysis/src/hir/query_definitions.rs +++ b/crates/ra_analysis/src/hir/query_definitions.rs | |||
@@ -38,7 +38,7 @@ pub(super) fn fn_scopes(db: &impl HirDatabase, fn_id: FnId) -> Arc<FnScopes> { | |||
38 | } | 38 | } |
39 | 39 | ||
40 | pub(super) fn file_items(db: &impl HirDatabase, file_id: FileId) -> Arc<SourceFileItems> { | 40 | pub(super) fn file_items(db: &impl HirDatabase, file_id: FileId) -> Arc<SourceFileItems> { |
41 | let source_file = db.file_syntax(file_id); | 41 | let source_file = db.source_file(file_id); |
42 | let source_file = source_file.borrowed(); | 42 | let source_file = source_file.borrowed(); |
43 | let mut res = SourceFileItems::default(); | 43 | let mut res = SourceFileItems::default(); |
44 | source_file | 44 | source_file |