|
@@ -181,13 +181,19 @@
|
|
|
{
|
|
|
"begin": "[\\\"\\']",
|
|
|
"end": "[\\\"\\']",
|
|
|
- "name": "constant.character.escape"
|
|
|
+ "name": "constant.character.escape",
|
|
|
+ "patterns": [
|
|
|
+ {
|
|
|
+ "match": "%",
|
|
|
+ "name": "keyword.control.flow"
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
"nodepath_function": {
|
|
|
"name": "meta.literal.nodepath.gdscript",
|
|
|
- "begin": "(get_node_or_null|has_node|find_node|get_node)\\s*(?:\\()",
|
|
|
+ "begin": "(get_node_or_null|has_node|has_node_and_resource|find_node|get_node)\\s*(?:\\()",
|
|
|
"beginCaptures": {
|
|
|
"1": {
|
|
|
"name": "entity.name.function.gdscript"
|
|
@@ -198,7 +204,13 @@
|
|
|
{
|
|
|
"begin": "[\\\"\\']",
|
|
|
"end": "[\\\"\\']",
|
|
|
- "name": "constant.character.escape"
|
|
|
+ "name": "constant.character.escape",
|
|
|
+ "patterns": [
|
|
|
+ {
|
|
|
+ "match": "%",
|
|
|
+ "name": "keyword.control.flow"
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
]
|
|
|
},
|
|
@@ -404,16 +416,62 @@
|
|
|
"name": "support.function.builtin.gdscript"
|
|
|
},
|
|
|
"builtin_get_node_shorthand": {
|
|
|
- "match": "(\\$)([\\\"\\'].*[\\\"\\']|(?:[a-zA-Z_][a-zA-Z_0-9]*/?)*)",
|
|
|
+ "patterns": [
|
|
|
+ {
|
|
|
+ "include": "#builtin_get_node_shorthand_quoted"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "include": "#builtin_get_node_shorthand_bare"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "builtin_get_node_shorthand_quoted": {
|
|
|
+ "begin": "(\\$)([\\\"\\'])",
|
|
|
+ "end": "([\\\"\\'])",
|
|
|
"name": "support.function.builtin.shorthand.gdscript",
|
|
|
- "captures": {
|
|
|
+ "beginCaptures": {
|
|
|
"1": {
|
|
|
"name": "keyword.control.flow"
|
|
|
},
|
|
|
"2": {
|
|
|
"name": "constant.character.escape"
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ "endCaptures": {
|
|
|
+ "1": {
|
|
|
+ "name": "constant.character.escape"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "patterns": [
|
|
|
+ {
|
|
|
+ "match": "%",
|
|
|
+ "name": "keyword.control.flow"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "match": "[^%]*",
|
|
|
+ "name": "constant.character.escape"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "builtin_get_node_shorthand_bare": {
|
|
|
+ "begin": "(\\$)",
|
|
|
+ "end": "[^\\w%]",
|
|
|
+ "name": "support.function.builtin.shorthand.gdscript",
|
|
|
+ "beginCaptures": {
|
|
|
+ "1": {
|
|
|
+ "name": "keyword.control.flow"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "patterns": [
|
|
|
+ {
|
|
|
+ "match": "[a-zA-Z_][a-zA-Z_0-9]*/?",
|
|
|
+ "name": "constant.character.escape"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "match": "%[a-zA-Z_][a-zA-Z_0-9]*/?",
|
|
|
+ "name": "invalid.illegal.escape.gdscript"
|
|
|
+ }
|
|
|
+ ]
|
|
|
},
|
|
|
"decorators": {
|
|
|
"match": "(@)(export|export_color_no_alpha|export_dir|export_enum|export_exp_easing|export_file|export_flags|export_flags_2d_navigation|export_flags_2d_physics|export_flags_2d_render|export_flags_3d_navigation|export_flags_3d_physics|export_flags_3d_render|export_global_dir|export_global_file|export_multiline|export_node_path|export_placeholder|export_range|icon|onready|rpc|tool|warning_ignore)\\b",
|