mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-01 20:31:59 +00:00
Merge commit 'e36a20c24f' into ra-sync-and-pms-component
This commit is contained in:
parent
dfe84494c1
commit
a1f1b95d00
48 changed files with 627 additions and 213 deletions
17
crates/proc-macro-srv-cli/Cargo.toml
Normal file
17
crates/proc-macro-srv-cli/Cargo.toml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
[package]
|
||||
name = "proc-macro-srv-cli"
|
||||
version = "0.0.0"
|
||||
description = "TBD"
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2021"
|
||||
rust-version = "1.57"
|
||||
|
||||
[dependencies]
|
||||
proc-macro-srv = { version = "0.0.0", path = "../proc-macro-srv" }
|
||||
|
||||
[features]
|
||||
sysroot-abi = ["proc-macro-srv/sysroot-abi"]
|
||||
|
||||
[[bin]]
|
||||
name = "rust-analyzer-proc-macro-srv"
|
||||
path = "src/main.rs"
|
||||
19
crates/proc-macro-srv-cli/src/main.rs
Normal file
19
crates/proc-macro-srv-cli/src/main.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
//! A standalone binary for `proc-macro-srv`.
|
||||
|
||||
use proc_macro_srv::cli;
|
||||
|
||||
fn main() -> std::io::Result<()> {
|
||||
let v = std::env::var("RUST_ANALYZER_INTERNALS_DO_NOT_USE");
|
||||
match v.as_deref() {
|
||||
Ok("this is unstable") => {
|
||||
// very well, if you must
|
||||
}
|
||||
_ => {
|
||||
eprintln!("If you're rust-analyzer, you can use this tool by exporting RUST_ANALYZER_INTERNALS_DO_NOT_USE='this is unstable'.");
|
||||
eprintln!("If not, you probably shouldn't use this tool. But do what you want: I'm an error message, not a cop.");
|
||||
std::process::exit(122);
|
||||
}
|
||||
}
|
||||
|
||||
cli::run()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue