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 a2af946..f91075a 100644 --- a/package.json +++ b/package.json @@ -334,6 +334,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..a84a230 --- /dev/null +++ b/src/syntaxes/boxr.tmLanguage.json @@ -0,0 +1,51 @@ +{ + "$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(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", + "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