From 84fb9b44c3b06e1a542608570bb6d7212c8505b7 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Wed, 1 Apr 2020 13:11:26 +0800 Subject: Introduce ra_proc_macro_srv --- crates/ra_proc_macro_srv/src/lib.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 crates/ra_proc_macro_srv/src/lib.rs (limited to 'crates/ra_proc_macro_srv/src/lib.rs') diff --git a/crates/ra_proc_macro_srv/src/lib.rs b/crates/ra_proc_macro_srv/src/lib.rs new file mode 100644 index 000000000..f77be1475 --- /dev/null +++ b/crates/ra_proc_macro_srv/src/lib.rs @@ -0,0 +1,21 @@ +//! RA Proc Macro Server +//! +//! This library is able to call compiled Rust custom derive dynamic libraries on arbitrary code. +//! The general idea here is based on https://github.com/fedochet/rust-proc-macro-expander. +//! +//! But we change some several design for fitting RA needs: +//! +//! * We use `ra_tt` for proc-macro `TokenStream` server, it is easy to manipute and interact with +//! RA then 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) + +use ra_proc_macro::{ExpansionResult, ExpansionTask, ListMacrosResult, ListMacrosTask}; + +pub fn expand_task(_task: &ExpansionTask) -> Result { + unimplemented!() +} + +pub fn list_macros(_task: &ListMacrosTask) -> Result { + unimplemented!() +} -- cgit v1.2.3