From 0866b1be894b9148cf69897a1e1aa70e3c416e29 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 18 Aug 2020 16:03:15 +0200 Subject: Align diagnostics config with the rest of rust-analyzer --- crates/ide/src/lib.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'crates/ide/src/lib.rs') diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs index 4b797f374..2a73abba2 100644 --- a/crates/ide/src/lib.rs +++ b/crates/ide/src/lib.rs @@ -44,7 +44,7 @@ mod syntax_highlighting; mod syntax_tree; mod typing; -use std::{collections::HashSet, sync::Arc}; +use std::sync::Arc; use base_db::{ salsa::{self, ParallelDatabase}, @@ -65,7 +65,7 @@ pub use crate::{ completion::{ CompletionConfig, CompletionItem, CompletionItemKind, CompletionScore, InsertTextFormat, }, - diagnostics::Severity, + diagnostics::{DiagnosticsConfig, Severity}, display::NavigationTarget, expand_macro::ExpandedMacro, file_structure::StructureNode, @@ -148,7 +148,7 @@ pub struct AnalysisHost { } impl AnalysisHost { - pub fn new(lru_capacity: Option) -> Self { + pub fn new(lru_capacity: Option) -> AnalysisHost { AnalysisHost { db: RootDatabase::new(lru_capacity) } } @@ -495,13 +495,10 @@ impl Analysis { /// Computes the set of diagnostics for the given file. pub fn diagnostics( &self, + config: &DiagnosticsConfig, file_id: FileId, - enable_experimental: bool, - disabled_diagnostics: Option>, ) -> Cancelable> { - self.with_db(|db| { - diagnostics::diagnostics(db, file_id, enable_experimental, disabled_diagnostics) - }) + self.with_db(|db| diagnostics::diagnostics(db, config, file_id)) } /// Returns the edit required to rename reference at the position to the new -- cgit v1.2.3