diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-02-12 20:23:52 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-02-12 20:25:24 +0100 |
| commit | 7b2cdb9d95331bba87f9ae54c71b7103a10faf1c (patch) | |
| tree | 8b0581fd14849e6a6ceaa9527ed8534e05d2b695 /src/ide/highlight.rs | |
| parent | 77c29b36d4e8706163c8d52359577e403a15a1ae (diff) | |
Require colon in show rule
Diffstat (limited to 'src/ide/highlight.rs')
| -rw-r--r-- | src/ide/highlight.rs | 7 |
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); } |
