Skip to content

Commit ad13b1a

Browse files
authored
Merge pull request #20366 from Veykril/push-lmmtrpptrxom
minor: Cleanup `map_rust_child_diagnostics` a bit
2 parents d9c3ba7 + 008c60d commit ad13b1a

File tree

6 files changed

+191
-193
lines changed

6 files changed

+191
-193
lines changed

src/tools/rust-analyzer/Cargo.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,6 +2047,7 @@ dependencies = [
20472047
"serde",
20482048
"serde_derive",
20492049
"serde_json",
2050+
"smallvec",
20502051
"stdx",
20512052
"syntax",
20522053
"syntax-bridge",

src/tools/rust-analyzer/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

src/tools/rust-analyzer/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)