From db07af7e8732f4b85c4339ba6eb99b89b5615621 Mon Sep 17 00:00:00 2001 From: Mark Drew Date: Fri, 18 Sep 2020 18:21:46 +0100 Subject: [PATCH 1/2] Initial implementation of the boxr syntax --- language-configuration.json | 32 ++++++++++++++++++++ package.json | 13 +++++++- src/syntaxes/boxr.tmLanguage.json | 50 +++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 language-configuration.json create mode 100644 src/syntaxes/boxr.tmLanguage.json diff --git a/language-configuration.json b/language-configuration.json new file mode 100644 index 0000000..bddd5ff --- /dev/null +++ b/language-configuration.json @@ -0,0 +1,32 @@ +{ + "comments": { + // symbol used for single line comment. Remove this entry if your language does not support line comments + "lineComment": "# " + // symbols used for start and end a block comment. Remove this entry if your language does not support block comments + //"blockComment": [ "# ", "\n" ] + }, + // symbols used as brackets + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"] + ], + // symbols that are auto closed when typing + "autoClosingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ], + // symbols that can be used to surround a selection + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"], + ["`", "`"] + ], + "wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)" +} \ No newline at end of file diff --git a/package.json b/package.json index 3872037..13dfe0f 100644 --- a/package.json +++ b/package.json @@ -295,6 +295,17 @@ } } } - ] + ], + "languages": [{ + "id": "boxr", + "aliases": ["CommandBox Recipe", "boxr"], + "extensions": ["boxr"], + "configuration": "./language-configuration.json" + }], + "grammars": [{ + "language": "boxr", + "scopeName": "source.boxr", + "path": "./src/syntaxes/boxr.tmLanguage.json" + }] } } diff --git a/src/syntaxes/boxr.tmLanguage.json b/src/syntaxes/boxr.tmLanguage.json new file mode 100644 index 0000000..7802744 --- /dev/null +++ b/src/syntaxes/boxr.tmLanguage.json @@ -0,0 +1,50 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "CommandBox Recipe", + "patterns": [ + { + "include": "#keywords" + }, + { + "include": "#strings" + } + ], + "repository": { + "keywords": { + "patterns": [ + { + "name": "keyword.command.boxr", + "match": "\\b(echo|env|set|testbox|exit|task)\\b" + }, + { + "name": "keyword.function.boxr", + "match": "\\b(#\\w)\\b" + }, + { + "name": "comment.line.boxr", + "match": "# .*" + }, + { + "name": "keyword.function.boxr", + "match": "#[a-zA-Z]+" + }, + { + "name": "keyword.variable.boxr", + "match": "\\$\\{(.*)\\}" + } + ] + }, + "strings": { + "name": "string.quoted.double.boxr", + "begin": "\"", + "end": "\"", + "patterns": [ + { + "name": "constant.character.escape.boxr", + "match": "\\\\." + } + ] + } + }, + "scopeName": "source.boxr" +} \ No newline at end of file From 8250c58691cd1236613cb81696b38f2ce3f1d3a3 Mon Sep 17 00:00:00 2001 From: Mark Drew Date: Fri, 18 Sep 2020 18:24:09 +0100 Subject: [PATCH 2/2] Adding all the obvious commands --- src/syntaxes/boxr.tmLanguage.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/syntaxes/boxr.tmLanguage.json b/src/syntaxes/boxr.tmLanguage.json index 7802744..a84a230 100644 --- a/src/syntaxes/boxr.tmLanguage.json +++ b/src/syntaxes/boxr.tmLanguage.json @@ -14,7 +14,8 @@ "patterns": [ { "name": "keyword.command.boxr", - "match": "\\b(echo|env|set|testbox|exit|task)\\b" + "match": "\\b(exit|assertEqual|assertTrue|audit|browse|cat|cd|cfformat|cflint|cfml|checksum|clear|cp|delete|dir|echo|edit|execute|fixinator|forEach|help|history|info|mkdir|mv|norris|pathExists|prompt|pwd|quit|recipe|repl|run|scan-package|sed|sort|system-colors|system-log|tail|tokenReplace|touch|unique|upgrade|version|artifacts|cachebox|cfconfig|chuck|coldbox|config|contentbox|endpoint|env|forgebox|fr|fusionreactor|game|githooks|java|logbox|package|propertyFile|server|task|testbox|utils|wirebox)\\b" + }, { "name": "keyword.function.boxr",