{ "name": "GDScript (Godot Engine)", "file_extensions": [ "gd" ], "scope": "source.gdscript", "contexts": { "main": [ { "match": "(#).*$\\n?", "scope": "comment.line.number-sign.gdscript", "captures": { "1": "punctuation.definition.comment.number-sign.gdscript" } }, { "match": "^(\"\"\")", "captures": { "1": "punctuation.definition.comment.triple-quote.gdscript" }, "push": [ { "meta_scope": "comment.block.triple-quote" }, { "match": "(\"\"\")", "captures": { "1": "punctuation.definition.comment.triple-quote.gdscript" }, "pop": true } ] }, { "match": "\"", "push": [ { "meta_scope": "string.quoted.double.gdscript" }, { "match": "(?=|==|<|>|!=", "scope": "keyword.operator.comparison.gdscript" }, { "match": "\\+=|-=|\\*=|/=|%=|&=|\\|=|\\*|/|%|\\+|-|<<|>>|&|\\||\\^|~", "scope": "keyword.operator.arithmetic.gdscript" }, { "match": "=", "scope": "keyword.operator.assignment.gdscript" }, { "match": "\\b(bool|int|float|String|funcref)\\b", "scope": "support.type.basic.gdscript" }, { "match": "\\b(Vector[23]|Rect2|Matrix32?|Plane|Quat|AABB|Transform)\\b", "scope": "support.type.vector.gdscript" }, { "match": "\\b(Color|Image|NodePath|RID|Object|InputEvent)\\b", "scope": "support.type.engine.gdscript" }, { "match": "\\b(Array|Dictionary|ByteArray|IntArray|FloatArray|StringArray|Vector[23]Array|ColorArray)\\b", "scope": "support.type.container.gdscript" }, { "match": "^\\s*(?i:(class))\\s+([a-zA-Z_][a-zA-Z_0-9]*)\\s*:", "captures": { "1": "storage.type.class.gdscript", "2": "entity.name.type.class.gdscript" } }, { "match": "^\\s*(?i:(?:(static)\\s+)?(func))\\s+([a-zA-Z_][a-zA-Z_0-9]*)\\s*\\(", "captures": { "1": "storage.modifier.static-function.gdscript", "2": "storage.type.function.gdscript", "3": "entity.name.function.gdscript" }, "push": [ { "match": "\\)\\s*:", "pop": true }, { "match": "[a-zA-Z_][a-zA-Z_0-9]*", "scope": "variable.parameter.gdscript" } ] }, { "match": "^\\s*(?i:(signal))\\s+([a-zA-Z_][a-zA-Z_0-9]*)\\s*\\(", "captures": { "1": "storage.type.signal.gdscript", "2": "entity.name.function.siglan.gdscript" }, "push": [ { "match": "\\)\\s*:", "pop": true }, { "match": "[a-zA-Z_][a-zA-Z_0-9]*", "scope": "variable.parameter.gdscript" } ] }, { "match": "(?i:\\b(?:(onready)\\s+)?(var))\\s+([a-zA-Z_][a-zA-Z_0-9]*)", "captures": { "1": "keyword.other.onready.gdscript", "2": "storage.type.var.gdscript", "3": "variable.other.gdscript" } }, { "match": "\\b(?i:(const))\\s+([a-zA-Z_][a-zA-Z_0-9]*)", "captures": { "1": "storage.type.const.gdscript", "2": "variable.other.gdscript" } }, { "match": "\\b(?i:extends|assert|breakpoint)\\b", "scope": "keyword.other.gdscript" }, { "match": "(?<=extends)\\s+[a-zA-Z_][a-zA-Z_0-9]*(\\.([a-zA-Z_][a-zA-Z_0-9]*))?", "scope": "entity.other.inherited-class.gdscript" }, { "match": "\\b(?i:true|false|null)\\b", "scope": "constant.language.gdscript" }, { "match": "\\b(?i:export|tool)\\b", "scope": "storage.modifier.static.gdscript" }, { "match": "\\b((?i:setget))\\b\\s+(?:,?([a-zA-Z_][a-zA-Z_0-9]*)|([a-zA-Z_][a-zA-Z_0-9]*)\\s*,\\s*([a-zA-Z_][a-zA-Z_0-9]*))", "captures": { "1": "keyword.operator.setget.gdscript", "2": "entity.name.function.gdscript", "3": "entity.name.function.gdscript", "4": "entity.name.function.gdscript" } }, { "match": "\\b(?i:yield)\\b", "scope": "keyword.control.flow.yield.gdscript" }, { "match": "\\b(?i:var|const|onready|class|func|signal)\\b", "scope": "invalid.illegal" }, { "match": "([A-Z][a-zA-Z_0-9]*)", "scope": "entity.name.type.class-type.gdscript" }, { "match": "([a-z_][a-zA-Z_0-9]*)", "scope": "entity.name.type.variant.gdscript" }, { "match": "([a-z][a-zA-Z_0-9]*)\\s*\\(", "captures": { "1": "entity.name.function.reference.gdscript" }, "push": [ { "match": "\\)", "pop": true }, { "match": "([a-zA-Z_][a-zA-Z_0-9]*)", "scope": "variable.parameter.gdscript" } ] } ] } }