From bcdc36de3c8da647b6907bc1fa4ade67f1812236 Mon Sep 17 00:00:00 2001 From: Martin Azpillaga Aldalur Date: Sat, 8 Jun 2024 16:35:36 +0200 Subject: [PATCH] improve syntax grammar quality --- .../src/main/resources/package.json | 2 +- .../src/main/resources/syntax.json | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/language-server/src/main/resources/package.json b/language-server/src/main/resources/package.json index 2cecf55..227cbd5 100644 --- a/language-server/src/main/resources/package.json +++ b/language-server/src/main/resources/package.json @@ -12,7 +12,7 @@ ], "grammars": [ - {"language": "kuki", "scopeName": "main", "path": "./syntax.json"} + {"language": "kuki", "scopeName": "source.kuki", "path": "./syntax.json"} ] }, "engines": {"vscode": "^1.52.0"}, diff --git a/language-server/src/main/resources/syntax.json b/language-server/src/main/resources/syntax.json index 6436b3f..3d59234 100644 --- a/language-server/src/main/resources/syntax.json +++ b/language-server/src/main/resources/syntax.json @@ -1,22 +1,25 @@ { "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", - "scopeName": "main", + "scopeName": "source.kuki", "patterns": [ { "match": "\\b(INGREDIENTS|UTENSILS|STEPS)\\b", - "name": "keyword.control.kuki" - }, - { - "match": "\\b(the|into|in|to|for|and)\\b", - "name": "keyword.letter.kuki" + "name": "entity.name.section" }, { "match": "\\b(Mix|Slice|Place|Add|Heat|Bake|Cook|Beat|Serve|Peel|Grate|Drain|Flip)\\b", "name": "entity.name.function.kuki" }, { - "match": "\\b(\\d+(\\.\\d+)?|seconds|minutes|hours|degrees|Farenheit|g|ml)\\b", - "name": "constant.numeric.kuki" + "match": "\\b(the|into|in|to|for|and)\\b", + "name": "keyword.other.kuki" + }, + { + "match": "\\b(\\d+(\\.\\d+)?)( (seconds|minutes|hours|degrees|Farenheit|g|ml))?\\b", + "captures": { + "1": { "name": "constant.numeric.kuki"}, + "4": { "name": "storage.type.kuki"} + } }, { "match": "(:|-|\\.)",