aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/mock.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-10-08 12:55:27 +0100
committerGitHub <[email protected]>2019-10-08 12:55:27 +0100
commit06a8deae4a29949f438d66c54eed4e016ac35432 (patch)
tree695c569cd28f84ca2dd1b75a8d4b3e71f1dabe09 /crates/ra_hir/src/mock.rs
parent92cf0eba93b8d2705ed39bef1a4ea665ed3c25dc (diff)
parent6503add6e3c900ea7ded37199ea58f43bb57b051 (diff)
Merge #1969
1969: restore coloring of attributes r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/mock.rs')
-rw-r--r--crates/ra_hir/src/mock.rs19
1 files changed, 17 insertions, 2 deletions
diff --git a/crates/ra_hir/src/mock.rs b/crates/ra_hir/src/mock.rs
index f750986b8..827424983 100644
--- a/crates/ra_hir/src/mock.rs
+++ b/crates/ra_hir/src/mock.rs
@@ -278,7 +278,10 @@ macro_rules! crate_graph {
278 $crate_path:literal, 278 $crate_path:literal,
279 $($edition:literal,)? 279 $($edition:literal,)?
280 [$($dep:literal),*] 280 [$($dep:literal),*]
281 $(,$cfg:expr)? 281 $(, cfg = {
282 $($key:literal $(= $value:literal)?),*
283 $(,)?
284 })?
282 ), 285 ),
283 )*) => {{ 286 )*) => {{
284 let mut res = $crate::mock::CrateGraphFixture::default(); 287 let mut res = $crate::mock::CrateGraphFixture::default();
@@ -286,7 +289,19 @@ macro_rules! crate_graph {
286 #[allow(unused_mut, unused_assignments)] 289 #[allow(unused_mut, unused_assignments)]
287 let mut edition = ra_db::Edition::Edition2018; 290 let mut edition = ra_db::Edition::Edition2018;
288 $(edition = ra_db::Edition::from_string($edition);)? 291 $(edition = ra_db::Edition::from_string($edition);)?
289 let cfg_options = { ::ra_cfg::CfgOptions::default() $(; $cfg)? }; 292 let cfg_options = {
293 #[allow(unused_mut)]
294 let mut cfg = ::ra_cfg::CfgOptions::default();
295 $(
296 $(
297 if 0 == 0 $(+ { drop($value); 1})? {
298 cfg.insert_atom($key.into());
299 }
300 $(cfg.insert_key_value($key.into(), $value.into());)?
301 )*
302 )?
303 cfg
304 };
290 res.0.push(( 305 res.0.push((
291 $crate_name.to_string(), 306 $crate_name.to_string(),
292 ($crate_path.to_string(), edition, cfg_options, vec![$($dep.to_string()),*]) 307 ($crate_path.to_string(), edition, cfg_options, vec![$($dep.to_string()),*])