aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2020-08-10 22:37:23 +0100
committerKirill Bulatov <[email protected]>2020-08-11 13:09:08 +0100
commit29fbc8e02180aac1f4d7819a9626206aa64028a0 (patch)
treeed97a21451cdb34a33ac984c7df035a5c29ca25e /crates/ra_hir_def/src
parent936861993935d5b2c78b953e2f4b719e1992bd73 (diff)
Move the DiagnosticsWithFix trait on the ide level
Diffstat (limited to 'crates/ra_hir_def/src')
-rw-r--r--crates/ra_hir_def/src/diagnostics.rs10
1 files changed, 1 insertions, 9 deletions
diff --git a/crates/ra_hir_def/src/diagnostics.rs b/crates/ra_hir_def/src/diagnostics.rs
index 033be683c..9435c7254 100644
--- a/crates/ra_hir_def/src/diagnostics.rs
+++ b/crates/ra_hir_def/src/diagnostics.rs
@@ -2,7 +2,7 @@
2 2
3use std::any::Any; 3use std::any::Any;
4 4
5use hir_expand::diagnostics::{Diagnostic, DiagnosticWithFix}; 5use hir_expand::diagnostics::Diagnostic;
6use ra_syntax::{ast, AstPtr, SyntaxNodePtr}; 6use ra_syntax::{ast, AstPtr, SyntaxNodePtr};
7 7
8use hir_expand::{HirFileId, InFile}; 8use hir_expand::{HirFileId, InFile};
@@ -25,11 +25,3 @@ impl Diagnostic for UnresolvedModule {
25 self 25 self
26 } 26 }
27} 27}
28
29impl DiagnosticWithFix for UnresolvedModule {
30 type AST = ast::Module;
31 fn fix_source(&self, db: &dyn hir_expand::db::AstDatabase) -> Option<Self::AST> {
32 let root = db.parse_or_expand(self.file)?;
33 Some(self.decl.to_node(&root))
34 }
35}