From 1fee709afc005e1db23613e167d19cc19df44b1f Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Wed, 29 May 2024 13:55:51 +0000 Subject: [PATCH] Fix the proc-macro-srv --- .../proc-macro-srv/src/server/rust_analyzer_span.rs | 12 ------------ .../crates/proc-macro-srv/src/server/token_id.rs | 6 ------ 2 files changed, 18 deletions(-) diff --git a/src/tools/rust-analyzer/crates/proc-macro-srv/src/server/rust_analyzer_span.rs b/src/tools/rust-analyzer/crates/proc-macro-srv/src/server/rust_analyzer_span.rs index 0350bde412243..5dd498acbe41b 100644 --- a/src/tools/rust-analyzer/crates/proc-macro-srv/src/server/rust_analyzer_span.rs +++ b/src/tools/rust-analyzer/crates/proc-macro-srv/src/server/rust_analyzer_span.rs @@ -312,18 +312,6 @@ impl server::Span for RaSpanServer { // FIXME stub, requires db SourceFile {} } - fn save_span(&mut self, _span: Self::Span) -> usize { - // FIXME, quote is incompatible with third-party tools - // This is called by the quote proc-macro which is expanded when the proc-macro is compiled - // As such, r-a will never observe this - 0 - } - fn recover_proc_macro_span(&mut self, _id: usize) -> Self::Span { - // FIXME, quote is incompatible with third-party tools - // This is called by the expansion of quote!, r-a will observe this, but we don't have - // access to the spans that were encoded - self.call_site - } /// Recent feature, not yet in the proc_macro /// /// See PR: diff --git a/src/tools/rust-analyzer/crates/proc-macro-srv/src/server/token_id.rs b/src/tools/rust-analyzer/crates/proc-macro-srv/src/server/token_id.rs index ad7bd954cf16e..50dfd32749466 100644 --- a/src/tools/rust-analyzer/crates/proc-macro-srv/src/server/token_id.rs +++ b/src/tools/rust-analyzer/crates/proc-macro-srv/src/server/token_id.rs @@ -290,12 +290,6 @@ impl server::Span for TokenIdServer { fn source_file(&mut self, _span: Self::Span) -> Self::SourceFile { SourceFile {} } - fn save_span(&mut self, _span: Self::Span) -> usize { - 0 - } - fn recover_proc_macro_span(&mut self, _id: usize) -> Self::Span { - self.call_site - } /// Recent feature, not yet in the proc_macro /// /// See PR: