Merge #326
326: resolved #324: remove unnecessary braces in use statement. r=matklad a=gfreezy Add inspection for unnecessary braces in use statement Co-authored-by: gfreezy <gfreezy@gmail.com>
This commit is contained in:
@@ -3,7 +3,7 @@ use std::{
|
||||
sync::Arc,
|
||||
};
|
||||
|
||||
use ra_editor::{self, find_node_at_offset, FileSymbol, LineIndex, LocalEdit};
|
||||
use ra_editor::{self, find_node_at_offset, FileSymbol, LineIndex, LocalEdit, Severity};
|
||||
use ra_syntax::{
|
||||
ast::{self, ArgListOwner, Expr, NameOwner, FnDef},
|
||||
algo::find_covering_node,
|
||||
@@ -365,6 +365,7 @@ impl AnalysisImpl {
|
||||
.map(|d| Diagnostic {
|
||||
range: d.range,
|
||||
message: d.msg,
|
||||
severity: d.severity,
|
||||
fix: None,
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
@@ -386,6 +387,7 @@ impl AnalysisImpl {
|
||||
Diagnostic {
|
||||
range: name_node.range(),
|
||||
message: "unresolved module".to_string(),
|
||||
severity: Severity::Error,
|
||||
fix: Some(fix),
|
||||
}
|
||||
}
|
||||
@@ -408,6 +410,7 @@ impl AnalysisImpl {
|
||||
Diagnostic {
|
||||
range: name_node.range(),
|
||||
message: "can't declare module at this location".to_string(),
|
||||
severity: Severity::Error,
|
||||
fix: Some(fix),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,11 +29,10 @@ use crate::{
|
||||
symbol_index::SymbolIndex,
|
||||
};
|
||||
|
||||
pub use crate::{
|
||||
completion::{CompletionItem, CompletionItemKind, InsertText},
|
||||
};
|
||||
pub use crate::completion::{CompletionItem, CompletionItemKind, InsertText};
|
||||
pub use ra_editor::{
|
||||
FileSymbol, Fold, FoldKind, HighlightedRange, LineIndex, Runnable, RunnableKind, StructureNode,
|
||||
Severity
|
||||
};
|
||||
pub use hir::FnSignatureInfo;
|
||||
|
||||
@@ -198,6 +197,7 @@ pub struct Diagnostic {
|
||||
pub message: String,
|
||||
pub range: TextRange,
|
||||
pub fix: Option<SourceChange>,
|
||||
pub severity: Severity,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use relative_path::{RelativePathBuf};
|
||||
use relative_path::RelativePathBuf;
|
||||
use test_utils::{extract_offset, parse_fixture, CURSOR_MARKER};
|
||||
use ra_db::mock::FileMap;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user