| 1 |
{ |
| 2 |
"fileTypes": ["gd"], |
| 3 |
"scopeName": "source.gdscript", |
| 4 |
"name": "gdscript", |
| 5 |
"patterns": [ |
| 6 |
{ |
| 7 |
"include": "#nodepath_object" |
| 8 |
}, |
| 9 |
{ |
| 10 |
"include": "#base_expression" |
| 11 |
}, |
| 12 |
{ |
| 13 |
"include": "#logic_op" |
| 14 |
}, |
| 15 |
{ |
| 16 |
"include": "#in_keyword" |
| 17 |
}, |
| 18 |
{ |
| 19 |
"include": "#getter_setter_godot4" |
| 20 |
}, |
| 21 |
{ |
| 22 |
"include": "#compare_op" |
| 23 |
}, |
| 24 |
{ |
| 25 |
"include": "#arithmetic_op" |
| 26 |
}, |
| 27 |
{ |
| 28 |
"include": "#assignment_op" |
| 29 |
}, |
| 30 |
{ |
| 31 |
"include": "#lambda_declaration" |
| 32 |
}, |
| 33 |
{ |
| 34 |
"include": "#control_flow" |
| 35 |
}, |
| 36 |
{ |
| 37 |
"include": "#annotations" |
| 38 |
}, |
| 39 |
{ |
| 40 |
"include": "#keywords" |
| 41 |
}, |
| 42 |
{ |
| 43 |
"include": "#self" |
| 44 |
}, |
| 45 |
{ |
| 46 |
"include": "#class_definition" |
| 47 |
}, |
| 48 |
{ |
| 49 |
"include": "#variable_definition" |
| 50 |
}, |
| 51 |
{ |
| 52 |
"include": "#class_name" |
| 53 |
}, |
| 54 |
{ |
| 55 |
"include": "#builtin_func" |
| 56 |
}, |
| 57 |
{ |
| 58 |
"include": "#builtin_get_node_shorthand" |
| 59 |
}, |
| 60 |
{ |
| 61 |
"include": "#builtin_classes" |
| 62 |
}, |
| 63 |
{ |
| 64 |
"include": "#const_vars" |
| 65 |
}, |
| 66 |
{ |
| 67 |
"include": "#pascal_case_class" |
| 68 |
}, |
| 69 |
{ |
| 70 |
"include": "#class_new" |
| 71 |
}, |
| 72 |
{ |
| 73 |
"include": "#class_is" |
| 74 |
}, |
| 75 |
{ |
| 76 |
"include": "#class_enum" |
| 77 |
}, |
| 78 |
{ |
| 79 |
"include": "#signal_declaration_bare" |
| 80 |
}, |
| 81 |
{ |
| 82 |
"include": "#signal_declaration" |
| 83 |
}, |
| 84 |
{ |
| 85 |
"include": "#function_declaration" |
| 86 |
}, |
| 87 |
{ |
| 88 |
"include": "#function_keyword" |
| 89 |
}, |
| 90 |
{ |
| 91 |
"include": "#any_method" |
| 92 |
}, |
| 93 |
{ |
| 94 |
"include": "#any_variable" |
| 95 |
}, |
| 96 |
{ |
| 97 |
"include": "#any_property" |
| 98 |
}, |
| 99 |
{ |
| 100 |
"include": "#extends" |
| 101 |
} |
| 102 |
], |
| 103 |
"repository": { |
| 104 |
"base_expression": { |
| 105 |
"patterns": [ |
| 106 |
{ |
| 107 |
"include": "#builtin_get_node_shorthand" |
| 108 |
}, |
| 109 |
{ |
| 110 |
"include": "#nodepath_object" |
| 111 |
}, |
| 112 |
{ |
| 113 |
"include": "#nodepath_function" |
| 114 |
}, |
| 115 |
{ |
| 116 |
"include": "#strings" |
| 117 |
}, |
| 118 |
{ |
| 119 |
"include": "#keywords" |
| 120 |
}, |
| 121 |
{ |
| 122 |
"include": "#logic_op" |
| 123 |
}, |
| 124 |
{ |
| 125 |
"include": "#lambda_declaration" |
| 126 |
}, |
| 127 |
{ |
| 128 |
"include": "#in_keyword" |
| 129 |
}, |
| 130 |
{ |
| 131 |
"include": "#control_flow" |
| 132 |
}, |
| 133 |
{ |
| 134 |
"include": "#round_braces" |
| 135 |
}, |
| 136 |
{ |
| 137 |
"include": "#function_call" |
| 138 |
}, |
| 139 |
{ |
| 140 |
"include": "#comment" |
| 141 |
}, |
| 142 |
{ |
| 143 |
"include": "#self" |
| 144 |
}, |
| 145 |
{ |
| 146 |
"include": "#letter" |
| 147 |
}, |
| 148 |
{ |
| 149 |
"include": "#numbers" |
| 150 |
}, |
| 151 |
{ |
| 152 |
"include": "#builtin_func" |
| 153 |
}, |
| 154 |
{ |
| 155 |
"include": "#builtin_classes" |
| 156 |
}, |
| 157 |
{ |
| 158 |
"include": "#const_vars" |
| 159 |
}, |
| 160 |
{ |
| 161 |
"include": "#pascal_case_class" |
| 162 |
}, |
| 163 |
{ |
| 164 |
"include": "#line_continuation" |
| 165 |
} |
| 166 |
] |
| 167 |
}, |
| 168 |
"comment": { |
| 169 |
"match": "(#).*$\\n?", |
| 170 |
"name": "comment.line.number-sign.gdscript", |
| 171 |
"captures": { |
| 172 |
"1": { |
| 173 |
"name": "punctuation.definition.comment.number-sign.gdscript" |
| 174 |
} |
| 175 |
} |
| 176 |
}, |
| 177 |
"strings": { |
| 178 |
"name": "string.quoted.gdscript", |
| 179 |
"begin": "(r)?(\"\"\"|'''|\"|')", |
| 180 |
"end": "\\2", |
| 181 |
"beginCaptures": { |
| 182 |
"1": { |
| 183 |
"name": "constant.character.escape.gdscript" |
| 184 |
} |
| 185 |
}, |
| 186 |
"patterns": [ |
| 187 |
{ |
| 188 |
"name": "constant.character.escape.gdscript", |
| 189 |
"match": "\\\\." |
| 190 |
}, |
| 191 |
{ |
| 192 |
"include": "#string_formatting" |
| 193 |
} |
| 194 |
] |
| 195 |
}, |
| 196 |
"string_formatting": { |
| 197 |
"name": "meta.format.percent.gdscript", |
| 198 |
"match": "(?x)\n (\n % (\\([\\w\\s]*\\))?\n [-+#0 ]*\n (\\d+|\\*)? (\\.(\\d+|\\*))?\n ([hlL])?\n [diouxXeEfFgGcrsab%]\n )\n", |
| 199 |
"captures": { |
| 200 |
"1": { |
| 201 |
"name": "constant.character.format.placeholder.other.gdscript" |
| 202 |
} |
| 203 |
} |
| 204 |
}, |
| 205 |
"nodepath_object": { |
| 206 |
"name": "meta.literal.nodepath.gdscript", |
| 207 |
"begin": "(NodePath)\\s*(?:\\()", |
| 208 |
"beginCaptures": { |
| 209 |
"1": { |
| 210 |
"name": "support.class.library.gdscript" |
| 211 |
} |
| 212 |
}, |
| 213 |
"end": "(?:\\))", |
| 214 |
"patterns": [ |
| 215 |
{ |
| 216 |
"begin": "(\"|')", |
| 217 |
"end": "\\1", |
| 218 |
"name": "constant.character.escape.gdscript", |
| 219 |
"patterns": [ |
| 220 |
{ |
| 221 |
"match": "%", |
| 222 |
"name": "keyword.control.flow.gdscript" |
| 223 |
} |
| 224 |
] |
| 225 |
} |
| 226 |
] |
| 227 |
}, |
| 228 |
"nodepath_function": { |
| 229 |
"begin": "(get_node_or_null|has_node|has_node_and_resource|find_node|get_node)\\s*(\\()", |
| 230 |
"beginCaptures": { |
| 231 |
"1": { |
| 232 |
"name": "entity.name.function.gdscript" |
| 233 |
}, |
| 234 |
"2": { |
| 235 |
"name": "punctuation.definition.parameters.begin.gdscript" |
| 236 |
} |
| 237 |
}, |
| 238 |
"end": "(\\))", |
| 239 |
"endCaptures": { |
| 240 |
"1": { |
| 241 |
"name": "punctuation.definition.parameters.end.gdscript" |
| 242 |
} |
| 243 |
}, |
| 244 |
"patterns": [ |
| 245 |
{ |
| 246 |
"begin": "(\"|')", |
| 247 |
"end": "\\1", |
| 248 |
"name": "meta.literal.nodepath.gdscript constant.character.escape", |
| 249 |
"patterns": [ |
| 250 |
{ |
| 251 |
"match": "%", |
| 252 |
"name": "keyword.control.flow" |
| 253 |
} |
| 254 |
] |
| 255 |
} |
| 256 |
] |
| 257 |
}, |
| 258 |
"self": { |
| 259 |
"match": "\\bself\\b", |
| 260 |
"name": "variable.language.gdscript" |
| 261 |
}, |
| 262 |
"logic_op": { |
| 263 |
"match": "\\b(and|or|not|!)\\b", |
| 264 |
"name": "keyword.operator.wordlike.gdscript" |
| 265 |
}, |
| 266 |
"in_keyword": { |
| 267 |
"patterns": [ |
| 268 |
{ |
| 269 |
"begin": "\\b(for)\\b", |
| 270 |
"end": ":", |
| 271 |
"captures": { |
| 272 |
"1": { |
| 273 |
"name": "keyword.control.gdscript" |
| 274 |
} |
| 275 |
}, |
| 276 |
"patterns": [ |
| 277 |
{ |
| 278 |
"match": "\\bin\\b", |
| 279 |
"name": "keyword.control.gdscript" |
| 280 |
}, |
| 281 |
{ |
| 282 |
"include": "#base_expression" |
| 283 |
}, |
| 284 |
{ |
| 285 |
"include": "#any_variable" |
| 286 |
}, |
| 287 |
{ |
| 288 |
"include": "#any_property" |
| 289 |
} |
| 290 |
] |
| 291 |
}, |
| 292 |
{ |
| 293 |
"match": "\\bin\\b", |
| 294 |
"name": "keyword.operator.wordlike.gdscript" |
| 295 |
} |
| 296 |
] |
| 297 |
}, |
| 298 |
"compare_op": { |
| 299 |
"match": "<=|>=|==|<|>|!=", |
| 300 |
"name": "keyword.operator.comparison.gdscript" |
| 301 |
}, |
| 302 |
"arithmetic_op": { |
| 303 |
"match": "\\+=|-=|\\*=|/=|%=|&=|\\|=|\\*|/|%|\\+|-|<<|>>|&|\\||\\^|~|!", |
| 304 |
"name": "keyword.operator.arithmetic.gdscript" |
| 305 |
}, |
| 306 |
"assignment_op": { |
| 307 |
"match": "=", |
| 308 |
"name": "keyword.operator.assignment.gdscript" |
| 309 |
}, |
| 310 |
"control_flow": { |
| 311 |
"match": "\\b(?:if|elif|else|while|break|continue|pass|return|match|yield|await)\\b", |
| 312 |
"name": "keyword.control.gdscript" |
| 313 |
}, |
| 314 |
"keywords": { |
| 315 |
"match": "\\b(?:class|class_name|extends|is|onready|tool|static|export|as|void|enum|preload|assert|breakpoint|rpc|sync|remote|master|puppet|slave|remotesync|mastersync|puppetsync|trait|namespace)\\b", |
| 316 |
"name": "keyword.language.gdscript" |
| 317 |
}, |
| 318 |
"letter": { |
| 319 |
"match": "\\b(?:true|false|null)\\b", |
| 320 |
"name": "constant.language.gdscript" |
| 321 |
}, |
| 322 |
"numbers": { |
| 323 |
"patterns": [ |
| 324 |
{ |
| 325 |
"match": "0b[01_]+", |
| 326 |
"name": "constant.numeric.integer.binary.gdscript" |
| 327 |
}, |
| 328 |
{ |
| 329 |
"match": "0x[0-9A-Fa-f_]+", |
| 330 |
"name": "constant.numeric.integer.hexadecimal.gdscript" |
| 331 |
}, |
| 332 |
{ |
| 333 |
"match": "[-]?([0-9_]+\\.[0-9_]*(e[\\-\\+]?[0-9_]+)?)", |
| 334 |
"name": "constant.numeric.float.gdscript" |
| 335 |
}, |
| 336 |
{ |
| 337 |
"match": "[-]?(\\.[0-9_]+(e[\\-\\+]?[0-9_]+)?)", |
| 338 |
"name": "constant.numeric.float.gdscript" |
| 339 |
}, |
| 340 |
{ |
| 341 |
"match": "[-]?([0-9_]+e[\\-\\+]?\\[0-9_])", |
| 342 |
"name": "constant.numeric.float.gdscript" |
| 343 |
}, |
| 344 |
{ |
| 345 |
"match": "[-]?[0-9_]+", |
| 346 |
"name": "constant.numeric.integer.gdscript" |
| 347 |
} |
| 348 |
] |
| 349 |
}, |
| 350 |
"variable_definition": { |
| 351 |
"begin": "\\b(?:(var)|(const))\\s+([a-zA-Z_]\\w*)\\s*", |
| 352 |
"end": "$|;", |
| 353 |
"beginCaptures": { |
| 354 |
"1": { |
| 355 |
"name": "keyword.language.gdscript storage.type.var.gdscript" |
| 356 |
}, |
| 357 |
"2": { |
| 358 |
"name": "keyword.language.gdscript storage.type.const.gdscript" |
| 359 |
}, |
| 360 |
"3": { |
| 361 |
"name": "variable.other.gdscript" |
| 362 |
} |
| 363 |
}, |
| 364 |
"patterns": [ |
| 365 |
{ |
| 366 |
"match": "(:)\\s*([a-zA-Z_]\\w*)?", |
| 367 |
"captures": { |
| 368 |
"1": { |
| 369 |
"name": "punctuation.separator.annotation.gdscript" |
| 370 |
}, |
| 371 |
"2": { |
| 372 |
"name": "entity.name.type.class.gdscript" |
| 373 |
} |
| 374 |
} |
| 375 |
}, |
| 376 |
{ |
| 377 |
"match": "=(?!=)", |
| 378 |
"name": "keyword.operator.assignment.gdscript" |
| 379 |
}, |
| 380 |
{ |
| 381 |
"match": "(setget)\\s+([a-zA-Z_]\\w*)(?:[,]\\s*([a-zA-Z_]\\w*))?", |
| 382 |
"captures": { |
| 383 |
"1": { |
| 384 |
"name": "keyword.language.gdscript storage.type.const.gdscript" |
| 385 |
}, |
| 386 |
"2": { |
| 387 |
"name": "entity.name.function.gdscript" |
| 388 |
}, |
| 389 |
"3": { |
| 390 |
"name": "entity.name.function.gdscript" |
| 391 |
} |
| 392 |
} |
| 393 |
}, |
| 394 |
{ |
| 395 |
"include": "#base_expression" |
| 396 |
}, |
| 397 |
{ |
| 398 |
"include": "#letter" |
| 399 |
}, |
| 400 |
{ |
| 401 |
"include": "#any_variable" |
| 402 |
}, |
| 403 |
{ |
| 404 |
"include": "#any_property" |
| 405 |
}, |
| 406 |
{ |
| 407 |
"include": "#keywords" |
| 408 |
} |
| 409 |
] |
| 410 |
}, |
| 411 |
"getter_setter_godot4": { |
| 412 |
"patterns": [ |
| 413 |
{ |
| 414 |
"match": "\\b(get):", |
| 415 |
"captures": { |
| 416 |
"1": { |
| 417 |
"name": "entity.name.function.gdscript" |
| 418 |
} |
| 419 |
} |
| 420 |
}, |
| 421 |
{ |
| 422 |
"name": "meta.function.gdscript", |
| 423 |
"begin": "(?x) \\s+\n (set) \\s*\n (?=\\()", |
| 424 |
"end": "(:|(?=[#'\"\\n]))", |
| 425 |
"beginCaptures": { |
| 426 |
"1": { |
| 427 |
"name": "entity.name.function.gdscript" |
| 428 |
} |
| 429 |
}, |
| 430 |
"patterns": [ |
| 431 |
{ |
| 432 |
"include": "#parameters" |
| 433 |
}, |
| 434 |
{ |
| 435 |
"include": "#line_continuation" |
| 436 |
}, |
| 437 |
{ |
| 438 |
"match": "\\s*(\\-\\>)\\s*([a-zA-Z_]\\w*)\\s*\\:", |
| 439 |
"captures": { |
| 440 |
"1": {}, |
| 441 |
"2": { |
| 442 |
"name": "entity.name.type.class.gdscript" |
| 443 |
} |
| 444 |
} |
| 445 |
} |
| 446 |
] |
| 447 |
} |
| 448 |
] |
| 449 |
}, |
| 450 |
"class_definition": { |
| 451 |
"match": "(?<=^class)\\s+([a-zA-Z_]\\w*)\\s*(?=:)", |
| 452 |
"captures": { |
| 453 |
"1": { |
| 454 |
"name": "entity.name.type.class.gdscript" |
| 455 |
}, |
| 456 |
"2": { |
| 457 |
"name": "class.other.gdscript" |
| 458 |
} |
| 459 |
} |
| 460 |
}, |
| 461 |
"class_new": { |
| 462 |
"match": "\\b([a-zA-Z_]\\w*).(new)\\(", |
| 463 |
"captures": { |
| 464 |
"1": { |
| 465 |
"name": "entity.name.type.class.gdscript" |
| 466 |
}, |
| 467 |
"2": { |
| 468 |
"name": "storage.type.new.gdscript" |
| 469 |
}, |
| 470 |
"3": { |
| 471 |
"name": "punctuation.parenthesis.begin.gdscript" |
| 472 |
} |
| 473 |
} |
| 474 |
}, |
| 475 |
"class_is": { |
| 476 |
"match": "\\s+(is)\\s+([a-zA-Z_]\\w*)", |
| 477 |
"captures": { |
| 478 |
"1": { |
| 479 |
"name": "storage.type.is.gdscript" |
| 480 |
}, |
| 481 |
"2": { |
| 482 |
"name": "entity.name.type.class.gdscript" |
| 483 |
} |
| 484 |
} |
| 485 |
}, |
| 486 |
"class_enum": { |
| 487 |
"captures": { |
| 488 |
"1": { |
| 489 |
"name": "entity.name.type.class.gdscript" |
| 490 |
}, |
| 491 |
"2": { |
| 492 |
"name": "constant.language.gdscript" |
| 493 |
} |
| 494 |
}, |
| 495 |
"match": "\\b([A-Z][a-zA-Z_0-9]*)\\.([A-Z_0-9]+)" |
| 496 |
}, |
| 497 |
"class_name": { |
| 498 |
"captures": { |
| 499 |
"1": { |
| 500 |
"name": "entity.name.type.class.gdscript" |
| 501 |
}, |
| 502 |
"2": { |
| 503 |
"name": "class.other.gdscript" |
| 504 |
} |
| 505 |
}, |
| 506 |
"match": "(?<=class_name)\\s+([a-zA-Z_]\\w*(\\.([a-zA-Z_]\\w*))?)" |
| 507 |
}, |
| 508 |
"extends": { |
| 509 |
"match": "(?<=extends)\\s+[a-zA-Z_]\\w*(\\.([a-zA-Z_]\\w*))?", |
| 510 |
"name": "entity.other.inherited-class.gdscript" |
| 511 |
}, |
| 512 |
"builtin_func": { |
| 513 |
"match": "(?<![^.]\\.|:)\\b(abs|absf|absi|acos|asin|assert|atan|atan2|bytes2var|bytes2var_with_objects|ceil|char|clamp|clampf|clampi|Color8|convert|cos|cosh|cubic_interpolate|db2linear|decimals|dectime|deg2rad|dict2inst|ease|error_string|exp|floor|fmod|fposmod|funcref|get_stack|hash|inst2dict|instance_from_id|inverse_lerp|is_equal_approx|is_inf|is_instance_id_valid|is_instance_valid|is_nan|is_zero_approx|len|lerp|lerp_angle|linear2db|load|log|max|maxf|maxi|min|minf|mini|move_toward|nearest_po2|pingpong|posmod|pow|preload|print|printerr|printraw|prints|printt|print_debug|print_stack|print_verbose|push_error|push_warning|rad2deg|randf|randfn|randf_range|randi|randi_range|randomize|rand_from_seed|rand_range|rand_seed|range|range_lerp|range_step_decimals|rid_allocate_id|rid_from_int64|round|seed|sign|signf|signi|sin|sinh|smoothstep|snapped|sqrt|stepify|step_decimals|str|str2var|tan|tanh|typeof|type_exists|var2bytes|var2bytes_with_objects|var2str|weakref|wrapf|wrapi|yield)\\b(?=(\\()([^)]*)(\\)))", |
| 514 |
"name": "support.function.builtin.gdscript" |
| 515 |
}, |
| 516 |
"builtin_get_node_shorthand": { |
| 517 |
"patterns": [ |
| 518 |
{ |
| 519 |
"include": "#builtin_get_node_shorthand_quoted" |
| 520 |
}, |
| 521 |
{ |
| 522 |
"include": "#builtin_get_node_shorthand_bare" |
| 523 |
} |
| 524 |
] |
| 525 |
}, |
| 526 |
"builtin_get_node_shorthand_quoted": { |
| 527 |
"name": "meta.literal.nodepath.gdscript constant.character.escape.gdscript", |
| 528 |
"begin": "(?:(\\$)|(&|\\^|@))(\"|')", |
| 529 |
"beginCaptures": { |
| 530 |
"1": { |
| 531 |
"name": "keyword.control.flow.gdscript" |
| 532 |
}, |
| 533 |
"2": { |
| 534 |
"name": "variable.other.enummember.gdscript" |
| 535 |
} |
| 536 |
}, |
| 537 |
"end": "(\\3)", |
| 538 |
"patterns": [ |
| 539 |
{ |
| 540 |
"match": "%", |
| 541 |
"name": "keyword.control.flow" |
| 542 |
} |
| 543 |
] |
| 544 |
}, |
| 545 |
"builtin_get_node_shorthand_bare": { |
| 546 |
"name": "meta.literal.nodepath.gdscript", |
| 547 |
"begin": "(\\$|%|\\$%)([a-zA-Z_]\\w*/?)", |
| 548 |
"beginCaptures": { |
| 549 |
"1": { |
| 550 |
"name": "keyword.control.flow.gdscript" |
| 551 |
}, |
| 552 |
"2": { |
| 553 |
"name": "constant.character.escape.gdscript" |
| 554 |
} |
| 555 |
}, |
| 556 |
"end": "[^\\w%]", |
| 557 |
"patterns": [ |
| 558 |
{ |
| 559 |
"match": "(%)?([a-zA-Z_]\\w*/?)", |
| 560 |
"captures": { |
| 561 |
"1": { |
| 562 |
"name": "keyword.control.flow.gdscript" |
| 563 |
}, |
| 564 |
"2": { |
| 565 |
"name": "constant.character.escape.gdscript" |
| 566 |
} |
| 567 |
} |
| 568 |
} |
| 569 |
] |
| 570 |
}, |
| 571 |
"annotations": { |
| 572 |
"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|abstract)\\b", |
| 573 |
"captures": { |
| 574 |
"1": { |
| 575 |
"name": "entity.name.function.decorator.gdscript" |
| 576 |
}, |
| 577 |
"2": { |
| 578 |
"name": "entity.name.function.decorator.gdscript" |
| 579 |
} |
| 580 |
} |
| 581 |
}, |
| 582 |
"builtin_classes": { |
| 583 |
"match": "(?<![^.]\\.|:)\\b(OS|GDScript|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|super)\\b", |
| 584 |
"name": "entity.name.type.class.builtin.gdscript" |
| 585 |
}, |
| 586 |
"const_vars": { |
| 587 |
"match": "\\b([A-Z_][A-Z_0-9]*)\\b", |
| 588 |
"name": "constant.language.gdscript" |
| 589 |
}, |
| 590 |
"pascal_case_class": { |
| 591 |
"match": "\\b([A-Z][a-z_0-9]*([A-Z]?[a-z_0-9]+)*[A-Z]?)\\b", |
| 592 |
"name": "entity.name.type.class.gdscript" |
| 593 |
}, |
| 594 |
"signal_declaration_bare": { |
| 595 |
"match": "(?x) \\s*\n (signal) \\s+\n ([a-zA-Z_]\\w*)(?=[\\n\\s])", |
| 596 |
"captures": { |
| 597 |
"1": { |
| 598 |
"name": "keyword.language.gdscript storage.type.function.gdscript" |
| 599 |
}, |
| 600 |
"2": { |
| 601 |
"name": "entity.name.function.gdscript" |
| 602 |
} |
| 603 |
} |
| 604 |
}, |
| 605 |
"signal_declaration": { |
| 606 |
"name": "meta.signal.gdscript", |
| 607 |
"begin": "(?x) \\s*\n (signal) \\s+\n ([a-zA-Z_]\\w*) \\s*\n (?=\\()", |
| 608 |
"end": "((?=[#'\"\\n]))", |
| 609 |
"beginCaptures": { |
| 610 |
"1": { |
| 611 |
"name": "keyword.language.gdscript storage.type.function.gdscript" |
| 612 |
}, |
| 613 |
"2": { |
| 614 |
"name": "entity.name.function.gdscript" |
| 615 |
} |
| 616 |
}, |
| 617 |
"patterns": [ |
| 618 |
{ |
| 619 |
"include": "#parameters" |
| 620 |
}, |
| 621 |
{ |
| 622 |
"include": "#line_continuation" |
| 623 |
}, |
| 624 |
{ |
| 625 |
"match": "\\s*(\\-\\>)\\s*([a-zA-Z_]\\w*)\\s*\\:", |
| 626 |
"captures": { |
| 627 |
"1": {}, |
| 628 |
"2": { |
| 629 |
"name": "entity.name.type.class.gdscript" |
| 630 |
} |
| 631 |
} |
| 632 |
} |
| 633 |
] |
| 634 |
}, |
| 635 |
"lambda_declaration": { |
| 636 |
"name": "meta.function.gdscript", |
| 637 |
"begin": "(func)\\s?(?=\\()", |
| 638 |
"end": "(:|(?=[#'\"\\n]))", |
| 639 |
"beginCaptures": { |
| 640 |
"1": { |
| 641 |
"name": "keyword.language.gdscript storage.type.function.gdscript" |
| 642 |
}, |
| 643 |
"2": { |
| 644 |
"name": "entity.name.function.gdscript" |
| 645 |
} |
| 646 |
}, |
| 647 |
"patterns": [ |
| 648 |
{ |
| 649 |
"include": "#parameters" |
| 650 |
}, |
| 651 |
{ |
| 652 |
"include": "#line_continuation" |
| 653 |
}, |
| 654 |
{ |
| 655 |
"match": "\\s*(?:\\-\\>)\\s*(void\\w*)|([a-zA-Z_]\\w*)\\s*\\:", |
| 656 |
"captures": { |
| 657 |
"1": { |
| 658 |
"name": "keyword.language.void.gdscript" |
| 659 |
}, |
| 660 |
"2": { |
| 661 |
"name": "entity.name.type.class.gdscript" |
| 662 |
} |
| 663 |
} |
| 664 |
}, |
| 665 |
{ |
| 666 |
"include": "#base_expression" |
| 667 |
}, |
| 668 |
{ |
| 669 |
"include": "#any_variable" |
| 670 |
}, |
| 671 |
{ |
| 672 |
"include": "#any_property" |
| 673 |
} |
| 674 |
] |
| 675 |
}, |
| 676 |
"function_declaration": { |
| 677 |
"name": "meta.function.gdscript", |
| 678 |
"begin": "(?x) \\s*\n (func) \\s+\n ([a-zA-Z_]\\w*) \\s*\n (?=\\()", |
| 679 |
"end": "((:)|(?=[#'\"\\n]))", |
| 680 |
"beginCaptures": { |
| 681 |
"1": { |
| 682 |
"name": "keyword.language.gdscript storage.type.function.gdscript" |
| 683 |
}, |
| 684 |
"2": { |
| 685 |
"name": "entity.name.function.gdscript" |
| 686 |
} |
| 687 |
}, |
| 688 |
"endCaptures": { |
| 689 |
"1": { |
| 690 |
"name": "punctuation.section.function.begin.gdscript" |
| 691 |
} |
| 692 |
}, |
| 693 |
"patterns": [ |
| 694 |
{ |
| 695 |
"include": "#parameters" |
| 696 |
}, |
| 697 |
{ |
| 698 |
"include": "#line_continuation" |
| 699 |
}, |
| 700 |
{ |
| 701 |
"match": "\\s*(?:\\-\\>)\\s*(void\\w*)|([a-zA-Z_]\\w*)\\s*\\:", |
| 702 |
"captures": { |
| 703 |
"1": { |
| 704 |
"name": "keyword.language.void.gdscript" |
| 705 |
}, |
| 706 |
"2": { |
| 707 |
"name": "entity.name.type.class.gdscript" |
| 708 |
} |
| 709 |
} |
| 710 |
}, |
| 711 |
{ |
| 712 |
"include": "#base_expression" |
| 713 |
} |
| 714 |
] |
| 715 |
}, |
| 716 |
"function_keyword": { |
| 717 |
"match": "func", |
| 718 |
"name": "keyword.language.gdscript" |
| 719 |
}, |
| 720 |
"parameters": { |
| 721 |
"name": "meta.function.parameters.gdscript", |
| 722 |
"begin": "(\\()", |
| 723 |
"end": "(\\))", |
| 724 |
"beginCaptures": { |
| 725 |
"1": { |
| 726 |
"name": "punctuation.definition.parameters.begin.gdscript" |
| 727 |
} |
| 728 |
}, |
| 729 |
"endCaptures": { |
| 730 |
"1": { |
| 731 |
"name": "punctuation.definition.parameters.end.gdscript" |
| 732 |
} |
| 733 |
}, |
| 734 |
"patterns": [ |
| 735 |
{ |
| 736 |
"include": "#annotated_parameter" |
| 737 |
}, |
| 738 |
{ |
| 739 |
"match": "(?x)\n ([a-zA-Z_]\\w*)\n \\s* (?: (,) | (?=[)#\\n=]))\n", |
| 740 |
"captures": { |
| 741 |
"1": { |
| 742 |
"name": "variable.parameter.function.language.gdscript" |
| 743 |
}, |
| 744 |
"2": { |
| 745 |
"name": "punctuation.separator.parameters.gdscript" |
| 746 |
} |
| 747 |
} |
| 748 |
}, |
| 749 |
{ |
| 750 |
"include": "#comment" |
| 751 |
}, |
| 752 |
{ |
| 753 |
"include": "#loose_default" |
| 754 |
} |
| 755 |
] |
| 756 |
}, |
| 757 |
"loose_default": { |
| 758 |
"begin": "(=)", |
| 759 |
"end": "(,)|(?=\\))", |
| 760 |
"beginCaptures": { |
| 761 |
"1": { |
| 762 |
"name": "keyword.operator.gdscript" |
| 763 |
} |
| 764 |
}, |
| 765 |
"endCaptures": { |
| 766 |
"1": { |
| 767 |
"name": "punctuation.separator.parameters.gdscript" |
| 768 |
} |
| 769 |
}, |
| 770 |
"patterns": [ |
| 771 |
{ |
| 772 |
"include": "#base_expression" |
| 773 |
} |
| 774 |
] |
| 775 |
}, |
| 776 |
"annotated_parameter": { |
| 777 |
"begin": "(?x)\n \\b\n ([a-zA-Z_]\\w*) \\s* (:)\n", |
| 778 |
"end": "(,)|(?=\\))", |
| 779 |
"beginCaptures": { |
| 780 |
"1": { |
| 781 |
"name": "variable.parameter.function.language.gdscript" |
| 782 |
}, |
| 783 |
"2": { |
| 784 |
"name": "punctuation.separator.annotation.gdscript" |
| 785 |
} |
| 786 |
}, |
| 787 |
"endCaptures": { |
| 788 |
"1": { |
| 789 |
"name": "punctuation.separator.parameters.gdscript" |
| 790 |
} |
| 791 |
}, |
| 792 |
"patterns": [ |
| 793 |
{ |
| 794 |
"include": "#base_expression" |
| 795 |
}, |
| 796 |
{ |
| 797 |
"name": "keyword.operator.assignment.gdscript", |
| 798 |
"match": "=(?!=)" |
| 799 |
} |
| 800 |
] |
| 801 |
}, |
| 802 |
"round_braces": { |
| 803 |
"begin": "\\(", |
| 804 |
"end": "\\)", |
| 805 |
"beginCaptures": { |
| 806 |
"0": { |
| 807 |
"name": "punctuation.parenthesis.begin.gdscript" |
| 808 |
} |
| 809 |
}, |
| 810 |
"endCaptures": { |
| 811 |
"0": { |
| 812 |
"name": "punctuation.parenthesis.end.gdscript" |
| 813 |
} |
| 814 |
}, |
| 815 |
"patterns": [ |
| 816 |
{ |
| 817 |
"include": "#base_expression" |
| 818 |
}, |
| 819 |
{ |
| 820 |
"include": "#any_variable" |
| 821 |
} |
| 822 |
] |
| 823 |
}, |
| 824 |
"line_continuation": { |
| 825 |
"patterns": [ |
| 826 |
{ |
| 827 |
"match": "(\\\\)\\s*(\\S.*$\\n?)", |
| 828 |
"captures": { |
| 829 |
"1": { |
| 830 |
"name": "punctuation.separator.continuation.line.gdscript" |
| 831 |
}, |
| 832 |
"2": { |
| 833 |
"name": "invalid.illegal.line.continuation.gdscript" |
| 834 |
} |
| 835 |
} |
| 836 |
}, |
| 837 |
{ |
| 838 |
"begin": "(\\\\)\\s*$\\n?", |
| 839 |
"end": "(?x)\n (?=^\\s*$)\n |\n (?! (\\s* [rR]? (\\'\\'\\'|\\\"\\\"\\\"|\\'|\\\"))\n |\n (\\G $) (?# '\\G' is necessary for ST)\n )\n", |
| 840 |
"beginCaptures": { |
| 841 |
"1": { |
| 842 |
"name": "punctuation.separator.continuation.line.gdscript" |
| 843 |
} |
| 844 |
}, |
| 845 |
"patterns": [ |
| 846 |
{ |
| 847 |
"include": "#base_expression" |
| 848 |
} |
| 849 |
] |
| 850 |
} |
| 851 |
] |
| 852 |
}, |
| 853 |
"any_method": { |
| 854 |
"match": "\\b([A-Za-z_]\\w*)\\b(?=\\s*(?:[(]))", |
| 855 |
"name": "support.function.any-method.gdscript" |
| 856 |
}, |
| 857 |
"any_variable": { |
| 858 |
"match": "\\b(?<![@\\$#%])([A-Za-z_]\\w*)\\b(?![(])", |
| 859 |
"name": "variable.other.gdscript" |
| 860 |
}, |
| 861 |
"any_property": { |
| 862 |
"match": "\\b(\\.)\\s*(?<![@\\$#%])([A-Za-z_]\\w*)\\b(?![(])", |
| 863 |
"captures": { |
| 864 |
"1": { |
| 865 |
"name": "punctuation.accessor.gdscript" |
| 866 |
}, |
| 867 |
"2": { |
| 868 |
"name": "variable.other.property.gdscript" |
| 869 |
} |
| 870 |
} |
| 871 |
}, |
| 872 |
"function_call": { |
| 873 |
"name": "meta.function-call.gdscript", |
| 874 |
"comment": "Regular function call of the type \"name(args)\"", |
| 875 |
"begin": "(?x)\n \\b(?=\n ([a-zA-Z_]\\w*) \\s* (\\()\n )\n", |
| 876 |
"end": "(\\))", |
| 877 |
"endCaptures": { |
| 878 |
"1": { |
| 879 |
"name": "punctuation.definition.arguments.end.gdscript" |
| 880 |
} |
| 881 |
}, |
| 882 |
"patterns": [ |
| 883 |
{ |
| 884 |
"include": "#function_name" |
| 885 |
}, |
| 886 |
{ |
| 887 |
"include": "#function_arguments" |
| 888 |
} |
| 889 |
] |
| 890 |
}, |
| 891 |
"function_name": { |
| 892 |
"patterns": [ |
| 893 |
{ |
| 894 |
"include": "#builtin_func" |
| 895 |
}, |
| 896 |
{ |
| 897 |
"include": "#builtin_classes" |
| 898 |
}, |
| 899 |
{ |
| 900 |
"comment": "Some color schemas support meta.function-call.generic scope", |
| 901 |
"name": "support.function.any-method.gdscript", |
| 902 |
"match": "(?x)\n \\b ([a-zA-Z_]\\w*) \\b\n" |
| 903 |
} |
| 904 |
] |
| 905 |
}, |
| 906 |
"function_arguments": { |
| 907 |
"begin": "(\\()", |
| 908 |
"end": "(?=\\))(?!\\)\\s*\\()", |
| 909 |
"beginCaptures": { |
| 910 |
"1": { |
| 911 |
"name": "punctuation.definition.arguments.begin.gdscript" |
| 912 |
} |
| 913 |
}, |
| 914 |
"contentName": "meta.function.parameters.gdscript", |
| 915 |
"patterns": [ |
| 916 |
{ |
| 917 |
"name": "punctuation.separator.arguments.gdscript", |
| 918 |
"match": "(,)" |
| 919 |
}, |
| 920 |
{ |
| 921 |
"match": "\\b([a-zA-Z_]\\w*)\\s*(=)(?!=)", |
| 922 |
"captures": { |
| 923 |
"1": { |
| 924 |
"name": "variable.parameter.function-call.gdscript" |
| 925 |
}, |
| 926 |
"2": { |
| 927 |
"name": "keyword.operator.assignment.gdscript" |
| 928 |
} |
| 929 |
} |
| 930 |
}, |
| 931 |
{ |
| 932 |
"name": "keyword.operator.assignment.gdscript", |
| 933 |
"match": "=(?!=)" |
| 934 |
}, |
| 935 |
{ |
| 936 |
"include": "#base_expression" |
| 937 |
}, |
| 938 |
{ |
| 939 |
"match": "\\s*(\\))\\s*(\\()", |
| 940 |
"captures": { |
| 941 |
"1": { |
| 942 |
"name": "punctuation.definition.arguments.end.gdscript" |
| 943 |
}, |
| 944 |
"2": { |
| 945 |
"name": "punctuation.definition.arguments.begin.gdscript" |
| 946 |
} |
| 947 |
} |
| 948 |
}, |
| 949 |
{ |
| 950 |
"include": "#letter" |
| 951 |
}, |
| 952 |
{ |
| 953 |
"include": "#any_variable" |
| 954 |
}, |
| 955 |
{ |
| 956 |
"include": "#any_property" |
| 957 |
}, |
| 958 |
{ |
| 959 |
"include": "#keywords" |
| 960 |
} |
| 961 |
] |
| 962 |
} |
| 963 |
} |
| 964 |
} |
| 965 |
|