From a3aa5e0b6b376e6766ea202dbe80bf721e41d0ad Mon Sep 17 00:00:00 2001 From: Jacob Pratt Date: Sun, 14 May 2023 17:38:41 -0400 Subject: [PATCH 1/5] Remove `LineColumn`, `Span::start`, `Span::end` --- crates/proc-macro-srv/src/server.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/crates/proc-macro-srv/src/server.rs b/crates/proc-macro-srv/src/server.rs index 6fd8de5934..999e78aa56 100644 --- a/crates/proc-macro-srv/src/server.rs +++ b/crates/proc-macro-srv/src/server.rs @@ -304,14 +304,6 @@ impl server::Span for RustAnalyzer { // FIXME handle span Range { start: 0, end: 0 } } - fn start(&mut self, _span: Self::Span) -> LineColumn { - // FIXME handle span - LineColumn { line: 0, column: 0 } - } - fn end(&mut self, _span: Self::Span) -> LineColumn { - // FIXME handle span - LineColumn { line: 0, column: 0 } - } fn join(&mut self, first: Self::Span, _second: Self::Span) -> Option { // Just return the first span again, because some macros will unwrap the result. Some(first) From b01809ea11fff2dcca5ec86e17e3747083e4b8eb Mon Sep 17 00:00:00 2001 From: Jacob Pratt Date: Sun, 14 May 2023 18:11:27 -0400 Subject: [PATCH 2/5] =?UTF-8?q?`Span::{before,=20after}`=20=E2=86=92=20`Sp?= =?UTF-8?q?an::{start,=20end}`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/proc-macro-srv/src/server.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/proc-macro-srv/src/server.rs b/crates/proc-macro-srv/src/server.rs index 999e78aa56..410f07f9b8 100644 --- a/crates/proc-macro-srv/src/server.rs +++ b/crates/proc-macro-srv/src/server.rs @@ -322,11 +322,11 @@ impl server::Span for RustAnalyzer { tt::TokenId::unspecified() } - fn after(&mut self, _self_: Self::Span) -> Self::Span { + fn end(&mut self, _self_: Self::Span) -> Self::Span { tt::TokenId::unspecified() } - fn before(&mut self, _self_: Self::Span) -> Self::Span { + fn start(&mut self, _self_: Self::Span) -> Self::Span { tt::TokenId::unspecified() } } From b2731a53282bb4f428653c4b291735434b108221 Mon Sep 17 00:00:00 2001 From: Jacob Pratt Date: Sun, 14 May 2023 18:30:18 -0400 Subject: [PATCH 3/5] Add `Span::{line, column}` --- crates/proc-macro-srv/src/server.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/proc-macro-srv/src/server.rs b/crates/proc-macro-srv/src/server.rs index 410f07f9b8..e67f1e798e 100644 --- a/crates/proc-macro-srv/src/server.rs +++ b/crates/proc-macro-srv/src/server.rs @@ -329,6 +329,16 @@ impl server::Span for RustAnalyzer { fn start(&mut self, _self_: Self::Span) -> Self::Span { tt::TokenId::unspecified() } + + fn line(&mut self, _span: Self::Span) -> usize { + // FIXME handle line + 0 + } + + fn column(&mut self, _span: Self::Span) -> usize { + // FIXME handle column + 0 + } } impl server::Symbol for RustAnalyzer { From 9e9ba7ae31927859c65241067a8f1aa6c0fbb488 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 7 Jun 2023 22:36:35 -0700 Subject: [PATCH 4/5] Delete use of proc_macro_span_shrink from proc-macro2 --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 50c81ca279..13cb25f7b0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1304,9 +1304,9 @@ version = "0.0.0" [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" dependencies = [ "unicode-ident", ] From 36bbc38edd1990860d3f0ef9af9c7afaea14ec44 Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Wed, 21 Jun 2023 14:02:59 +0200 Subject: [PATCH 5/5] Remove outdated import in r-a proc macro server. --- crates/proc-macro-srv/src/server.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/proc-macro-srv/src/server.rs b/crates/proc-macro-srv/src/server.rs index e67f1e798e..1980d4c78b 100644 --- a/crates/proc-macro-srv/src/server.rs +++ b/crates/proc-macro-srv/src/server.rs @@ -8,10 +8,7 @@ //! //! FIXME: No span and source file information is implemented yet -use proc_macro::{ - bridge::{self, server}, - LineColumn, -}; +use proc_macro::bridge::{self, server}; mod token_stream; pub use token_stream::TokenStream;