mirror of
https://github.com/godotengine/godot-vscode-plugin.git
synced 2025-12-31 13:48:24 +03:00
* Updated Godot icons (and removed old ones) * Improve "Debug Pinned Scene" command by making the pinned scene persist between VSCode sessions * Fix scene file highlighting not working * Fix ScenePreview not working in Godot 3 * Add buttons for relevant actions to ScenePreview items * Add internal document links for SubResource() and ExtResource() statements in scene files * Add hover for SubResource() and ExtResource() statements in scene files * Improve ability to right click -> open docs for methods of builtin types (doesn't always work) * Add a file decorator to show the pinned debug file in the filesystem view/editor tabs * Add item decorators to the Scene Preview to show Node attributes more clearly * Updated readme * Overhauled documentation viewer * Added GDScript formatter * Add (disabled) experimental providers for custom completions, semantic tokens, and tasks * Lots of internal refactoring
194 lines
6.1 KiB
JSON
194 lines
6.1 KiB
JSON
{
|
|
"scopeName": "source.gdresource",
|
|
"uuid": "e076faa2-3c52-42fa-a8e6-9a7c453c1a5b",
|
|
"patterns": [
|
|
{ "include": "#embedded_shader" },
|
|
{ "include": "#embedded_gdscript" },
|
|
{ "include": "#comment" },
|
|
{ "include": "#heading" },
|
|
{ "include": "#key_value" }
|
|
],
|
|
"repository": {
|
|
"comment": {
|
|
"captures": { "1": { "name": "punctuation.definition.comment.gdresource" } },
|
|
"match": "(;).*$\\n?",
|
|
"name": "comment.line.gdresource"
|
|
},
|
|
"embedded_shader": {
|
|
"name": "meta.embedded.block.gdshader",
|
|
"begin": "(code) = \"",
|
|
"end": "\"",
|
|
"beginCaptures": { "1": { "name": "variable.other.property.gdresource" } },
|
|
"patterns": [ { "include": "source.gdshader" } ]
|
|
},
|
|
"embedded_gdscript": {
|
|
"comment": "meta.embedded.block.gdscript",
|
|
"begin": "(script/source) = \"",
|
|
"end": "\"",
|
|
"beginCaptures": { "1": { "name": "variable.other.property.gdresource" } },
|
|
"patterns": [ { "include": "source.gdscript" } ]
|
|
},
|
|
"heading": {
|
|
"begin": "\\[([a-z_]*)\\s?",
|
|
"beginCaptures": { "1": { "name": "keyword.control.gdresource" } },
|
|
"end": "\\]",
|
|
"patterns": [
|
|
{ "include": "#heading_properties" },
|
|
{ "include": "#data" }
|
|
]
|
|
},
|
|
"heading_properties": {
|
|
"patterns": [
|
|
{
|
|
"name": "invalid.illegal.noValue.gdresource",
|
|
"match": "(\\s*[A-Za-z_\\-][A-Za-z0-9_\\-]*\\s*=)(?=\\s*$)"
|
|
},
|
|
{
|
|
"begin": "\\s*([A-Za-z_-][^\\s]*|\".+\"|'.+'|[0-9]+)\\s*(=)\\s*",
|
|
"beginCaptures": {
|
|
"1": { "name": "variable.other.property.gdresource" },
|
|
"2": { "name": "punctuation.definition.keyValue.gdresource" }
|
|
},
|
|
"end": "($|(?==)|\\,?|\\s*(?=\\}))",
|
|
"patterns": [ { "include": "#data" } ]
|
|
}
|
|
]
|
|
},
|
|
"key_value": {
|
|
"patterns": [
|
|
{
|
|
"name": "invalid.illegal.noValue.gdresource",
|
|
"match": "(\\s*[A-Za-z_\\-][A-Za-z0-9_\\-]*\\s*=)(?=\\s*$)"
|
|
},
|
|
{
|
|
"begin": "\\s*([A-Za-z_-][^\\s]*|\".+\"|'.+'|[0-9]+)\\s*(=)\\s*",
|
|
"beginCaptures": {
|
|
"1": { "name": "variable.other.property.gdresource" },
|
|
"2": { "name": "punctuation.definition.keyValue.gdresource" }
|
|
},
|
|
"end": "($|(?==)|\\,|\\s*(?=\\}))",
|
|
"patterns": [ { "include": "#data" } ]
|
|
}
|
|
]
|
|
},
|
|
"data": {
|
|
"patterns": [
|
|
{ "include": "#comment" },
|
|
{
|
|
"begin": "(?<!\\w)(\\{)\\s*",
|
|
"beginCaptures": { "1": { "name": "punctuation.definition.table.inline.gdresource" } },
|
|
"end": "\\s*(\\})(?!\\w)",
|
|
"endCaptures": { "1": { "name": "punctuation.definition.table.inline.gdresource" } },
|
|
"patterns": [
|
|
{ "include": "#key_value" },
|
|
{ "include": "#data" }
|
|
]
|
|
},
|
|
{
|
|
"begin": "(?<!\\w)(\\[)\\s*",
|
|
"beginCaptures": { "1": { "name": "punctuation.definition.array.gdresource" } },
|
|
"end": "\\s*(\\])(?!\\w)",
|
|
"endCaptures": { "1": { "name": "punctuation.definition.array.gdresource" } },
|
|
"patterns": [ { "include": "#data" } ]
|
|
},
|
|
{
|
|
"name": "string.quoted.triple.basic.block.gdresource",
|
|
"begin": "\"\"\"",
|
|
"end": "\"\"\"",
|
|
"patterns": [
|
|
{
|
|
"match": "\\\\([btnfr\"\\\\\\n/ ]|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})",
|
|
"name": "constant.character.escape.gdresource"
|
|
},
|
|
{
|
|
"match": "\\\\[^btnfr/\"\\\\\\n]",
|
|
"name": "invalid.illegal.escape.gdresource"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "support.function.any-method.gdresource",
|
|
"match": "\"res:\\/\\/[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\""
|
|
},
|
|
{
|
|
"name": "support.class.library.gdresource",
|
|
"match": "(?<=type=)\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\""
|
|
},
|
|
{
|
|
"name": "constant.character.escape.gdresource",
|
|
"match": "(?<=NodePath\\(|parent=|name=)\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\""
|
|
},
|
|
{
|
|
"name": "string.quoted.double.basic.line.gdresource",
|
|
"begin": "\"",
|
|
"end": "\"",
|
|
"patterns": [
|
|
{
|
|
"match": "\\\\([btnfr\"\\\\\\n/ ]|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})",
|
|
"name": "constant.character.escape.gdresource"
|
|
},
|
|
{
|
|
"match": "\\\\[^btnfr/\"\\\\\\n]",
|
|
"name": "invalid.illegal.escape.gdresource"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "string.quoted.single.literal.line.gdresource",
|
|
"match": "'.*?'"
|
|
},
|
|
{
|
|
"match": "(?<!\\w)(true|false)(?!\\w)",
|
|
"name": "constant.language.gdresource"
|
|
},
|
|
{
|
|
"match": "(?<!\\w)([\\+\\-]?(0|([1-9](([0-9]|_[0-9])+)?))(?:(?:\\.(0|([1-9](([0-9]|_[0-9])+)?)))?[eE][\\+\\-]?[1-9]_?[0-9]*|(?:\\.[0-9_]*)))(?!\\w)",
|
|
"name": "constant.numeric.float.gdresource"
|
|
},
|
|
{
|
|
"match": "(?<!\\w)((?:[\\+\\-]?(0|([1-9](([0-9]|_[0-9])+)?))))(?!\\w)",
|
|
"name": "constant.numeric.integer.gdresource"
|
|
},
|
|
{
|
|
"match": "(?<!\\w)([\\+\\-]?inf)(?!\\w)",
|
|
"name": "constant.numeric.inf.gdresource"
|
|
},
|
|
{
|
|
"match": "(?<!\\w)([\\+\\-]?nan)(?!\\w)",
|
|
"name": "constant.numeric.nan.gdresource"
|
|
},
|
|
{
|
|
"match": "(?<!\\w)((?:0x(([0-9a-fA-F](([0-9a-fA-F]|_[0-9a-fA-F])+)?))))(?!\\w)",
|
|
"name": "constant.numeric.hex.gdresource"
|
|
},
|
|
{
|
|
"match": "(?<!\\w)(0o[0-7](_?[0-7])*)(?!\\w)",
|
|
"name": "constant.numeric.oct.gdresource"
|
|
},
|
|
{
|
|
"match": "(?<!\\w)(0b[01](_?[01])*)(?!\\w)",
|
|
"name": "constant.numeric.bin.gdresource"
|
|
},
|
|
{
|
|
"begin": "(?<!\\w)(Vector2|Vector2i|Vector3|Vector3i|Color|Rect2|Rect2i|Array|Basis|Dictionary|Plane|Quat|RID|Rect3|Transform|Transform2D|Transform3D|AABB|String|Color|NodePath|Object|PoolByteArray|PoolIntArray|PoolRealArray|PoolStringArray|PoolVector2Array|PoolVector3Array|PoolColorArray|bool|int|float|StringName|Quaternion|PackedByteArray|PackedInt32Array|PackedInt64Array|PackedFloat32Array|PackedFloat64Array|PackedStringArray|PackedVector2Array|PackedVector2iArray|PackedVector3Array|PackedVector3iArray|PackedColorArray)(\\()\\s?",
|
|
"beginCaptures": { "1": { "name": "support.class.library.gdresource" } },
|
|
"end": "\\s?(\\))",
|
|
"patterns": [
|
|
{ "include": "#key_value" },
|
|
{ "include": "#data" }
|
|
]
|
|
},
|
|
{
|
|
"begin": "(?<!\\w)(ExtResource|SubResource)(\\()\\s?",
|
|
"beginCaptures": { "1": { "name": "keyword.control.gdresource" } },
|
|
"end": "\\s?(\\))",
|
|
"patterns": [
|
|
{ "include": "#key_value" },
|
|
{ "include": "#data" }
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|