aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting
diff options
context:
space:
mode:
authorAramis Razzaghipour <[email protected]>2021-05-24 00:42:06 +0100
committerAramis Razzaghipour <[email protected]>2021-05-24 05:54:16 +0100
commitc32428571c3fbf12bd4a4187c797488355416a18 (patch)
tree482c2a1a2a88554f1b1aed4417f3262233e96ab4 /crates/ide/src/syntax_highlighting
parent4fd5248749202e0578d719bc5480171a85358836 (diff)
Remove hir krate methods
Diffstat (limited to 'crates/ide/src/syntax_highlighting')
-rw-r--r--crates/ide/src/syntax_highlighting/highlight.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/ide/src/syntax_highlighting/highlight.rs b/crates/ide/src/syntax_highlighting/highlight.rs
index 2d6d8d100..574a14429 100644
--- a/crates/ide/src/syntax_highlighting/highlight.rs
+++ b/crates/ide/src/syntax_highlighting/highlight.rs
@@ -287,7 +287,7 @@ fn highlight_def(db: &RootDatabase, krate: Option<hir::Crate>, def: Definition)
287 Definition::Macro(m) => { 287 Definition::Macro(m) => {
288 let mut h = Highlight::new(HlTag::Symbol(SymbolKind::Macro)); 288 let mut h = Highlight::new(HlTag::Symbol(SymbolKind::Macro));
289 289
290 if m.krate(db) != krate { 290 if m.module(db).map(hir::Module::krate) != krate {
291 h |= HlMod::Foreign; 291 h |= HlMod::Foreign;
292 } 292 }
293 293
@@ -296,7 +296,7 @@ fn highlight_def(db: &RootDatabase, krate: Option<hir::Crate>, def: Definition)
296 Definition::Field(field) => { 296 Definition::Field(field) => {
297 let mut h = Highlight::new(HlTag::Symbol(SymbolKind::Field)); 297 let mut h = Highlight::new(HlTag::Symbol(SymbolKind::Field));
298 298
299 if Some(field.parent_def(db).krate(db)) != krate { 299 if Some(field.parent_def(db).module(db).krate()) != krate {
300 h |= HlMod::Foreign; 300 h |= HlMod::Foreign;
301 } 301 }
302 302
@@ -335,7 +335,7 @@ fn highlight_def(db: &RootDatabase, krate: Option<hir::Crate>, def: Definition)
335 if func.is_async(db) { 335 if func.is_async(db) {
336 h |= HlMod::Async; 336 h |= HlMod::Async;
337 } 337 }
338 if func.krate(db) != krate { 338 if Some(func.module(db).krate()) != krate {
339 h |= HlMod::Foreign; 339 h |= HlMod::Foreign;
340 } 340 }
341 return h; 341 return h;
@@ -348,7 +348,7 @@ fn highlight_def(db: &RootDatabase, krate: Option<hir::Crate>, def: Definition)
348 }; 348 };
349 let mut h = Highlight::new(h); 349 let mut h = Highlight::new(h);
350 350
351 if Some(adt.krate(db)) != krate { 351 if Some(adt.module(db).krate()) != krate {
352 h |= HlMod::Foreign; 352 h |= HlMod::Foreign;
353 } 353 }
354 354
@@ -357,7 +357,7 @@ fn highlight_def(db: &RootDatabase, krate: Option<hir::Crate>, def: Definition)
357 hir::ModuleDef::Variant(variant) => { 357 hir::ModuleDef::Variant(variant) => {
358 let mut h = Highlight::new(HlTag::Symbol(SymbolKind::Variant)); 358 let mut h = Highlight::new(HlTag::Symbol(SymbolKind::Variant));
359 359
360 if Some(variant.krate(db)) != krate { 360 if Some(variant.module(db).krate()) != krate {
361 h |= HlMod::Foreign; 361 h |= HlMod::Foreign;
362 } 362 }
363 363
@@ -380,7 +380,7 @@ fn highlight_def(db: &RootDatabase, krate: Option<hir::Crate>, def: Definition)
380 } 380 }
381 } 381 }
382 382
383 if konst.krate(db) != krate { 383 if Some(konst.module(db).krate()) != krate {
384 h |= HlMod::Foreign; 384 h |= HlMod::Foreign;
385 } 385 }
386 386
@@ -393,7 +393,7 @@ fn highlight_def(db: &RootDatabase, krate: Option<hir::Crate>, def: Definition)
393 h |= HlMod::Unsafe; 393 h |= HlMod::Unsafe;
394 } 394 }
395 395
396 if Some(trait_.krate(db)) != krate { 396 if Some(trait_.module(db).krate()) != krate {
397 h |= HlMod::Foreign; 397 h |= HlMod::Foreign;
398 } 398 }
399 399
@@ -416,7 +416,7 @@ fn highlight_def(db: &RootDatabase, krate: Option<hir::Crate>, def: Definition)
416 } 416 }
417 } 417 }
418 418
419 if Some(type_.krate(db)) != krate { 419 if Some(type_.module(db).krate()) != krate {
420 h |= HlMod::Foreign; 420 h |= HlMod::Foreign;
421 } 421 }
422 422
@@ -431,7 +431,7 @@ fn highlight_def(db: &RootDatabase, krate: Option<hir::Crate>, def: Definition)
431 h |= HlMod::Unsafe; 431 h |= HlMod::Unsafe;
432 } 432 }
433 433
434 if s.krate(db) != krate { 434 if Some(s.module(db).krate()) != krate {
435 h |= HlMod::Foreign; 435 h |= HlMod::Foreign;
436 } 436 }
437 437