diff options
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 |