Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/syntax_highlighting/highlight.rs')
| -rw-r--r-- | crates/ide/src/syntax_highlighting/highlight.rs | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/crates/ide/src/syntax_highlighting/highlight.rs b/crates/ide/src/syntax_highlighting/highlight.rs index 8abaccd253..92211e9e3a 100644 --- a/crates/ide/src/syntax_highlighting/highlight.rs +++ b/crates/ide/src/syntax_highlighting/highlight.rs @@ -703,24 +703,7 @@ fn highlight_name_ref_by_syntax( }; match parent.kind() { - EXTERN_CRATE => { - let mut h: Highlight = HlTag::Symbol(SymbolKind::Module).into(); - let is_crate_root = if let Some(extern_crate) = ast::ExternCrate::cast(parent.clone()) { - if let Some(first_segment) = extern_crate.name_ref() { - first_segment.syntax().text() == name.syntax().text() - } else { - false - } - } else { - false - }; - - if is_crate_root { - h |= HlMod::CrateRoot; - } - - h | HlMod::Library - } + EXTERN_CRATE => (HlTag::Symbol(SymbolKind::Module) | HlMod::CrateRoot).into(), METHOD_CALL_EXPR => ast::MethodCallExpr::cast(parent) .and_then(|it| highlight_method_call(sema, krate, &it, edition)) .unwrap_or_else(|| SymbolKind::Method.into()), |