diff options
Diffstat (limited to 'crates/ra_hir/src/semantics.rs')
-rw-r--r-- | crates/ra_hir/src/semantics.rs | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/crates/ra_hir/src/semantics.rs b/crates/ra_hir/src/semantics.rs index c5bc2baff..e9f7a033c 100644 --- a/crates/ra_hir/src/semantics.rs +++ b/crates/ra_hir/src/semantics.rs | |||
@@ -8,7 +8,7 @@ use hir_def::{ | |||
8 | resolver::{self, HasResolver, Resolver}, | 8 | resolver::{self, HasResolver, Resolver}, |
9 | AsMacroCall, FunctionId, TraitId, VariantId, | 9 | AsMacroCall, FunctionId, TraitId, VariantId, |
10 | }; | 10 | }; |
11 | use hir_expand::{diagnostics::DiagnosticWithFix, hygiene::Hygiene, name::AsName, ExpansionInfo}; | 11 | use hir_expand::{hygiene::Hygiene, name::AsName, ExpansionInfo}; |
12 | use hir_ty::associated_type_shorthand_candidates; | 12 | use hir_ty::associated_type_shorthand_candidates; |
13 | use itertools::Itertools; | 13 | use itertools::Itertools; |
14 | use ra_db::{FileId, FileRange}; | 14 | use ra_db::{FileId, FileRange}; |
@@ -109,14 +109,8 @@ impl<'db, DB: HirDatabase> Semantics<'db, DB> { | |||
109 | self.imp.parse(file_id) | 109 | self.imp.parse(file_id) |
110 | } | 110 | } |
111 | 111 | ||
112 | pub fn diagnostic_fix_source<T: DiagnosticWithFix + Diagnostic>( | 112 | pub fn cache(&self, root_node: SyntaxNode, file_id: HirFileId) { |
113 | &self, | 113 | self.imp.cache(root_node, file_id) |
114 | d: &T, | ||
115 | ) -> Option<<T as DiagnosticWithFix>::AST> { | ||
116 | let file_id = d.presentation().file_id; | ||
117 | let root = self.db.parse_or_expand(file_id)?; | ||
118 | self.imp.cache(root, file_id); | ||
119 | d.fix_source(self.db.upcast()) | ||
120 | } | 114 | } |
121 | 115 | ||
122 | pub fn expand(&self, macro_call: &ast::MacroCall) -> Option<SyntaxNode> { | 116 | pub fn expand(&self, macro_call: &ast::MacroCall) -> Option<SyntaxNode> { |