| 1 |
{ |
| 2 |
"scopeName": "source.gdresource", |
| 3 |
"uuid": "e076faa2-3c52-42fa-a8e6-9a7c453c1a5b", |
| 4 |
"patterns": [ |
| 5 |
{ |
| 6 |
"include": "#embedded_shader" |
| 7 |
}, |
| 8 |
{ |
| 9 |
"include": "#embedded_gdscript" |
| 10 |
}, |
| 11 |
{ |
| 12 |
"include": "#comment" |
| 13 |
}, |
| 14 |
{ |
| 15 |
"include": "#heading" |
| 16 |
}, |
| 17 |
{ |
| 18 |
"include": "#key_value" |
| 19 |
} |
| 20 |
], |
| 21 |
"repository": { |
| 22 |
"comment": { |
| 23 |
"captures": { |
| 24 |
"1": { |
| 25 |
"name": "punctuation.definition.comment.gdresource" |
| 26 |
} |
| 27 |
}, |
| 28 |
"match": "(;).*$\\n?", |
| 29 |
"name": "comment.line.gdresource" |
| 30 |
}, |
| 31 |
"embedded_shader": { |
| 32 |
"name": "meta.embedded.block.gdshader", |
| 33 |
"begin": "(code) = \"", |
| 34 |
"end": "\"", |
| 35 |
"beginCaptures": { |
| 36 |
"1": { |
| 37 |
"name": "variable.other.property.gdresource" |
| 38 |
} |
| 39 |
}, |
| 40 |
"patterns": [ |
| 41 |
{ |
| 42 |
"include": "source.gdshader" |
| 43 |
} |
| 44 |
] |
| 45 |
}, |
| 46 |
"embedded_gdscript": { |
| 47 |
"comment": "meta.embedded.block.gdscript", |
| 48 |
"begin": "(script/source) = \"", |
| 49 |
"end": "\"", |
| 50 |
"beginCaptures": { |
| 51 |
"1": { |
| 52 |
"name": "variable.other.property.gdresource" |
| 53 |
} |
| 54 |
}, |
| 55 |
"patterns": [ |
| 56 |
{ |
| 57 |
"include": "source.gdscript" |
| 58 |
} |
| 59 |
] |
| 60 |
}, |
| 61 |
"heading": { |
| 62 |
"begin": "\\[([a-z_]*)\\s?", |
| 63 |
"beginCaptures": { |
| 64 |
"1": { |
| 65 |
"name": "keyword.control.gdresource" |
| 66 |
} |
| 67 |
}, |
| 68 |
"end": "\\]", |
| 69 |
"patterns": [ |
| 70 |
{ |
| 71 |
"include": "#heading_properties" |
| 72 |
}, |
| 73 |
{ |
| 74 |
"include": "#data" |
| 75 |
} |
| 76 |
] |
| 77 |
}, |
| 78 |
"heading_properties": { |
| 79 |
"patterns": [ |
| 80 |
{ |
| 81 |
"name": "invalid.illegal.noValue.gdresource", |
| 82 |
"match": "(\\s*[A-Za-z_\\-][A-Za-z0-9_\\-]*\\s*=)(?=\\s*$)" |
| 83 |
}, |
| 84 |
{ |
| 85 |
"begin": "\\s*([A-Za-z_-][^\\s]*|\".+\"|'.+'|[0-9]+)\\s*(=)\\s*", |
| 86 |
"beginCaptures": { |
| 87 |
"1": { |
| 88 |
"name": "variable.other.property.gdresource" |
| 89 |
}, |
| 90 |
"2": { |
| 91 |
"name": "punctuation.definition.keyValue.gdresource" |
| 92 |
} |
| 93 |
}, |
| 94 |
"end": "($|(?==)|\\,?|\\s*(?=\\}))", |
| 95 |
"patterns": [ |
| 96 |
{ |
| 97 |
"include": "#data" |
| 98 |
} |
| 99 |
] |
| 100 |
} |
| 101 |
] |
| 102 |
}, |
| 103 |
"key_value": { |
| 104 |
"patterns": [ |
| 105 |
{ |
| 106 |
"name": "invalid.illegal.noValue.gdresource", |
| 107 |
"match": "(\\s*[A-Za-z_\\-][A-Za-z0-9_\\-]*\\s*=)(?=\\s*$)" |
| 108 |
}, |
| 109 |
{ |
| 110 |
"begin": "\\s*([A-Za-z_-][^\\s]*|\".+\"|'.+'|[0-9]+)\\s*(=)\\s*", |
| 111 |
"beginCaptures": { |
| 112 |
"1": { |
| 113 |
"name": "variable.other.property.gdresource" |
| 114 |
}, |
| 115 |
"2": { |
| 116 |
"name": "punctuation.definition.keyValue.gdresource" |
| 117 |
} |
| 118 |
}, |
| 119 |
"end": "($|(?==)|\\,|\\s*(?=\\}))", |
| 120 |
"patterns": [ |
| 121 |
{ |
| 122 |
"include": "#data" |
| 123 |
} |
| 124 |
] |
| 125 |
} |
| 126 |
] |
| 127 |
}, |
| 128 |
"data": { |
| 129 |
"patterns": [ |
| 130 |
{ |
| 131 |
"include": "#comment" |
| 132 |
}, |
| 133 |
{ |
| 134 |
"begin": "(?<!\\w)(\\{)\\s*", |
| 135 |
"beginCaptures": { |
| 136 |
"1": { |
| 137 |
"name": "punctuation.definition.table.inline.gdresource" |
| 138 |
} |
| 139 |
}, |
| 140 |
"end": "\\s*(\\})(?!\\w)", |
| 141 |
"endCaptures": { |
| 142 |
"1": { |
| 143 |
"name": "punctuation.definition.table.inline.gdresource" |
| 144 |
} |
| 145 |
}, |
| 146 |
"patterns": [ |
| 147 |
{ |
| 148 |
"include": "#key_value" |
| 149 |
}, |
| 150 |
{ |
| 151 |
"include": "#data" |
| 152 |
} |
| 153 |
] |
| 154 |
}, |
| 155 |
{ |
| 156 |
"begin": "(?<!\\w)(\\[)\\s*", |
| 157 |
"beginCaptures": { |
| 158 |
"1": { |
| 159 |
"name": "punctuation.definition.array.gdresource" |
| 160 |
} |
| 161 |
}, |
| 162 |
"end": "\\s*(\\])(?!\\w)", |
| 163 |
"endCaptures": { |
| 164 |
"1": { |
| 165 |
"name": "punctuation.definition.array.gdresource" |
| 166 |
} |
| 167 |
}, |
| 168 |
"patterns": [ |
| 169 |
{ |
| 170 |
"include": "#data" |
| 171 |
} |
| 172 |
] |
| 173 |
}, |
| 174 |
{ |
| 175 |
"name": "string.quoted.triple.basic.block.gdresource", |
| 176 |
"begin": "\"\"\"", |
| 177 |
"end": "\"\"\"", |
| 178 |
"patterns": [ |
| 179 |
{ |
| 180 |
"match": "\\\\([btnfr\"\\\\\\n/ ]|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})", |
| 181 |
"name": "constant.character.escape.gdresource" |
| 182 |
}, |
| 183 |
{ |
| 184 |
"match": "\\\\[^btnfr/\"\\\\\\n]", |
| 185 |
"name": "invalid.illegal.escape.gdresource" |
| 186 |
} |
| 187 |
] |
| 188 |
}, |
| 189 |
{ |
| 190 |
"name": "support.function.any-method.gdresource", |
| 191 |
"match": "\"res:\\/\\/[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"" |
| 192 |
}, |
| 193 |
{ |
| 194 |
"name": "support.class.library.gdresource", |
| 195 |
"match": "(?<=type=)\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"" |
| 196 |
}, |
| 197 |
{ |
| 198 |
"name": "constant.character.escape.gdresource", |
| 199 |
"match": "(?<=NodePath\\(|parent=|name=)\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"" |
| 200 |
}, |
| 201 |
{ |
| 202 |
"name": "string.quoted.double.basic.line.gdresource", |
| 203 |
"begin": "\"", |
| 204 |
"end": "\"", |
| 205 |
"patterns": [ |
| 206 |
{ |
| 207 |
"match": "\\\\([btnfr\"\\\\\\n/ ]|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})", |
| 208 |
"name": "constant.character.escape.gdresource" |
| 209 |
}, |
| 210 |
{ |
| 211 |
"match": "\\\\[^btnfr/\"\\\\\\n]", |
| 212 |
"name": "invalid.illegal.escape.gdresource" |
| 213 |
} |
| 214 |
] |
| 215 |
}, |
| 216 |
{ |
| 217 |
"name": "string.quoted.single.literal.line.gdresource", |
| 218 |
"match": "'.*?'" |
| 219 |
}, |
| 220 |
{ |
| 221 |
"match": "(?<!\\w)(true|false)(?!\\w)", |
| 222 |
"name": "constant.language.gdresource" |
| 223 |
}, |
| 224 |
{ |
| 225 |
"match": "(?<!\\w)([\\+\\-]?(0|([1-9](([0-9]|_[0-9])+)?))(?:(?:\\.(0|([1-9](([0-9]|_[0-9])+)?)))?[eE][\\+\\-]?[1-9]_?[0-9]*|(?:\\.[0-9_]*)))(?!\\w)", |
| 226 |
"name": "constant.numeric.float.gdresource" |
| 227 |
}, |
| 228 |
{ |
| 229 |
"match": "(?<!\\w)((?:[\\+\\-]?(0|([1-9](([0-9]|_[0-9])+)?))))(?!\\w)", |
| 230 |
"name": "constant.numeric.integer.gdresource" |
| 231 |
}, |
| 232 |
{ |
| 233 |
"match": "(?<!\\w)([\\+\\-]?inf)(?!\\w)", |
| 234 |
"name": "constant.numeric.inf.gdresource" |
| 235 |
}, |
| 236 |
{ |
| 237 |
"match": "(?<!\\w)([\\+\\-]?nan)(?!\\w)", |
| 238 |
"name": "constant.numeric.nan.gdresource" |
| 239 |
}, |
| 240 |
{ |
| 241 |
"match": "(?<!\\w)((?:0x(([0-9a-fA-F](([0-9a-fA-F]|_[0-9a-fA-F])+)?))))(?!\\w)", |
| 242 |
"name": "constant.numeric.hex.gdresource" |
| 243 |
}, |
| 244 |
{ |
| 245 |
"match": "(?<!\\w)(0o[0-7](_?[0-7])*)(?!\\w)", |
| 246 |
"name": "constant.numeric.oct.gdresource" |
| 247 |
}, |
| 248 |
{ |
| 249 |
"match": "(?<!\\w)(0b[01](_?[01])*)(?!\\w)", |
| 250 |
"name": "constant.numeric.bin.gdresource" |
| 251 |
}, |
| 252 |
{ |
| 253 |
"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?", |
| 254 |
"beginCaptures": { |
| 255 |
"1": { |
| 256 |
"name": "support.class.library.gdresource" |
| 257 |
} |
| 258 |
}, |
| 259 |
"end": "\\s?(\\))", |
| 260 |
"patterns": [ |
| 261 |
{ |
| 262 |
"include": "#key_value" |
| 263 |
}, |
| 264 |
{ |
| 265 |
"include": "#data" |
| 266 |
} |
| 267 |
] |
| 268 |
}, |
| 269 |
{ |
| 270 |
"begin": "(?<!\\w)(ExtResource|SubResource)(\\()\\s?", |
| 271 |
"beginCaptures": { |
| 272 |
"1": { |
| 273 |
"name": "keyword.control.gdresource" |
| 274 |
} |
| 275 |
}, |
| 276 |
"end": "\\s?(\\))", |
| 277 |
"patterns": [ |
| 278 |
{ |
| 279 |
"include": "#key_value" |
| 280 |
}, |
| 281 |
{ |
| 282 |
"include": "#data" |
| 283 |
} |
| 284 |
] |
| 285 |
} |
| 286 |
] |
| 287 |
} |
| 288 |
}, |
| 289 |
"name": "gdresource" |
| 290 |
} |
| 291 |
|