From 37aa68f050fae0079db7b6ebd81bacea4441fb7e Mon Sep 17 00:00:00 2001
From: Kirill Bulatov <mail4score@gmail.com>
Date: Tue, 11 Aug 2020 15:08:55 +0300
Subject: [PATCH] Add rustdocs

---
 crates/ra_hir_expand/src/diagnostics.rs               | 1 +
 crates/ra_ide/src/diagnostics/diagnostics_with_fix.rs | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/crates/ra_hir_expand/src/diagnostics.rs b/crates/ra_hir_expand/src/diagnostics.rs
index e58defa681e..cc7dc3af22c 100644
--- a/crates/ra_hir_expand/src/diagnostics.rs
+++ b/crates/ra_hir_expand/src/diagnostics.rs
@@ -22,6 +22,7 @@ use crate::InFile;
 
 pub trait Diagnostic: Any + Send + Sync + fmt::Debug + 'static {
     fn message(&self) -> String;
+    /// A presentation source of the diagnostics, to use in highlighting and similar actions
     fn presentation(&self) -> InFile<SyntaxNodePtr>;
     fn as_any(&self) -> &(dyn Any + Send + 'static);
     fn is_experimental(&self) -> bool {
diff --git a/crates/ra_ide/src/diagnostics/diagnostics_with_fix.rs b/crates/ra_ide/src/diagnostics/diagnostics_with_fix.rs
index 56d454ac61f..1955e152106 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<RootDatabase>) -> Option<(Fix, TextRange)>;
 }