Skip to content

Commit 4506830

Browse files
committed
minor: Cleanup map_rust_child_diagnostics a bit
1 parent 68e7ec9 commit 4506830

File tree

5 files changed

+190
-192
lines changed

5 files changed

+190
-192
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/rust-analyzer/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ tenthash = "1.1.0"
4242
num_cpus = "1.17.0"
4343
mimalloc = { version = "0.1.46", default-features = false, optional = true }
4444
lsp-server.workspace = true
45+
smallvec.workspace = true
4546
tracing.workspace = true
4647
tracing-subscriber.workspace = true
4748
tracing-tree.workspace = true

crates/rust-analyzer/src/diagnostics.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! Book keeping for keeping diagnostics easily in sync with the client.
2-
pub(crate) mod to_proto;
2+
pub(crate) mod flycheck_to_proto;
33

44
use std::mem;
55

@@ -8,6 +8,7 @@ use ide::FileId;
88
use ide_db::{FxHashMap, base_db::DbPanicContext};
99
use itertools::Itertools;
1010
use rustc_hash::FxHashSet;
11+
use smallvec::SmallVec;
1112
use stdx::iter_eq_by;
1213
use triomphe::Arc;
1314

@@ -48,7 +49,7 @@ pub(crate) struct DiagnosticCollection {
4849
#[derive(Debug, Clone)]
4950
pub(crate) struct Fix {
5051
// Fixes may be triggerable from multiple ranges.
51-
pub(crate) ranges: Vec<lsp_types::Range>,
52+
pub(crate) ranges: SmallVec<[lsp_types::Range; 1]>,
5253
pub(crate) action: lsp_ext::CodeAction,
5354
}
5455

0 commit comments

Comments
 (0)