mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Introduce ra_proc_macro_srv
This commit is contained in:
parent
ac91de1525
commit
84fb9b44c3
5 changed files with 162 additions and 2 deletions
21
crates/ra_proc_macro_srv/src/lib.rs
Normal file
21
crates/ra_proc_macro_srv/src/lib.rs
Normal file
|
@ -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<ExpansionResult, String> {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
pub fn list_macros(_task: &ListMacrosTask) -> Result<ListMacrosResult, String> {
|
||||
unimplemented!()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue