From 37aa68f050fae0079db7b6ebd81bacea4441fb7e Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Tue, 11 Aug 2020 15:08:55 +0300 Subject: Add rustdocs --- crates/ra_ide/src/diagnostics/diagnostics_with_fix.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crates/ra_ide') 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 @@ +//! Provides a way to derive fixes based on the diagnostic data. use crate::Fix; use ast::{edit::IndentLevel, make}; use hir::{ @@ -13,8 +14,9 @@ use ra_ide_db::{ use ra_syntax::{algo, ast, AstNode, TextRange}; use ra_text_edit::{TextEdit, TextEditBuilder}; -// TODO kb +/// A trait to implement fot the Diagnostic that has a fix available. pub trait DiagnosticWithFix { + /// Provides a fix with the fix range, if applicable in the current semantics. fn fix(&self, sema: &Semantics) -> Option<(Fix, TextRange)>; } -- cgit v1.2.3