Rename ra_proc_macro -> proc_macro_api

This commit is contained in:
Aleksey Kladov 2020-08-13 12:07:28 +02:00
parent 4abdf323af
commit 2119dc23e8
13 changed files with 26 additions and 25 deletions

28
Cargo.lock generated
View file

@ -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"

View file

@ -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" }

View file

@ -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.

View file

@ -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]

View file

@ -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<()> {

View file

@ -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_";

View file

@ -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,

View file

@ -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;

View file

@ -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" }

View file

@ -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 {