Skip to content

Commit 8695d31

Browse files
committed
Fix the proc-macro-srv
1 parent bd94288 commit 8695d31

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/tools/rust-analyzer/crates/proc-macro-srv/src/server_impl/rust_analyzer_span.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,14 @@ impl server::Span for RaSpanServer {
145145
// FIXME
146146
None
147147
}
148+
#[cfg(bootstrap)]
148149
fn save_span(&mut self, _span: Self::Span) -> usize {
149150
// FIXME, quote is incompatible with third-party tools
150151
// This is called by the quote proc-macro which is expanded when the proc-macro is compiled
151152
// As such, r-a will never observe this
152153
0
153154
}
155+
#[cfg(bootstrap)]
154156
fn recover_proc_macro_span(&mut self, _id: usize) -> Self::Span {
155157
// FIXME, quote is incompatible with third-party tools
156158
// This is called by the expansion of quote!, r-a will observe this, but we don't have

src/tools/rust-analyzer/crates/proc-macro-srv/src/server_impl/token_id.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,15 @@ impl server::Span for TokenIdServer {
117117
fn local_file(&mut self, _span: Self::Span) -> Option<String> {
118118
None
119119
}
120+
#[cfg(bootstrap)]
120121
fn save_span(&mut self, _span: Self::Span) -> usize {
121122
0
122123
}
124+
#[cfg(bootstrap)]
123125
fn recover_proc_macro_span(&mut self, _id: usize) -> Self::Span {
124126
self.call_site
125127
}
128+
126129
/// Recent feature, not yet in the proc_macro
127130
///
128131
/// See PR:

0 commit comments

Comments
 (0)