mirror of
https://github.com/swc-project/swc.git
synced 2024-12-23 13:51:19 +03:00
chore: Make rust-analyzer
faster (#2962)
This commit is contained in:
parent
c346f12b32
commit
02322aaa99
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@ -20,4 +20,8 @@
|
||||
"eslint.enable": false,
|
||||
"cSpell.allowCompoundWords": true,
|
||||
"cSpell.caseSensitive": true,
|
||||
"rust-analyzer.checkOnSave.features": [
|
||||
// We use this to make IDE faster
|
||||
"rust-analyzer"
|
||||
]
|
||||
}
|
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -3467,7 +3467,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "testing_macros"
|
||||
version = "0.2.4"
|
||||
version = "0.2.5"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"glob",
|
||||
|
@ -6,7 +6,11 @@ edition = "2018"
|
||||
license = "Apache-2.0"
|
||||
name = "testing_macros"
|
||||
repository = "https://github.com/swc-project/swc.git"
|
||||
version = "0.2.4"
|
||||
version = "0.2.5"
|
||||
|
||||
[features]
|
||||
# Skip generating fixtures so the editor becomes faster again
|
||||
rust-analyzer = []
|
||||
|
||||
[lib]
|
||||
proc-macro = true
|
||||
|
@ -1,3 +1,4 @@
|
||||
use pmutil::q;
|
||||
use proc_macro::TokenStream;
|
||||
use quote::ToTokens;
|
||||
use syn::ItemFn;
|
||||
@ -54,6 +55,15 @@ mod fixture;
|
||||
#[proc_macro_attribute]
|
||||
pub fn fixture(attr: TokenStream, item: TokenStream) -> TokenStream {
|
||||
let item: ItemFn = syn::parse(item).expect("failed to parse input as a function item");
|
||||
|
||||
if cfg!(feature = "rust-analyzer") {
|
||||
return q!(Vars { item }, {
|
||||
#[allow(unused)]
|
||||
item
|
||||
})
|
||||
.into();
|
||||
}
|
||||
|
||||
let config: self::fixture::Config =
|
||||
syn::parse(attr).expect("failed to parse input passed to #[fixture]");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user