diff --git a/configurations/GDScript.tmLanguage.json b/configurations/GDScript.tmLanguage.json index 666dcfc..45126be 100644 --- a/configurations/GDScript.tmLanguage.json +++ b/configurations/GDScript.tmLanguage.json @@ -6,36 +6,31 @@ "name": "GDScript", "patterns": [ { "include": "#base_expression" }, - { "include": "#self" }, { "include": "#logic_op" }, { "include": "#compare_op" }, { "include": "#arithmetic_op" }, { "include": "#assignment_op" }, { "include": "#keywords" }, + { "include": "#self" }, { "include": "#const_def" }, - { "include": "#var_def" }, + { "include": "#type_declear"}, { "include": "#class_def" }, - { "match": "\\b(?i:export|tool)\\b", "name": "storage.modifier.static.gdscript" }, { "include": "#builtinFuncs" }, - { - "match": "\\b([A-Za-z_]\\w*)\\b(?=\\s*(?:[(]))", - "name": "support.function.any-method.gdscript" - }, - { - "match": "(?<=[^.]\\.)\\b([A-Za-z_]\\w*)\\b(?![(])", - "name": "variable.other.property.gdscript" - }, - { "include": "#function-declaration" }, - - { - "match": "(?<=extends)\\s+[a-zA-Z_][a-zA-Z_0-9]*(\\.([a-zA-Z_][a-zA-Z_0-9]*))?", - "name": "entity.other.inherited-class.gdscript" - }, - { "include": "#builtinClasses" }, { "include": "#builtinProps" }, { "include": "#builtinConsts" }, - { "include": "#const_vars" } + { "include": "#const_vars" }, + { "include": "#classname"}, + { "include": "#class_new"}, + { "include": "#class_enum"}, + { "include": "#function-declaration" }, + { "include": "#function-return-type" }, + { "include": "#any-method" }, + { "include": "#any-property" }, + { + "match": "(?<=extends)\\s+[a-zA-Z_][a-zA-Z_0-9]*(\\.([a-zA-Z_][a-zA-Z_0-9]*))?", + "name": "entity.other.inherited-class.gdscript" + } ], "repository": { "comment": { @@ -96,8 +91,8 @@ }, "keywords": { - "match": "\\b(?i:elif|else|for|if|while|break|continue|pass|in|is|return|onready|setget|enum|match|breakpoint|tool|extends|signal|class|class_name)\\b", - "name": "keyword.control.gdscript" + "match": "\\b(?i:elif|else|for|if|while|break|continue|pass|in|is|return|onready|setget|enum|match|breakpoint|tool|extends|signal|class|static|export|var|const|func|new|void)\\b", + "name": "keyword.language.gdscript" }, "letter": { "match": "\\b(?i:true|false|null)\\b", @@ -130,14 +125,26 @@ "match": "\\b(?i:(const))\\s+([a-zA-Z_][a-zA-Z_0-9]*)", "captures": { "1": { "name": "storage.type.const.gdscript" }, - "2": { "name": "constant.other.gdscript" } + "2": { "name": "constant.language.gdscript" } } }, "var_def": { "match": "\\b(?i:(var))\\s+([a-zA-Z_][a-zA-Z_0-9]*)", "captures": { "1": { "name": "storage.type.var.gdscript" }, - "2": { "name": "support.member.gdscript" } + "2": { "name": "variable.language.gdscript" } + } + }, + "type_declear": { + "match": "\\:\\s*([a-zA-Z_][a-zA-Z_0-9]*)", + "captures": { + "1": { "name": "entity.name.type.class.gdscript" } + } + }, + "function-return-type": { + "match": "\\)\\s*\\-\\>\\s*([a-zA-Z_][a-zA-Z_0-9]*)\\s*\\:", + "captures": { + "1": { "name": "entity.name.type.class.gdscript" } } }, "class_def": { @@ -147,6 +154,31 @@ }, "match": "(?<=^class)\\s+([a-zA-Z_]\\w*)\\s*(?=:)" }, + "classname": { + "captures": { + "1": { + "name": "keyword.language.gdscript" + }, + "2": { + "name": "entity.other.inherited-class.gdscript" + } + }, + "match": "^(class_name)\\s+([a-zA-Z_]\\w*)" + }, + "class_new": { + "captures": { + "1": { "name": "entity.name.type.class.gdscript" }, + "2": { "name": "storage.type.new.gdscript" } + }, + "match": "\\b([a-zA-Z_][a-zA-Z_0-9]*).(new)\\(" + }, + "class_enum": { + "captures": { + "1": { "name": "entity.name.type.class.gdscript" }, + "2": { "name": "constant.language.gdscript" } + }, + "match": "\\b([A-Z][a-zA-Z_0-9]*).([A-Z_0-9]+)" + }, "builtin_func": { "match": "(?