mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
feat: improve performance by delaying computation of fixes for diagnostics
This commit is contained in:
parent
04b5fcfdb2
commit
06a633ff42
7 changed files with 74 additions and 40 deletions
|
@ -57,7 +57,8 @@ pub fn diagnostics(
|
|||
let crate_name =
|
||||
module.krate().display_name(db).as_deref().unwrap_or("unknown").to_string();
|
||||
println!("processing crate: {}, module: {}", crate_name, _vfs.file_path(file_id));
|
||||
for diagnostic in analysis.diagnostics(&DiagnosticsConfig::default(), file_id).unwrap()
|
||||
for diagnostic in
|
||||
analysis.diagnostics(&DiagnosticsConfig::default(), false, file_id).unwrap()
|
||||
{
|
||||
if matches!(diagnostic.severity, Severity::Error) {
|
||||
found_error = true;
|
||||
|
|
|
@ -1182,7 +1182,7 @@ pub(crate) fn publish_diagnostics(
|
|||
|
||||
let diagnostics: Vec<Diagnostic> = snap
|
||||
.analysis
|
||||
.diagnostics(&snap.config.diagnostics(), file_id)?
|
||||
.diagnostics(&snap.config.diagnostics(), false, file_id)?
|
||||
.into_iter()
|
||||
.map(|d| Diagnostic {
|
||||
range: to_proto::range(&line_index, d.range),
|
||||
|
|
|
@ -168,6 +168,7 @@ impl Server {
|
|||
self.send_notification(r)
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
pub(crate) fn request<R>(&self, params: R::Params, expected_resp: Value)
|
||||
where
|
||||
R: lsp_types::request::Request,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue