aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2020-08-11 13:08:55 +0100
committerKirill Bulatov <[email protected]>2020-08-11 13:09:08 +0100
commit37aa68f050fae0079db7b6ebd81bacea4441fb7e (patch)
treeff7ea3a8fdd8d15bf3603048a20e0b9e222c6451 /crates/ra_ide
parentc8cad76d25f7fab856c9646b70122e0f9f7d7218 (diff)
Add rustdocs
Diffstat (limited to 'crates/ra_ide')
-rw-r--r--crates/ra_ide/src/diagnostics/diagnostics_with_fix.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/ra_ide/src/diagnostics/diagnostics_with_fix.rs b/crates/ra_ide/src/diagnostics/diagnostics_with_fix.rs
index 56d454ac6..1955e1521 100644
--- a/crates/ra_ide/src/diagnostics/diagnostics_with_fix.rs
+++ b/crates/ra_ide/src/diagnostics/diagnostics_with_fix.rs
@@ -1,3 +1,4 @@
1//! Provides a way to derive fixes based on the diagnostic data.
1use crate::Fix; 2use crate::Fix;
2use ast::{edit::IndentLevel, make}; 3use ast::{edit::IndentLevel, make};
3use hir::{ 4use hir::{
@@ -13,8 +14,9 @@ use ra_ide_db::{
13use ra_syntax::{algo, ast, AstNode, TextRange}; 14use ra_syntax::{algo, ast, AstNode, TextRange};
14use ra_text_edit::{TextEdit, TextEditBuilder}; 15use ra_text_edit::{TextEdit, TextEditBuilder};
15 16
16// TODO kb 17/// A trait to implement fot the Diagnostic that has a fix available.
17pub trait DiagnosticWithFix { 18pub trait DiagnosticWithFix {
19 /// Provides a fix with the fix range, if applicable in the current semantics.
18 fn fix(&self, sema: &Semantics<RootDatabase>) -> Option<(Fix, TextRange)>; 20 fn fix(&self, sema: &Semantics<RootDatabase>) -> Option<(Fix, TextRange)>;
19} 21}
20 22