diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-03-26 17:09:32 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-03-26 17:09:32 +0000 |
commit | b1594f108041813c9fa32538950c15c55202cbd5 (patch) | |
tree | cef1e662a7acf2807422e7c232014c5326ac37b6 /crates/ra_tt/src | |
parent | 20c110e57f24aa54154942ee40921e9129fbc595 (diff) | |
parent | db162df264a222021dbc7f1f93af94029f3948d9 (diff) |
Merge #3727
3727: Introduce ra_proc_macro r=matklad a=edwin0cheng
This PR implemented:
1. Reading dylib path of proc-macro crate from cargo check , similar to how `OUTDIR` is obtained.
2. Added a new crate `ra_proc_macro` and implement the foot-work for reading result from external proc-macro expander.
3. Added a struct `ProcMacroClient` , which will be responsible to the client side communication to the External process.
Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ra_tt/src')
-rw-r--r-- | crates/ra_tt/src/lib.rs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/crates/ra_tt/src/lib.rs b/crates/ra_tt/src/lib.rs index 1e2fb8b91..1015ce0a6 100644 --- a/crates/ra_tt/src/lib.rs +++ b/crates/ra_tt/src/lib.rs | |||
@@ -14,9 +14,12 @@ macro_rules! impl_froms { | |||
14 | } | 14 | } |
15 | } | 15 | } |
16 | 16 | ||
17 | use std::fmt; | 17 | use std::{ |
18 | fmt::{self, Debug}, | ||
19 | panic::RefUnwindSafe, | ||
20 | }; | ||
18 | 21 | ||
19 | use smol_str::SmolStr; | 22 | pub use smol_str::SmolStr; |
20 | 23 | ||
21 | /// Represents identity of the token. | 24 | /// Represents identity of the token. |
22 | /// | 25 | /// |
@@ -184,3 +187,11 @@ impl Subtree { | |||
184 | } | 187 | } |
185 | 188 | ||
186 | pub mod buffer; | 189 | pub mod buffer; |
190 | |||
191 | #[derive(Debug, PartialEq, Eq)] | ||
192 | pub enum ExpansionError {} | ||
193 | |||
194 | pub trait TokenExpander: Debug + Send + Sync + RefUnwindSafe { | ||
195 | fn expand(&self, subtree: &Subtree, attrs: Option<&Subtree>) | ||
196 | -> Result<Subtree, ExpansionError>; | ||
197 | } | ||