summaryrefslogtreecommitdiff
path: root/src/ide/highlight.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ide/highlight.rs')
-rw-r--r--src/ide/highlight.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ide/highlight.rs b/src/ide/highlight.rs
index c12cb87a..7827b2c9 100644
--- a/src/ide/highlight.rs
+++ b/src/ide/highlight.rs
@@ -279,9 +279,10 @@ fn highlight_ident(node: &LinkedNode) -> Option<Tag> {
ancestor = ancestor.parent()?;
}
- // Are we directly before a show rule colon?
- if next_leaf.map(|leaf| leaf.kind()) == Some(SyntaxKind::Colon)
- && ancestor.parent_kind() == Some(SyntaxKind::ShowRule)
+ // Are we directly before or behind a show rule colon?
+ if ancestor.parent_kind() == Some(SyntaxKind::ShowRule)
+ && (next_leaf.map(|leaf| leaf.kind()) == Some(SyntaxKind::Colon)
+ || node.prev_leaf().map(|leaf| leaf.kind()) == Some(SyntaxKind::Colon))
{
return Some(Tag::Function);
}