Skip to content

Commit 00ace81

Browse files
authored
Merge pull request #20366 from Veykril/push-lmmtrpptrxom
minor: Cleanup `map_rust_child_diagnostics` a bit
2 parents 769ebaf + 823d719 commit 00ace81

File tree

6 files changed

+191
-193
lines changed

6 files changed

+191
-193
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

@@ -57,7 +58,7 @@ pub(crate) struct DiagnosticCollection {
5758
#[derive(Debug, Clone)]
5859
pub(crate) struct Fix {
5960
// Fixes may be triggerable from multiple ranges.
60-
pub(crate) ranges: Vec<lsp_types::Range>,
61+
pub(crate) ranges: SmallVec<[lsp_types::Range; 1]>,
6162
pub(crate) action: lsp_ext::CodeAction,
6263
}
6364

0 commit comments

Comments
 (0)