Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/proc-macro-api/src/lib.rs')
| -rw-r--r-- | crates/proc-macro-api/src/lib.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/crates/proc-macro-api/src/lib.rs b/crates/proc-macro-api/src/lib.rs index 97919b85b5..f0c7ce7efd 100644 --- a/crates/proc-macro-api/src/lib.rs +++ b/crates/proc-macro-api/src/lib.rs @@ -5,13 +5,24 @@ //! is used to provide basic infrastructure for communication between two //! processes: Client (RA itself), Server (the external program) +#![cfg_attr(not(feature = "sysroot-abi"), allow(unused_crate_dependencies))] +#![cfg_attr( + feature = "sysroot-abi", + feature(proc_macro_internals, proc_macro_diagnostic, proc_macro_span) +)] +#![allow(internal_features)] + +mod codec; +mod framing; pub mod legacy_protocol; mod process; use paths::{AbsPath, AbsPathBuf}; +use semver::Version; use span::{ErasedFileAstId, FIXUP_ERASED_FILE_AST_ID_MARKER, Span}; use std::{fmt, io, sync::Arc, time::SystemTime}; +pub use crate::codec::Codec; use crate::process::ProcMacroServerProcess; /// The versions of the server protocol @@ -115,8 +126,9 @@ impl ProcMacroClient { env: impl IntoIterator< Item = (impl AsRef<std::ffi::OsStr>, &'a Option<impl 'a + AsRef<std::ffi::OsStr>>), > + Clone, + version: Option<&Version>, ) -> io::Result<ProcMacroClient> { - let process = ProcMacroServerProcess::run(process_path, env)?; + let process = ProcMacroServerProcess::run(process_path, env, version)?; Ok(ProcMacroClient { process: Arc::new(process), path: process_path.to_owned() }) } |