From 2119dc23e80d77f1abc789e3d99c34d429e17905 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 13 Aug 2020 12:07:28 +0200 Subject: [PATCH] Rename ra_proc_macro -> proc_macro_api --- Cargo.lock | 28 +++++++++---------- .../Cargo.toml | 5 ++-- .../src/lib.rs | 0 .../src/msg.rs | 0 .../src/process.rs | 0 .../src/rpc.rs | 2 +- crates/proc_macro_srv/Cargo.toml | 2 +- crates/proc_macro_srv/src/cli.rs | 2 +- crates/proc_macro_srv/src/dylib.rs | 2 +- crates/proc_macro_srv/src/lib.rs | 4 +-- crates/proc_macro_srv/src/tests/utils.rs | 2 +- crates/project_model/Cargo.toml | 2 +- crates/project_model/src/lib.rs | 2 +- 13 files changed, 26 insertions(+), 25 deletions(-) rename crates/{ra_proc_macro => proc_macro_api}/Cargo.toml (92%) rename crates/{ra_proc_macro => proc_macro_api}/src/lib.rs (100%) rename crates/{ra_proc_macro => proc_macro_api}/src/msg.rs (100%) rename crates/{ra_proc_macro => proc_macro_api}/src/process.rs (100%) rename crates/{ra_proc_macro => proc_macro_api}/src/rpc.rs (99%) diff --git a/Cargo.lock b/Cargo.lock index 89d0a60ec3..9878dd88fe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -909,6 +909,18 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "proc_macro_api" +version = "0.1.0" +dependencies = [ + "crossbeam-channel", + "jod-thread", + "log", + "serde", + "serde_json", + "tt", +] + [[package]] name = "proc_macro_srv" version = "0.0.0" @@ -919,7 +931,7 @@ dependencies = [ "libloading", "mbe", "memmap", - "ra_proc_macro", + "proc_macro_api", "serde_derive", "test_utils", "toolchain", @@ -948,8 +960,8 @@ dependencies = [ "cfg", "log", "paths", + "proc_macro_api", "ra_db", - "ra_proc_macro", "rustc-hash", "serde", "serde_json", @@ -1131,18 +1143,6 @@ dependencies = [ "text_edit", ] -[[package]] -name = "ra_proc_macro" -version = "0.1.0" -dependencies = [ - "crossbeam-channel", - "jod-thread", - "log", - "serde", - "serde_json", - "tt", -] - [[package]] name = "ra_ssr" version = "0.1.0" diff --git a/crates/ra_proc_macro/Cargo.toml b/crates/proc_macro_api/Cargo.toml similarity index 92% rename from crates/ra_proc_macro/Cargo.toml rename to crates/proc_macro_api/Cargo.toml index d2d1bc228d..c1abb56277 100644 --- a/crates/ra_proc_macro/Cargo.toml +++ b/crates/proc_macro_api/Cargo.toml @@ -1,6 +1,6 @@ [package] edition = "2018" -name = "ra_proc_macro" +name = "proc_macro_api" version = "0.1.0" authors = ["rust-analyzer developers"] publish = false @@ -10,9 +10,10 @@ license = "MIT OR Apache-2.0" doctest = false [dependencies] -tt = { path = "../tt" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" log = "0.4.8" crossbeam-channel = "0.4.0" jod-thread = "0.1.1" + +tt = { path = "../tt" } diff --git a/crates/ra_proc_macro/src/lib.rs b/crates/proc_macro_api/src/lib.rs similarity index 100% rename from crates/ra_proc_macro/src/lib.rs rename to crates/proc_macro_api/src/lib.rs diff --git a/crates/ra_proc_macro/src/msg.rs b/crates/proc_macro_api/src/msg.rs similarity index 100% rename from crates/ra_proc_macro/src/msg.rs rename to crates/proc_macro_api/src/msg.rs diff --git a/crates/ra_proc_macro/src/process.rs b/crates/proc_macro_api/src/process.rs similarity index 100% rename from crates/ra_proc_macro/src/process.rs rename to crates/proc_macro_api/src/process.rs diff --git a/crates/ra_proc_macro/src/rpc.rs b/crates/proc_macro_api/src/rpc.rs similarity index 99% rename from crates/ra_proc_macro/src/rpc.rs rename to crates/proc_macro_api/src/rpc.rs index 5e5d78d067..47624163ee 100644 --- a/crates/ra_proc_macro/src/rpc.rs +++ b/crates/proc_macro_api/src/rpc.rs @@ -1,4 +1,4 @@ -//! Data struture serialization related stuff for RPC +//! Data structure serialization related stuff for RPC //! //! Defines all necessary rpc serialization data structures, //! which includes `tt` related data and some task messages. diff --git a/crates/proc_macro_srv/Cargo.toml b/crates/proc_macro_srv/Cargo.toml index 0954ffb66f..7171f08084 100644 --- a/crates/proc_macro_srv/Cargo.toml +++ b/crates/proc_macro_srv/Cargo.toml @@ -15,7 +15,7 @@ memmap = "0.7" tt = { path = "../tt" } mbe = { path = "../mbe" } -ra_proc_macro = { path = "../ra_proc_macro" } +proc_macro_api = { path = "../proc_macro_api" } test_utils = { path = "../test_utils" } [dev-dependencies] diff --git a/crates/proc_macro_srv/src/cli.rs b/crates/proc_macro_srv/src/cli.rs index 1437794c9e..d428b95675 100644 --- a/crates/proc_macro_srv/src/cli.rs +++ b/crates/proc_macro_srv/src/cli.rs @@ -1,7 +1,7 @@ //! Driver for proc macro server use crate::ProcMacroSrv; -use ra_proc_macro::msg::{self, Message}; +use proc_macro_api::msg::{self, Message}; use std::io; pub fn run() -> io::Result<()> { diff --git a/crates/proc_macro_srv/src/dylib.rs b/crates/proc_macro_srv/src/dylib.rs index 9b6cc91ef9..f8f705da8c 100644 --- a/crates/proc_macro_srv/src/dylib.rs +++ b/crates/proc_macro_srv/src/dylib.rs @@ -7,7 +7,7 @@ use std::path::{Path, PathBuf}; use goblin::{mach::Mach, Object}; use libloading::Library; use memmap::Mmap; -use ra_proc_macro::ProcMacroKind; +use proc_macro_api::ProcMacroKind; use std::io; const NEW_REGISTRAR_SYMBOL: &str = "_rustc_proc_macro_decls_"; diff --git a/crates/proc_macro_srv/src/lib.rs b/crates/proc_macro_srv/src/lib.rs index 1fc2eef82e..7e4e4ad505 100644 --- a/crates/proc_macro_srv/src/lib.rs +++ b/crates/proc_macro_srv/src/lib.rs @@ -8,7 +8,7 @@ //! * We use `tt` for proc-macro `TokenStream` server, it is easier to manipulate and interact with //! RA than `proc-macro2` token stream. //! * By **copying** the whole rustc `lib_proc_macro` code, we are able to build this with `stable` -//! rustc rather than `unstable`. (Although in gerenal ABI compatibility is still an issue) +//! rustc rather than `unstable`. (Although in general ABI compatibility is still an issue)… #[allow(dead_code)] #[doc(hidden)] @@ -20,7 +20,7 @@ mod rustc_server; mod dylib; use proc_macro::bridge::client::TokenStream; -use ra_proc_macro::{ExpansionResult, ExpansionTask, ListMacrosResult, ListMacrosTask}; +use proc_macro_api::{ExpansionResult, ExpansionTask, ListMacrosResult, ListMacrosTask}; use std::{ collections::{hash_map::Entry, HashMap}, fs, diff --git a/crates/proc_macro_srv/src/tests/utils.rs b/crates/proc_macro_srv/src/tests/utils.rs index 1b6a0b6fb7..5828512d6e 100644 --- a/crates/proc_macro_srv/src/tests/utils.rs +++ b/crates/proc_macro_srv/src/tests/utils.rs @@ -2,7 +2,7 @@ use crate::dylib; use crate::ProcMacroSrv; -use ra_proc_macro::ListMacrosTask; +use proc_macro_api::ListMacrosTask; use std::str::FromStr; use test_utils::assert_eq_text; diff --git a/crates/project_model/Cargo.toml b/crates/project_model/Cargo.toml index 8d8d093879..1c84c7d209 100644 --- a/crates/project_model/Cargo.toml +++ b/crates/project_model/Cargo.toml @@ -20,6 +20,6 @@ arena = { path = "../arena" } cfg = { path = "../cfg" } ra_db = { path = "../ra_db" } toolchain = { path = "../toolchain" } -ra_proc_macro = { path = "../ra_proc_macro" } +proc_macro_api = { path = "../proc_macro_api" } paths = { path = "../paths" } stdx = { path = "../stdx" } diff --git a/crates/project_model/src/lib.rs b/crates/project_model/src/lib.rs index ee42198f35..234f908c9b 100644 --- a/crates/project_model/src/lib.rs +++ b/crates/project_model/src/lib.rs @@ -25,7 +25,7 @@ pub use crate::{ sysroot::Sysroot, }; -pub use ra_proc_macro::ProcMacroClient; +pub use proc_macro_api::ProcMacroClient; #[derive(Debug, Clone, Eq, PartialEq)] pub enum ProjectWorkspace {