Skip to content

Commit 92c8875

Browse files
committed
Implement rpc protocol changes
1 parent 19580b8 commit 92c8875

File tree

13 files changed

+401
-82
lines changed

13 files changed

+401
-82
lines changed

src/tools/rust-analyzer/Cargo.lock

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,6 @@ dependencies = [
772772
"hir-def",
773773
"hir-expand",
774774
"hir-ty",
775-
"indexmap",
776775
"intern",
777776
"itertools 0.14.0",
778777
"ra-ap-rustc_type_ir",
@@ -824,7 +823,6 @@ dependencies = [
824823
"syntax-bridge",
825824
"test-fixture",
826825
"test-utils",
827-
"text-size 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
828826
"thin-vec",
829827
"tracing",
830828
"triomphe",
@@ -864,7 +862,6 @@ version = "0.0.0"
864862
dependencies = [
865863
"arrayvec",
866864
"base-db",
867-
"bitflags 2.9.4",
868865
"cov-mark",
869866
"either",
870867
"ena",
@@ -890,7 +887,6 @@ dependencies = [
890887
"rustc_apfloat",
891888
"salsa",
892889
"salsa-macros",
893-
"scoped-tls",
894890
"smallvec",
895891
"span",
896892
"stdx",
@@ -1085,7 +1081,6 @@ dependencies = [
10851081
"expect-test",
10861082
"fst",
10871083
"hir",
1088-
"indexmap",
10891084
"itertools 0.14.0",
10901085
"line-index 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
10911086
"macros",
@@ -1825,6 +1820,7 @@ dependencies = [
18251820
"indexmap",
18261821
"intern",
18271822
"paths",
1823+
"proc-macro-srv",
18281824
"rustc-hash 2.1.1",
18291825
"serde",
18301826
"serde_derive",
@@ -2289,14 +2285,12 @@ dependencies = [
22892285
"ide-db",
22902286
"ide-ssr",
22912287
"indexmap",
2292-
"intern",
22932288
"itertools 0.14.0",
22942289
"load-cargo",
22952290
"lsp-server 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)",
22962291
"lsp-types",
22972292
"memchr",
22982293
"mimalloc",
2299-
"nohash-hasher",
23002294
"num_cpus",
23012295
"oorandom",
23022296
"parking_lot",
@@ -2489,12 +2483,6 @@ dependencies = [
24892483
"protobuf",
24902484
]
24912485

2492-
[[package]]
2493-
name = "scoped-tls"
2494-
version = "1.0.1"
2495-
source = "registry+https://github.com/rust-lang/crates.io-index"
2496-
checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294"
2497-
24982486
[[package]]
24992487
name = "scopeguard"
25002488
version = "1.2.0"

src/tools/rust-analyzer/crates/proc-macro-api/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,14 @@ indexmap.workspace = true
2424
paths = { workspace = true, features = ["serde1"] }
2525
tt.workspace = true
2626
stdx.workspace = true
27+
proc-macro-srv = {workspace = true, optional = true}
2728
# span = {workspace = true, default-features = false} does not work
2829
span = { path = "../span", version = "0.0.0", default-features = false}
2930

3031
intern.workspace = true
3132

33+
[features]
34+
sysroot-abi = ["proc-macro-srv", "proc-macro-srv/sysroot-abi"]
35+
3236
[lints]
3337
workspace = true

src/tools/rust-analyzer/crates/proc-macro-api/src/legacy_protocol.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,10 @@ pub(crate) fn expand(
9595
let mixed_site = span_data_table.insert_full(mixed_site).0;
9696
let task = ExpandMacro {
9797
data: ExpandMacroData {
98-
macro_body: FlatTree::new(subtree, version, &mut span_data_table),
98+
macro_body: FlatTree::from_subtree(subtree, version, &mut span_data_table),
9999
macro_name: proc_macro.name.to_string(),
100-
attributes: attr.map(|subtree| FlatTree::new(subtree, version, &mut span_data_table)),
100+
attributes: attr
101+
.map(|subtree| FlatTree::from_subtree(subtree, version, &mut span_data_table)),
101102
has_global_spans: ExpnGlobals {
102103
serialize: version >= version::HAS_GLOBAL_SPANS,
103104
def_site,

src/tools/rust-analyzer/crates/proc-macro-api/src/legacy_protocol/msg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ mod tests {
297297
let mut span_data_table = Default::default();
298298
let task = ExpandMacro {
299299
data: ExpandMacroData {
300-
macro_body: FlatTree::new(tt.view(), v, &mut span_data_table),
300+
macro_body: FlatTree::from_subtree(tt.view(), v, &mut span_data_table),
301301
macro_name: Default::default(),
302302
attributes: None,
303303
has_global_spans: ExpnGlobals {

0 commit comments

Comments
 (0)