diff --git a/src/main/resources/textmate/slint.tmLanguage.json b/src/main/resources/textmate/slint.tmLanguage.json new file mode 100644 index 0000000..31e4cee --- /dev/null +++ b/src/main/resources/textmate/slint.tmLanguage.json @@ -0,0 +1,899 @@ +{ + "name": "slint", + "scopeName": "source.slint", + "foldingStartMarker": "\\{\\s*$", + "foldingStopMarker": "^\\s*\\}", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#import-list" + }, + { + "include": "#export-list" + }, + { + "include": "#struct" + }, + { + "include": "#enum" + }, + { + "include": "#global" + }, + { + "include": "#component" + }, + { + "match": "(?))", + "beginCaptures": { + "2": { + "name": "keyword.other.visibility.slint" + }, + "3": { + "name": "keyword.other.property.slint" + } + }, + "endCaptures": { + "2": { + "name": "punctuation.arrow.fat-double.slint" + } + }, + "patterns": [ + { + "match": "(<)([a-zA-Z_][a-zA-Z0-9_-]*)(>)", + "captures": { + "1": { + "name": "punctuation.brackets.angle.slint" + }, + "2": { + "name": "entity.name.type.property.slint" + }, + "3": { + "name": "punctuation.brackets.angle.slint" + } + } + }, + { + "match": "(?)\\s*([a-zA-Z_][a-zA-Z0-9_-]*))?(;|(=>))?", + "endCaptures": { + "1": { + "name": "punctuation.brackets.round.slint" + }, + "3": { + "name": "keyword.operator.arrow.skinny.slint" + }, + "4": { + "name": "entity.name.type.return-type.slint" + }, + "6": { + "name": "keyword.operator.arrow.fat.slint" + } + }, + "patterns": [ + { + "match": "\\s*(([a-zA-Z_][a-zA-Z0-9_-]*)\\s*:\\s*)?([a-zA-Z_][a-zA-Z0-9_-]*)\\s*,?\\s*", + "captures": { + "2": { + "name": "variable.parameter.function-argument.slint" + }, + "3": { + "name": "entity.name.type.function-argument.slint" + } + } + } + ] + } + ] + }, + "function-call": { + "patterns": [ + { + "begin": "(?", + "captures": { + "1": { + "name": "entity.name.function.slint" + } + } + }, + { + "begin": "(?", + "patterns": [ + { + "include": "#expression" + }, + { + "match": "\\s*,\\s*" + } + ] + } + ] + } + } +}