From 1136a1e2472a872139ed4ab1ce098a4d1bc7564f Mon Sep 17 00:00:00 2001 From: phannebohm Date: Mon, 22 Apr 2024 17:04:36 +0200 Subject: [PATCH] Fix highlighting of `end` in `end match` (#51) Change scope of 'end match', 'end if', 'end for' from 'keyword' to 'keyword.control' --- syntaxes/metamodelica.tmGrammar.yaml | 4 ++-- test/metamodelica/Function.test.mo | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/syntaxes/metamodelica.tmGrammar.yaml b/syntaxes/metamodelica.tmGrammar.yaml index 9003d1c..2600750 100644 --- a/syntaxes/metamodelica.tmGrammar.yaml +++ b/syntaxes/metamodelica.tmGrammar.yaml @@ -62,6 +62,8 @@ patterns: # Keywords - match: \b(for|if|when|while|then|loop|end if|end when|end for|end while|else|elsewhen|break|return|each|elseif|input|output)\b name: keyword.control + - match: \b(matchcontinue|match|local|case|try|end matchcontinue|end match|end try)\b + name: keyword.control - match: \b(and|or|not)\b name: keyword.control - match: <|<\=|>|>\=|\=\=|<> @@ -72,8 +74,6 @@ patterns: name: keyword.operator.assignment - match: \b(algorithm|equation|protected|public|end|external|in|encapsulated)\b name: keyword - - match: \b(matchcontinue|match|local|case|try|end matchcontinue|end match|end try)\b - name: keyword.control # Support - match: \b(acos|asin|atan|atan2|cos|cosh|exp|log|log10|sin|sinh|tan|tanh|abs|sign|sqrt|max|min|product|sum)\b diff --git a/test/metamodelica/Function.test.mo b/test/metamodelica/Function.test.mo index 6b40ae1..fdb77d4 100644 --- a/test/metamodelica/Function.test.mo +++ b/test/metamodelica/Function.test.mo @@ -42,7 +42,7 @@ algorithm then (); // ^^^^ source.metamodelica keyword.control end match; -//^^^ source.metamodelica keyword +//^^^ source.metamodelica keyword.control // ^^^^ source.metamodelica keyword.control end myMetaModelicaFunction; //<--- source.metamodelica keyword