From 7b2cdb9d95331bba87f9ae54c71b7103a10faf1c Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sun, 12 Feb 2023 20:23:52 +0100 Subject: Require colon in show rule --- src/ide/highlight.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/ide/highlight.rs') 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 { 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); } -- cgit v1.2.3