diff options
author | Kirill Bulatov <[email protected]> | 2021-05-03 15:08:09 +0100 |
---|---|---|
committer | Kirill Bulatov <[email protected]> | 2021-05-03 15:14:49 +0100 |
commit | e5cdcb8b124f5b7d59950429787e760e46388f72 (patch) | |
tree | 8740336ea373603a48542d911da6765645a02627 /crates/rust-analyzer/src/cli | |
parent | eb741e895f1a73420a401f2495c711afe37d9d19 (diff) |
Add a way to resolve certain assists
Diffstat (limited to 'crates/rust-analyzer/src/cli')
-rw-r--r-- | crates/rust-analyzer/src/cli/diagnostics.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/rust-analyzer/src/cli/diagnostics.rs b/crates/rust-analyzer/src/cli/diagnostics.rs index 74f784338..c33c8179c 100644 --- a/crates/rust-analyzer/src/cli/diagnostics.rs +++ b/crates/rust-analyzer/src/cli/diagnostics.rs | |||
@@ -7,7 +7,7 @@ use anyhow::anyhow; | |||
7 | use rustc_hash::FxHashSet; | 7 | use rustc_hash::FxHashSet; |
8 | 8 | ||
9 | use hir::{db::HirDatabase, Crate, Module}; | 9 | use hir::{db::HirDatabase, Crate, Module}; |
10 | use ide::{DiagnosticsConfig, Severity}; | 10 | use ide::{AssistResolveStrategy, DiagnosticsConfig, Severity}; |
11 | use ide_db::base_db::SourceDatabaseExt; | 11 | use ide_db::base_db::SourceDatabaseExt; |
12 | 12 | ||
13 | use crate::cli::{ | 13 | use crate::cli::{ |
@@ -57,8 +57,9 @@ pub fn diagnostics( | |||
57 | let crate_name = | 57 | let crate_name = |
58 | module.krate().display_name(db).as_deref().unwrap_or("unknown").to_string(); | 58 | module.krate().display_name(db).as_deref().unwrap_or("unknown").to_string(); |
59 | println!("processing crate: {}, module: {}", crate_name, _vfs.file_path(file_id)); | 59 | println!("processing crate: {}, module: {}", crate_name, _vfs.file_path(file_id)); |
60 | for diagnostic in | 60 | for diagnostic in analysis |
61 | analysis.diagnostics(&DiagnosticsConfig::default(), false, file_id).unwrap() | 61 | .diagnostics(&DiagnosticsConfig::default(), AssistResolveStrategy::None, file_id) |
62 | .unwrap() | ||
62 | { | 63 | { |
63 | if matches!(diagnostic.severity, Severity::Error) { | 64 | if matches!(diagnostic.severity, Severity::Error) { |
64 | found_error = true; | 65 | found_error = true; |