aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_expand/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_expand/src
parent936861993935d5b2c78b953e2f4b719e1992bd73 (diff)
Move the DiagnosticsWithFix trait on the ide level
Diffstat (limited to 'crates/ra_hir_expand/src')
-rw-r--r--crates/ra_hir_expand/src/diagnostics.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/crates/ra_hir_expand/src/diagnostics.rs b/crates/ra_hir_expand/src/diagnostics.rs
index 62a09a73a..8358c488b 100644
--- a/crates/ra_hir_expand/src/diagnostics.rs
+++ b/crates/ra_hir_expand/src/diagnostics.rs
@@ -18,7 +18,7 @@ use std::{any::Any, fmt};
18 18
19use ra_syntax::SyntaxNodePtr; 19use ra_syntax::SyntaxNodePtr;
20 20
21use crate::{db::AstDatabase, InFile}; 21use crate::InFile;
22 22
23pub trait Diagnostic: Any + Send + Sync + fmt::Debug + 'static { 23pub trait Diagnostic: Any + Send + Sync + fmt::Debug + 'static {
24 fn message(&self) -> String; 24 fn message(&self) -> String;
@@ -29,11 +29,6 @@ pub trait Diagnostic: Any + Send + Sync + fmt::Debug + 'static {
29 } 29 }
30} 30}
31 31
32pub trait DiagnosticWithFix {
33 type AST;
34 fn fix_source(&self, db: &dyn AstDatabase) -> Option<Self::AST>;
35}
36
37pub struct DiagnosticSink<'a> { 32pub struct DiagnosticSink<'a> {
38 callbacks: Vec<Box<dyn FnMut(&dyn Diagnostic) -> Result<(), ()> + 'a>>, 33 callbacks: Vec<Box<dyn FnMut(&dyn Diagnostic) -> Result<(), ()> + 'a>>,
39 filters: Vec<Box<dyn FnMut(&dyn Diagnostic) -> bool + 'a>>, 34 filters: Vec<Box<dyn FnMut(&dyn Diagnostic) -> bool + 'a>>,