diff --git a/configs/ext.json b/configs/ext.json new file mode 100644 index 0000000..3ef1240 --- /dev/null +++ b/configs/ext.json @@ -0,0 +1,18 @@ +{ + "comments": { + "lineComment": "//", + "blockComment": ["/*", "*/"] + }, + "brackets": [ + ["{", "}"] + ], + "autoClosingPairs": [ + ["[", "]"], + ["\"", "\""], + ["(", ")"] + ], + "surroundingPairs": [ + ["'", "'"], + ["\"", "\""] + ] +} \ No newline at end of file diff --git a/package.json b/package.json index f03631b..9c78cc7 100644 --- a/package.json +++ b/package.json @@ -101,7 +101,15 @@ "editor.detectIndentation": true, "editor.trimAutoWhitespace": true, "editor.autoClosingBrackets": "always" - } + }, + "[ext]": { + "editor.quickSuggestions": true, + "editor.tabSize": 4, + "editor.insertSpaces": false, + "editor.detectIndentation": true, + "editor.trimAutoWhitespace": true, + "editor.autoClosingBrackets": "always" + } }, "debuggers": [ { @@ -116,6 +124,11 @@ "language": "sqf", "scopeName": "source.sqf", "path": "./syntaxes/sqf.min.json" + }, + { + "language": "ext", + "scopeName": "description.ext", + "path": "./syntaxes/ext.min.json" } ], "languages": [ @@ -131,6 +144,17 @@ ".sqm" ], "configuration": "./configs/sqf.configuration.json" + }, + { + "id": "ext", + "aliases": [ + "Arma header file" + ], + "extensions": [ + ".ext", + ".hpp" + ], + "configuration": "./configs/ext.configuration.json" } ], "menus": { diff --git a/syntaxes/ext.json b/syntaxes/ext.json new file mode 100644 index 0000000..e16c3a7 --- /dev/null +++ b/syntaxes/ext.json @@ -0,0 +1,243 @@ +{ + "scopeName": "description.ext", + "fileTypes": ["ext"], + "name": "ext", + "patterns": [ + { "include": "#strings" }, + { "include": "#numbers" }, + { "include": "#comments" }, + { + "name": "storage.type", + "match": "\\b(class)\\b" + }, + { + "begin": "^\\s*((#)\\s*(include(?:_next)?|import))\\b\\s*", + "beginCaptures": { + "1": { + "name": "keyword.control.directive.$3.ext" + }, + "2": { + "name": "punctuation.definition.directive.ext" + } + }, + "end": "(?=(?://|/\\*))|(?", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ext" + } + }, + "name": "string.quoted.other.lt-gt.include.ext" + } + ] + }, + { + "begin": "(?x)\n^\\s* ((\\#)\\s*define) \\s+ # define\n((?[a-zA-Z_$][\\w$]*)) # macro name\n(?:\n (\\()\n (\n \\s* \\g \\s* # first argument\n ((,) \\s* \\g \\s*)* # additional arguments\n (?:\\.\\.\\.)? # varargs ellipsis?\n )\n (\\))\n)?", + "beginCaptures": { + "1": { + "name": "keyword.control.directive.define.c" + }, + "2": { + "name": "punctuation.definition.directive.c" + }, + "3": { + "name": "entity.name.function.preprocessor.c" + }, + "5": { + "name": "punctuation.definition.parameters.begin.c" + }, + "6": { + "name": "variable.parameter.preprocessor.c" + }, + "8": { + "name": "punctuation.separator.parameters.c" + }, + "9": { + "name": "punctuation.definition.parameters.end.c" + } + }, + "end": "(?=(?://|/\\*))|(?