diff --git a/configurations/GDScript.tmLanguage.json b/configurations/GDScript.tmLanguage.json index c85f5fd..6332cd7 100644 --- a/configurations/GDScript.tmLanguage.json +++ b/configurations/GDScript.tmLanguage.json @@ -3,62 +3,20 @@ "gd" ], "scopeName": "source.gdscript", - "name": "Godot Engine GDScript", + "name": "GDScript", "patterns": [ - { "include": "#strings" }, - { "include": "#numbers" }, + { "include": "#base_expression" }, { "include": "#self" }, - { - "captures": - { - "1": - { - "name": "punctuation.definition.comment.number-sign.gdscript" - } - }, - "match": "(#).*$\\n?", - "name": "comment.line.number-sign.gdscript" - }, - { - "match": "\\b(?i:elif|else|for|if|while|break|continue|pass|and|in|is|not|or|return|onready|setget|enum|match|breakpoint)\\b", - "name": "keyword.control.gdscript" - }, - { - "match": "\\b(&&|!|\\|\\|)\\b", - "name": "keyword.operator.logical.gdscript" - }, - { - "match": "<=|>=|==|<|>|!=", - "name": "keyword.operator.comparison.gdscript" - }, - { - "match": "\\+=|-=|\\*=|/=|%=|&=|\\|=|\\*|/|%|\\+|-|<<|>>|&|\\||\\^|~", - "name": "keyword.operator.arithmetic.gdscript" - }, - { - "match": "=", - "name": "keyword.operator.assignment.gdscript" - }, - { - "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" - }, - { - "match": "\\b(?i:true|false|null)\\b", - "name": "constant.language.gdscript" - }, - { - "match": "\\b(?i:export|tool|yield)\\b", - "name": "storage.modifier.static.gdscript" - }, - { - "match": "\\bvar\\b", - "name": "storage.type.var.gdscript" - }, - { - "match": "(?=|==|<|>|!=", + "name": "keyword.operator.comparison.gdscript" + }, + "arithmetic_op": { + "match": "\\+=|-=|\\*=|/=|%=|&=|\\|=|\\*|/|%|\\+|-|<<|>>|&|\\||\\^|~", + "name": "keyword.operator.arithmetic.gdscript" + }, + "assignment_op": { + "match": "=", + "name": "keyword.operator.assignment.gdscript" + }, + + "keywords": { + "match": "\\b(?i:elif|else|for|if|while|break|continue|pass|in|is|return|onready|setget|enum|match|breakpoint|tool|extends|signal)\\b", + "name": "keyword.control.gdscript" + }, + "letter": { + "match": "\\b(?i:true|false|null)\\b", + "name": "constant.language.gdscript" + }, + "numbers": { + "patterns": [{ "match": "\\b(?i:0x\\h*)\\b", "name": "constant.numeric.integer.hexadecimal.gdscript" }, @@ -195,13 +126,149 @@ } ] }, + "const_def": { + "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" } + } + }, + "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" } + } + }, + "class_def": { + "captures": { + "1": { "name": "entity.name.type.class.gdscript" }, + "2": { "name": "class.other.gdscript" } + }, + "match": "(?<=^class)\\s+([a-zA-Z_]\\w*)\\s*(?=:)" + }, + "builtin_func": { + "match": "(?