From c32428571c3fbf12bd4a4187c797488355416a18 Mon Sep 17 00:00:00 2001 From: Aramis Razzaghipour Date: Mon, 24 May 2021 09:42:06 +1000 Subject: Remove hir krate methods --- crates/ide/src/syntax_highlighting/highlight.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'crates/ide/src/syntax_highlighting') 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, def: Definition) Definition::Macro(m) => { let mut h = Highlight::new(HlTag::Symbol(SymbolKind::Macro)); - if m.krate(db) != krate { + if m.module(db).map(hir::Module::krate) != krate { h |= HlMod::Foreign; } @@ -296,7 +296,7 @@ fn highlight_def(db: &RootDatabase, krate: Option, def: Definition) Definition::Field(field) => { let mut h = Highlight::new(HlTag::Symbol(SymbolKind::Field)); - if Some(field.parent_def(db).krate(db)) != krate { + if Some(field.parent_def(db).module(db).krate()) != krate { h |= HlMod::Foreign; } @@ -335,7 +335,7 @@ fn highlight_def(db: &RootDatabase, krate: Option, def: Definition) if func.is_async(db) { h |= HlMod::Async; } - if func.krate(db) != krate { + if Some(func.module(db).krate()) != krate { h |= HlMod::Foreign; } return h; @@ -348,7 +348,7 @@ fn highlight_def(db: &RootDatabase, krate: Option, def: Definition) }; let mut h = Highlight::new(h); - if Some(adt.krate(db)) != krate { + if Some(adt.module(db).krate()) != krate { h |= HlMod::Foreign; } @@ -357,7 +357,7 @@ fn highlight_def(db: &RootDatabase, krate: Option, def: Definition) hir::ModuleDef::Variant(variant) => { let mut h = Highlight::new(HlTag::Symbol(SymbolKind::Variant)); - if Some(variant.krate(db)) != krate { + if Some(variant.module(db).krate()) != krate { h |= HlMod::Foreign; } @@ -380,7 +380,7 @@ fn highlight_def(db: &RootDatabase, krate: Option, def: Definition) } } - if konst.krate(db) != krate { + if Some(konst.module(db).krate()) != krate { h |= HlMod::Foreign; } @@ -393,7 +393,7 @@ fn highlight_def(db: &RootDatabase, krate: Option, def: Definition) h |= HlMod::Unsafe; } - if Some(trait_.krate(db)) != krate { + if Some(trait_.module(db).krate()) != krate { h |= HlMod::Foreign; } @@ -416,7 +416,7 @@ fn highlight_def(db: &RootDatabase, krate: Option, def: Definition) } } - if Some(type_.krate(db)) != krate { + if Some(type_.module(db).krate()) != krate { h |= HlMod::Foreign; } @@ -431,7 +431,7 @@ fn highlight_def(db: &RootDatabase, krate: Option, def: Definition) h |= HlMod::Unsafe; } - if s.krate(db) != krate { + if Some(s.module(db).krate()) != krate { h |= HlMod::Foreign; } -- cgit v1.2.3