mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +00:00
feat: add unresolved-ident diagnostic
This commit is contained in:
parent
d818b531c9
commit
a492d9d164
12 changed files with 113 additions and 26 deletions
|
@ -87,6 +87,7 @@ diagnostics![
|
|||
UnresolvedMacroCall,
|
||||
UnresolvedMethodCall,
|
||||
UnresolvedModule,
|
||||
UnresolvedIdent,
|
||||
UnresolvedProcMacro,
|
||||
UnusedMut,
|
||||
UnusedVariable,
|
||||
|
@ -242,6 +243,11 @@ pub struct UnresolvedAssocItem {
|
|||
pub expr_or_pat: InFile<AstPtr<Either<ast::Expr, Either<ast::Pat, ast::SelfParam>>>>,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct UnresolvedIdent {
|
||||
pub expr: InFile<AstPtr<ast::Expr>>,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct PrivateField {
|
||||
pub expr: InFile<AstPtr<ast::Expr>>,
|
||||
|
@ -588,6 +594,10 @@ impl AnyDiagnostic {
|
|||
};
|
||||
UnresolvedAssocItem { expr_or_pat }.into()
|
||||
}
|
||||
&InferenceDiagnostic::UnresolvedIdent { expr } => {
|
||||
let expr = expr_syntax(expr);
|
||||
UnresolvedIdent { expr }.into()
|
||||
}
|
||||
&InferenceDiagnostic::BreakOutsideOfLoop { expr, is_break, bad_value_break } => {
|
||||
let expr = expr_syntax(expr);
|
||||
BreakOutsideOfLoop { expr, is_break, bad_value_break }.into()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue