summaryrefslogtreecommitdiff
path: root/src/ide
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-01-03 12:29:35 +0100
committerLaurenz <laurmaedje@gmail.com>2023-01-03 12:32:17 +0100
commit29b31c4a5ac4cde311c4d38b3d70130e7d27ba76 (patch)
treefe4e5dbd2166a69af90e69578ad4602725cdb63c /src/ide
parent54962e6dcd002fd27918827996155fd7dc4e1cff (diff)
New import syntax
Diffstat (limited to 'src/ide')
-rw-r--r--src/ide/highlight.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/ide/highlight.rs b/src/ide/highlight.rs
index 1f52ae95..321bf9a6 100644
--- a/src/ide/highlight.rs
+++ b/src/ide/highlight.rs
@@ -156,7 +156,7 @@ pub fn highlight(node: &LinkedNode) -> Option<Category> {
SyntaxKind::Return => Some(Category::Keyword),
SyntaxKind::Import => Some(Category::Keyword),
SyntaxKind::Include => Some(Category::Keyword),
- SyntaxKind::From => Some(Category::Keyword),
+ SyntaxKind::As => Some(Category::Keyword),
SyntaxKind::Markup { .. }
if node.parent_kind() == Some(&SyntaxKind::TermItem)
@@ -198,6 +198,17 @@ pub fn highlight(node: &LinkedNode) -> Option<Category> {
| SyntaxKind::Frac,
) => Some(Category::Interpolated),
Some(SyntaxKind::FuncCall) => Some(Category::Function),
+ Some(SyntaxKind::FieldAccess)
+ if node
+ .parent()
+ .and_then(|p| p.parent())
+ .filter(|gp| gp.kind() == &SyntaxKind::Parenthesized)
+ .and_then(|gp| gp.parent())
+ .map_or(false, |ggp| ggp.kind() == &SyntaxKind::FuncCall)
+ && node.next_sibling().is_none() =>
+ {
+ Some(Category::Function)
+ }
Some(SyntaxKind::MethodCall) if node.prev_sibling().is_some() => {
Some(Category::Function)
}