mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
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:
commit
b65ba8f1d6
7 changed files with 79 additions and 12 deletions
|
@ -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),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue