summaryrefslogtreecommitdiff
path: root/src/ide
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-04-11 17:26:00 +0200
committerLaurenz <laurmaedje@gmail.com>2023-04-11 17:26:00 +0200
commit9984e73ff396b7da71bb19416f5ed15296d50d98 (patch)
treed727b030e5e73c9abe04cc9606973da2f84a4b28 /src/ide
parent2606034ac7e4565d0b53188ccdf446d83f0bcd59 (diff)
Fix highlighting of identifiers before brackets
Diffstat (limited to 'src/ide')
-rw-r--r--src/ide/highlight.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ide/highlight.rs b/src/ide/highlight.rs
index cf8fdd10..9180aaee 100644
--- a/src/ide/highlight.rs
+++ b/src/ide/highlight.rs
@@ -261,10 +261,13 @@ fn highlight_ident(node: &LinkedNode) -> Option<Tag> {
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);
}