Add rustdocs

This commit is contained in:
Kirill Bulatov 2020-08-11 15:08:55 +03:00
parent c8cad76d25
commit 37aa68f050
2 changed files with 4 additions and 1 deletions

View file

@ -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 {

View file

@ -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)>;
}