diff --git a/src/ide/highlight.rs b/src/ide/highlight.rs index cf8fdd109..9180aaee7 100644 --- a/src/ide/highlight.rs +++ b/src/ide/highlight.rs @@ -261,10 +261,13 @@ fn highlight_ident(node: &LinkedNode) -> Option { let next_leaf = node.next_leaf(); if let Some(next) = &next_leaf { if node.range().end == next.offset() - && next.kind() == SyntaxKind::LeftParen - && matches!(next.parent_kind(), Some(SyntaxKind::Args | SyntaxKind::Params)) - || (next.kind() == SyntaxKind::LeftBracket - && next.parent_kind() == Some(SyntaxKind::ContentBlock)) + && ((next.kind() == SyntaxKind::LeftParen + && matches!( + next.parent_kind(), + Some(SyntaxKind::Args | SyntaxKind::Params) + )) + || (next.kind() == SyntaxKind::LeftBracket + && next.parent_kind() == Some(SyntaxKind::ContentBlock))) { return Some(Tag::Function); } diff --git a/tests/ref/compiler/highlight.png b/tests/ref/compiler/highlight.png index 182aca453..7f69fd6b2 100644 Binary files a/tests/ref/compiler/highlight.png and b/tests/ref/compiler/highlight.png differ diff --git a/tests/typ/compiler/highlight.typ b/tests/typ/compiler/highlight.typ index db2420a79..1cbeaf9d5 100644 --- a/tests/typ/compiler/highlight.typ +++ b/tests/typ/compiler/highlight.typ @@ -38,4 +38,5 @@ $ #hello() $ $ #hello.world $ $ #hello.world() $ $ #box[] $ +#if foo [] ```