aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_proc_macro_srv/src/lib.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-04-03 13:06:04 +0100
committerGitHub <[email protected]>2020-04-03 13:06:04 +0100
commit1a8779bce07281f1fbde1166ded75bc5acaa0f27 (patch)
tree3c69ce23117592f5442bcfdfc165820394b775a3 /crates/ra_proc_macro_srv/src/lib.rs
parentac91de1525662a602a1057709eb91a9b21ea3ac7 (diff)
parent9a2114b0dd6d3292216fa4d05e3c4cd219633f4b (diff)
Merge #3800
3800: Introduce ra_proc_macro_srv r=matklad a=edwin0cheng This PR add preliminary for server side of proc macro : 1. Add crate setup 2. IO for server side Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ra_proc_macro_srv/src/lib.rs')
-rw-r--r--crates/ra_proc_macro_srv/src/lib.rs21
1 files changed, 21 insertions, 0 deletions
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 @@
1//! RA Proc Macro Server
2//!
3//! This library is able to call compiled Rust custom derive dynamic libraries on arbitrary code.
4//! The general idea here is based on https://github.com/fedochet/rust-proc-macro-expander.
5//!
6//! But we change some several design for fitting RA needs:
7//!
8//! * We use `ra_tt` for proc-macro `TokenStream` server, it is easy to manipute and interact with
9//! RA then proc-macro2 token stream.
10//! * By **copying** the whole rustc `lib_proc_macro` code, we are able to build this with `stable`
11//! rustc rather than `unstable`. (Although in gerenal ABI compatibility is still an issue)
12
13use ra_proc_macro::{ExpansionResult, ExpansionTask, ListMacrosResult, ListMacrosTask};
14
15pub fn expand_task(_task: &ExpansionTask) -> Result<ExpansionResult, String> {
16 unimplemented!()
17}
18
19pub fn list_macros(_task: &ListMacrosTask) -> Result<ListMacrosResult, String> {
20 unimplemented!()
21}