mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Align diagnostics config with the rest of rust-analyzer
This commit is contained in:
parent
b8dfc331ab
commit
0866b1be89
10 changed files with 93 additions and 98 deletions
|
@ -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<usize>) -> Self {
|
||||
pub fn new(lru_capacity: Option<usize>) -> 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<HashSet<String>>,
|
||||
) -> Cancelable<Vec<Diagnostic>> {
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue