aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/lib.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-08-18 15:12:00 +0100
committerGitHub <[email protected]>2020-08-18 15:12:00 +0100
commit0e66dc690e16f29248f8d00ca0d68e58a34b52d8 (patch)
treeb9ee153d4e66a670607e06c2ffb4cc579af49a16 /crates/ide/src/lib.rs
parenta3947129c5dc60cf051260c364833946f92e3350 (diff)
parent0866b1be894b9148cf69897a1e1aa70e3c416e29 (diff)
Merge #5796
5796: Align diagnostics config with the rest of rust-analyzer r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ide/src/lib.rs')
-rw-r--r--crates/ide/src/lib.rs13
1 files changed, 5 insertions, 8 deletions
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;
44mod syntax_tree; 44mod syntax_tree;
45mod typing; 45mod typing;
46 46
47use std::{collections::HashSet, sync::Arc}; 47use std::sync::Arc;
48 48
49use base_db::{ 49use base_db::{
50 salsa::{self, ParallelDatabase}, 50 salsa::{self, ParallelDatabase},
@@ -65,7 +65,7 @@ pub use crate::{
65 completion::{ 65 completion::{
66 CompletionConfig, CompletionItem, CompletionItemKind, CompletionScore, InsertTextFormat, 66 CompletionConfig, CompletionItem, CompletionItemKind, CompletionScore, InsertTextFormat,
67 }, 67 },
68 diagnostics::Severity, 68 diagnostics::{DiagnosticsConfig, Severity},
69 display::NavigationTarget, 69 display::NavigationTarget,
70 expand_macro::ExpandedMacro, 70 expand_macro::ExpandedMacro,
71 file_structure::StructureNode, 71 file_structure::StructureNode,
@@ -148,7 +148,7 @@ pub struct AnalysisHost {
148} 148}
149 149
150impl AnalysisHost { 150impl AnalysisHost {
151 pub fn new(lru_capacity: Option<usize>) -> Self { 151 pub fn new(lru_capacity: Option<usize>) -> AnalysisHost {
152 AnalysisHost { db: RootDatabase::new(lru_capacity) } 152 AnalysisHost { db: RootDatabase::new(lru_capacity) }
153 } 153 }
154 154
@@ -495,13 +495,10 @@ impl Analysis {
495 /// Computes the set of diagnostics for the given file. 495 /// Computes the set of diagnostics for the given file.
496 pub fn diagnostics( 496 pub fn diagnostics(
497 &self, 497 &self,
498 config: &DiagnosticsConfig,
498 file_id: FileId, 499 file_id: FileId,
499 enable_experimental: bool,
500 disabled_diagnostics: Option<HashSet<String>>,
501 ) -> Cancelable<Vec<Diagnostic>> { 500 ) -> Cancelable<Vec<Diagnostic>> {
502 self.with_db(|db| { 501 self.with_db(|db| diagnostics::diagnostics(db, config, file_id))
503 diagnostics::diagnostics(db, file_id, enable_experimental, disabled_diagnostics)
504 })
505 } 502 }
506 503
507 /// Returns the edit required to rename reference at the position to the new 504 /// Returns the edit required to rename reference at the position to the new