| 1 | { |
| 2 | "fileTypes": ["java", "bsh"], |
| 3 | "keyEquivalent": "^~J", |
| 4 | "name": "Java", |
| 5 | "patterns": [ |
| 6 | { |
| 7 | "captures": { |
| 8 | "1": { |
| 9 | "name": "keyword.other.package.java" |
| 10 | }, |
| 11 | "2": { |
| 12 | "name": "storage.modifier.package.java" |
| 13 | }, |
| 14 | "3": { |
| 15 | "name": "punctuation.terminator.java" |
| 16 | } |
| 17 | }, |
| 18 | "match": "^\\s*(package)\\b(?:\\s*([^ ;$]+)\\s*(;)?)?", |
| 19 | "name": "meta.package.java" |
| 20 | }, |
| 21 | { |
| 22 | "begin": "(import static)\\b\\s*", |
| 23 | "beginCaptures": { |
| 24 | "1": { |
| 25 | "name": "keyword.other.import.static.java" |
| 26 | } |
| 27 | }, |
| 28 | "captures": { |
| 29 | "1": { |
| 30 | "name": "keyword.other.import.java" |
| 31 | }, |
| 32 | "2": { |
| 33 | "name": "storage.modifier.import.java" |
| 34 | }, |
| 35 | "3": { |
| 36 | "name": "punctuation.terminator.java" |
| 37 | } |
| 38 | }, |
| 39 | "contentName": "storage.modifier.import.java", |
| 40 | "end": "\\s*(?:$|(;))", |
| 41 | "endCaptures": { |
| 42 | "1": { |
| 43 | "name": "punctuation.terminator.java" |
| 44 | } |
| 45 | }, |
| 46 | "name": "meta.import.java", |
| 47 | "patterns": [ |
| 48 | { |
| 49 | "match": "\\.", |
| 50 | "name": "punctuation.separator.java" |
| 51 | }, |
| 52 | { |
| 53 | "match": "\\s", |
| 54 | "name": "invalid.illegal.character_not_allowed_here.java" |
| 55 | } |
| 56 | ] |
| 57 | }, |
| 58 | { |
| 59 | "begin": "(import)\\b\\s*", |
| 60 | "beginCaptures": { |
| 61 | "1": { |
| 62 | "name": "keyword.other.import.java" |
| 63 | } |
| 64 | }, |
| 65 | "captures": { |
| 66 | "1": { |
| 67 | "name": "keyword.other.import.java" |
| 68 | }, |
| 69 | "2": { |
| 70 | "name": "storage.modifier.import.java" |
| 71 | }, |
| 72 | "3": { |
| 73 | "name": "punctuation.terminator.java" |
| 74 | } |
| 75 | }, |
| 76 | "contentName": "storage.modifier.import.java", |
| 77 | "end": "\\s*(?:$|(;))", |
| 78 | "endCaptures": { |
| 79 | "1": { |
| 80 | "name": "punctuation.terminator.java" |
| 81 | } |
| 82 | }, |
| 83 | "name": "meta.import.java", |
| 84 | "patterns": [ |
| 85 | { |
| 86 | "match": "\\.", |
| 87 | "name": "punctuation.separator.java" |
| 88 | }, |
| 89 | { |
| 90 | "match": "\\s", |
| 91 | "name": "invalid.illegal.character_not_allowed_here.java" |
| 92 | } |
| 93 | ] |
| 94 | }, |
| 95 | { |
| 96 | "include": "#code" |
| 97 | } |
| 98 | ], |
| 99 | "repository": { |
| 100 | "all-types": { |
| 101 | "patterns": [ |
| 102 | { |
| 103 | "include": "#primitive-arrays" |
| 104 | }, |
| 105 | { |
| 106 | "include": "#primitive-types" |
| 107 | }, |
| 108 | { |
| 109 | "include": "#object-types" |
| 110 | } |
| 111 | ] |
| 112 | }, |
| 113 | "annotations": { |
| 114 | "patterns": [ |
| 115 | { |
| 116 | "begin": "(@[^ (]+)(\\()", |
| 117 | "beginCaptures": { |
| 118 | "1": { |
| 119 | "name": "storage.type.annotation.java" |
| 120 | }, |
| 121 | "2": { |
| 122 | "name": "punctuation.definition.annotation-arguments.begin.java" |
| 123 | } |
| 124 | }, |
| 125 | "end": "(\\))", |
| 126 | "endCaptures": { |
| 127 | "1": { |
| 128 | "name": "punctuation.definition.annotation-arguments.end.java" |
| 129 | } |
| 130 | }, |
| 131 | "name": "meta.declaration.annotation.java", |
| 132 | "patterns": [ |
| 133 | { |
| 134 | "captures": { |
| 135 | "1": { |
| 136 | "name": "constant.other.key.java" |
| 137 | }, |
| 138 | "2": { |
| 139 | "name": "keyword.operator.assignment.java" |
| 140 | } |
| 141 | }, |
| 142 | "match": "(\\w*)\\s*(=)" |
| 143 | }, |
| 144 | { |
| 145 | "include": "#code" |
| 146 | }, |
| 147 | { |
| 148 | "match": ",", |
| 149 | "name": "punctuation.separator.property.java" |
| 150 | } |
| 151 | ] |
| 152 | }, |
| 153 | { |
| 154 | "match": "@\\w*", |
| 155 | "name": "storage.type.annotation.java" |
| 156 | } |
| 157 | ] |
| 158 | }, |
| 159 | "anonymous-classes-and-new": { |
| 160 | "begin": "\\bnew\\b", |
| 161 | "beginCaptures": { |
| 162 | "0": { |
| 163 | "name": "keyword.control.new.java" |
| 164 | } |
| 165 | }, |
| 166 | "end": "(?<=\\)|\\])(?!\\s*{)|(?<=})|(?=;)", |
| 167 | "patterns": [ |
| 168 | { |
| 169 | "begin": "(\\w+)\\s*(?=\\[)", |
| 170 | "beginCaptures": { |
| 171 | "1": { |
| 172 | "name": "storage.type.java" |
| 173 | } |
| 174 | }, |
| 175 | "end": "(})|(?=\\s*(?:,|;|\\)))", |
| 176 | "endCaptures": { |
| 177 | "1": { |
| 178 | "name": "punctuation.section.block.end.java" |
| 179 | } |
| 180 | }, |
| 181 | "patterns": [ |
| 182 | { |
| 183 | "begin": "\\[", |
| 184 | "end": "\\]", |
| 185 | "patterns": [ |
| 186 | { |
| 187 | "include": "#code" |
| 188 | } |
| 189 | ] |
| 190 | }, |
| 191 | { |
| 192 | "begin": "{", |
| 193 | "beginCaptures": { |
| 194 | "0": { |
| 195 | "name": "punctuation.section.block.begin.java" |
| 196 | } |
| 197 | }, |
| 198 | "end": "(?=})", |
| 199 | "patterns": [ |
| 200 | { |
| 201 | "include": "#code" |
| 202 | } |
| 203 | ] |
| 204 | } |
| 205 | ] |
| 206 | }, |
| 207 | { |
| 208 | "begin": "(?=\\w.*\\()", |
| 209 | "end": "(?<=\\))", |
| 210 | "patterns": [ |
| 211 | { |
| 212 | "include": "#object-types" |
| 213 | }, |
| 214 | { |
| 215 | "begin": "\\(", |
| 216 | "beginCaptures": { |
| 217 | "1": { |
| 218 | "name": "storage.type.java" |
| 219 | } |
| 220 | }, |
| 221 | "end": "\\)", |
| 222 | "patterns": [ |
| 223 | { |
| 224 | "include": "#code" |
| 225 | } |
| 226 | ] |
| 227 | } |
| 228 | ] |
| 229 | }, |
| 230 | { |
| 231 | "begin": "{", |
| 232 | "beginCaptures": { |
| 233 | "0": { |
| 234 | "name": "punctuation.section.inner-class.begin.java" |
| 235 | } |
| 236 | }, |
| 237 | "end": "}", |
| 238 | "endCaptures": { |
| 239 | "0": { |
| 240 | "name": "punctuation.section.inner-class.end.java" |
| 241 | } |
| 242 | }, |
| 243 | "name": "meta.inner-class.java", |
| 244 | "patterns": [ |
| 245 | { |
| 246 | "include": "#class-body" |
| 247 | } |
| 248 | ] |
| 249 | } |
| 250 | ] |
| 251 | }, |
| 252 | "assertions": { |
| 253 | "patterns": [ |
| 254 | { |
| 255 | "begin": "\\b(assert)\\s", |
| 256 | "beginCaptures": { |
| 257 | "1": { |
| 258 | "name": "keyword.control.assert.java" |
| 259 | } |
| 260 | }, |
| 261 | "end": "$", |
| 262 | "name": "meta.declaration.assertion.java", |
| 263 | "patterns": [ |
| 264 | { |
| 265 | "match": ":", |
| 266 | "name": "keyword.operator.assert.expression-seperator.java" |
| 267 | }, |
| 268 | { |
| 269 | "include": "#code" |
| 270 | } |
| 271 | ] |
| 272 | } |
| 273 | ] |
| 274 | }, |
| 275 | "class": { |
| 276 | "begin": "(?=\\w?[\\w\\s]*(?:class|(?:@)?interface|enum)\\s+\\w+)", |
| 277 | "end": "}", |
| 278 | "endCaptures": { |
| 279 | "0": { |
| 280 | "name": "punctuation.section.class.end.java" |
| 281 | } |
| 282 | }, |
| 283 | "name": "meta.class.java", |
| 284 | "patterns": [ |
| 285 | { |
| 286 | "include": "#storage-modifiers" |
| 287 | }, |
| 288 | { |
| 289 | "include": "#comments" |
| 290 | }, |
| 291 | { |
| 292 | "captures": { |
| 293 | "1": { |
| 294 | "name": "storage.modifier.java" |
| 295 | }, |
| 296 | "2": { |
| 297 | "name": "entity.name.type.class.java" |
| 298 | } |
| 299 | }, |
| 300 | "match": "(class|(?:@)?interface|enum)\\s+(\\w+)", |
| 301 | "name": "meta.class.identifier.java" |
| 302 | }, |
| 303 | { |
| 304 | "begin": "extends", |
| 305 | "beginCaptures": { |
| 306 | "0": { |
| 307 | "name": "storage.modifier.extends.java" |
| 308 | } |
| 309 | }, |
| 310 | "end": "(?={|implements)", |
| 311 | "name": "meta.definition.class.inherited.classes.java", |
| 312 | "patterns": [ |
| 313 | { |
| 314 | "include": "#object-types-inherited" |
| 315 | }, |
| 316 | { |
| 317 | "include": "#comments" |
| 318 | } |
| 319 | ] |
| 320 | }, |
| 321 | { |
| 322 | "begin": "(implements)\\s", |
| 323 | "beginCaptures": { |
| 324 | "1": { |
| 325 | "name": "storage.modifier.implements.java" |
| 326 | } |
| 327 | }, |
| 328 | "end": "(?=\\s*extends|\\{)", |
| 329 | "name": "meta.definition.class.implemented.interfaces.java", |
| 330 | "patterns": [ |
| 331 | { |
| 332 | "include": "#object-types-inherited" |
| 333 | }, |
| 334 | { |
| 335 | "include": "#comments" |
| 336 | } |
| 337 | ] |
| 338 | }, |
| 339 | { |
| 340 | "begin": "{", |
| 341 | "beginCaptures": { |
| 342 | "0": { |
| 343 | "name": "punctuation.section.class.begin.java" |
| 344 | } |
| 345 | }, |
| 346 | "end": "(?=})", |
| 347 | "name": "meta.class.body.java", |
| 348 | "patterns": [ |
| 349 | { |
| 350 | "include": "#class-body" |
| 351 | } |
| 352 | ] |
| 353 | } |
| 354 | ] |
| 355 | }, |
| 356 | "class-body": { |
| 357 | "patterns": [ |
| 358 | { |
| 359 | "include": "#comments" |
| 360 | }, |
| 361 | { |
| 362 | "include": "#class" |
| 363 | }, |
| 364 | { |
| 365 | "include": "#enums" |
| 366 | }, |
| 367 | { |
| 368 | "include": "#variables" |
| 369 | }, |
| 370 | { |
| 371 | "include": "#methods" |
| 372 | }, |
| 373 | { |
| 374 | "include": "#annotations" |
| 375 | }, |
| 376 | { |
| 377 | "include": "#storage-modifiers" |
| 378 | }, |
| 379 | { |
| 380 | "include": "#code" |
| 381 | } |
| 382 | ] |
| 383 | }, |
| 384 | "code": { |
| 385 | "patterns": [ |
| 386 | { |
| 387 | "include": "#comments" |
| 388 | }, |
| 389 | { |
| 390 | "include": "#class" |
| 391 | }, |
| 392 | { |
| 393 | "begin": "{", |
| 394 | "beginCaptures": { |
| 395 | "0": { |
| 396 | "name": "punctuation.section.block.begin.java" |
| 397 | } |
| 398 | }, |
| 399 | "end": "}", |
| 400 | "endCaptures": { |
| 401 | "0": { |
| 402 | "name": "punctuation.section.block.end.java" |
| 403 | } |
| 404 | }, |
| 405 | "patterns": [ |
| 406 | { |
| 407 | "include": "#code" |
| 408 | } |
| 409 | ] |
| 410 | }, |
| 411 | { |
| 412 | "include": "#assertions" |
| 413 | }, |
| 414 | { |
| 415 | "include": "#parens" |
| 416 | }, |
| 417 | { |
| 418 | "include": "#constants-and-special-vars" |
| 419 | }, |
| 420 | { |
| 421 | "include": "#anonymous-classes-and-new" |
| 422 | }, |
| 423 | { |
| 424 | "include": "#annotations" |
| 425 | }, |
| 426 | { |
| 427 | "include": "#keywords" |
| 428 | }, |
| 429 | { |
| 430 | "include": "#storage-modifiers" |
| 431 | }, |
| 432 | { |
| 433 | "include": "#method-call" |
| 434 | }, |
| 435 | { |
| 436 | "include": "#strings" |
| 437 | }, |
| 438 | { |
| 439 | "include": "#all-types" |
| 440 | } |
| 441 | ] |
| 442 | }, |
| 443 | "comments": { |
| 444 | "patterns": [ |
| 445 | { |
| 446 | "captures": { |
| 447 | "0": { |
| 448 | "name": "punctuation.definition.comment.java" |
| 449 | } |
| 450 | }, |
| 451 | "match": "/\\*\\*/", |
| 452 | "name": "comment.block.empty.java" |
| 453 | }, |
| 454 | { |
| 455 | "include": "text.html.javadoc" |
| 456 | }, |
| 457 | { |
| 458 | "include": "#comments-inline" |
| 459 | } |
| 460 | ] |
| 461 | }, |
| 462 | "comments-inline": { |
| 463 | "patterns": [ |
| 464 | { |
| 465 | "begin": "/\\*", |
| 466 | "captures": { |
| 467 | "0": { |
| 468 | "name": "punctuation.definition.comment.java" |
| 469 | } |
| 470 | }, |
| 471 | "end": "\\*/", |
| 472 | "name": "comment.block.java" |
| 473 | }, |
| 474 | { |
| 475 | "begin": "(^[ \\t]+)?(?=//)", |
| 476 | "beginCaptures": { |
| 477 | "1": { |
| 478 | "name": "punctuation.whitespace.comment.leading.java" |
| 479 | } |
| 480 | }, |
| 481 | "end": "(?!\\G)", |
| 482 | "patterns": [ |
| 483 | { |
| 484 | "begin": "//", |
| 485 | "beginCaptures": { |
| 486 | "0": { |
| 487 | "name": "punctuation.definition.comment.java" |
| 488 | } |
| 489 | }, |
| 490 | "end": "\\n", |
| 491 | "name": "comment.line.double-slash.java" |
| 492 | } |
| 493 | ] |
| 494 | } |
| 495 | ] |
| 496 | }, |
| 497 | "constants-and-special-vars": { |
| 498 | "patterns": [ |
| 499 | { |
| 500 | "match": "\\b(true|false|null)\\b", |
| 501 | "name": "constant.language.java" |
| 502 | }, |
| 503 | { |
| 504 | "match": "\\b(this|super)\\b", |
| 505 | "name": "variable.language.java" |
| 506 | }, |
| 507 | { |
| 508 | "match": "\\b0[xX]\\h([\\h_]*\\h)?[lL]?(?!\\w|\\.)", |
| 509 | "name": "constant.numeric.hex.java" |
| 510 | }, |
| 511 | { |
| 512 | "match": "\\b0[0-7_]*[0-7][lL]?\\b", |
| 513 | "name": "constant.numeric.octal.java" |
| 514 | }, |
| 515 | { |
| 516 | "match": "\\b0[bB][01]([01_]*[01])?[lL]?\\b", |
| 517 | "name": "constant.numeric.binary.java" |
| 518 | }, |
| 519 | { |
| 520 | "match": "\\b(0|[1-9]([0-9_]*[0-9])?)[lL]?(?!\\w|\\.)", |
| 521 | "name": "constant.numeric.integer.java" |
| 522 | }, |
| 523 | { |
| 524 | "match": "(?x)\n\t\t\t\t\t\t(?<!\\w)\t\t\t\t\t\t\t\t\t\t# Ensure word boundry\n\t\t\t\t\t\t(?>\n\t\t\t\t\t\t\t0[xX]\t\t\t\t\t\t\t\t\t# Start literal\n\t\t\t\t\t\t\t(\\h([\\h_]*\\h)?)?\t\t\t\t\t\t# Optional Number\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t(?<=\\h)\\.\t\t\t\t\t\t\t# A number must exist on\n\t\t\t\t\t\t | \\.(?=\\h)\t\t\t\t\t\t\t# one side of the decimal\n\t\t\t\t\t\t | (?<=\\h)\t\t\t\t\t\t\t\t# Decimal not required\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t(\\h([\\h_]*\\h)?)?\t\t\t\t\t\t# Optional Number\n\t\t\t\t\t\t\t[pP]\t\t\t\t\t\t\t\t\t# Exponent Indicator\n\t\t\t\t\t\t\t[+-]?(0|[1-9]([0-9_]*[0-9])?)\t\t\t# Signed Integer\n\t\t\t\t\t\t\t[fFdD]?\t\t\t\t\t\t\t\t\t# Float Type Suffix\n\t\t\t\t\t\t)\n\t\t\t\t\t\t(?!\\w)\t\t\t\t\t\t\t\t\t\t# Ensure word boundry\n\t\t\t\t\t", |
| 525 | "name": "constant.numeric.hex-float.java" |
| 526 | }, |
| 527 | { |
| 528 | "match": "(?x)\n\t\t\t\t\t\t(?<!\\w)\t\t\t\t\t\t\t\t\t\t\t# Ensure word boundry\n\t\t\t\t\t\t(?>\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t(0|[1-9]([0-9_]*[0-9])?)\t\t\t\t# Leading digits\n\t\t\t\t\t\t\t\t(?=[eEfFdD.])\t\t\t\t\t\t\t# Allow for numbers without .\n\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t(?<=[0-9])(?=[eEfFdD])\t\t\t\t\t# Allow for numbers without .\n\t\t\t\t\t\t\t | \\.\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t[0-9]([0-9_]*[0-9])?\t\t\t\t\t# Numbers after .\n\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t[eE][+-]?(0|[1-9]([0-9_]*[0-9])?)\t\t# Exponent\n\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t[fFdD]?\t\t\t\t\t\t\t\t\t\t# Float Type Suffix\n\t\t\t\t\t\t)\n\t\t\t\t\t\t(?!\\w)\t\t\t\t\t\t\t\t\t\t\t# Ensure word boundry\n\t\t\t\t\t", |
| 529 | "name": "constant.numeric.float.java" |
| 530 | }, |
| 531 | { |
| 532 | "captures": { |
| 533 | "1": { |
| 534 | "name": "keyword.operator.dereference.java" |
| 535 | } |
| 536 | }, |
| 537 | "match": "(\\.)?\\b([A-Z][A-Z0-9_]+)(?!<|\\.class|\\s*\\w+\\s*=)\\b", |
| 538 | "name": "constant.other.java" |
| 539 | } |
| 540 | ] |
| 541 | }, |
| 542 | "enums": { |
| 543 | "begin": "^(?=\\s*[A-Z0-9_]+\\s*({|\\(|,))", |
| 544 | "end": "(?=;|})", |
| 545 | "patterns": [ |
| 546 | { |
| 547 | "begin": "\\w+", |
| 548 | "beginCaptures": { |
| 549 | "0": { |
| 550 | "name": "constant.other.enum.java" |
| 551 | } |
| 552 | }, |
| 553 | "end": "(?=,|;|})", |
| 554 | "name": "meta.enum.java", |
| 555 | "patterns": [ |
| 556 | { |
| 557 | "include": "#parens" |
| 558 | }, |
| 559 | { |
| 560 | "begin": "{", |
| 561 | "beginCaptures": { |
| 562 | "0": { |
| 563 | "name": "punctuation.section.enum.begin.java" |
| 564 | } |
| 565 | }, |
| 566 | "end": "}", |
| 567 | "endCaptures": { |
| 568 | "0": { |
| 569 | "name": "punctuation.section.enum.end.java" |
| 570 | } |
| 571 | }, |
| 572 | "patterns": [ |
| 573 | { |
| 574 | "include": "#class-body" |
| 575 | } |
| 576 | ] |
| 577 | } |
| 578 | ] |
| 579 | }, |
| 580 | { |
| 581 | "include": "#comments" |
| 582 | }, |
| 583 | { |
| 584 | "include": "#annotations" |
| 585 | } |
| 586 | ] |
| 587 | }, |
| 588 | "keywords": { |
| 589 | "patterns": [ |
| 590 | { |
| 591 | "match": "\\b(try|catch|finally|throw)\\b", |
| 592 | "name": "keyword.control.catch-exception.java" |
| 593 | }, |
| 594 | { |
| 595 | "match": "\\?|:", |
| 596 | "name": "keyword.control.ternary.java" |
| 597 | }, |
| 598 | { |
| 599 | "match": "\\b(return|break|case|continue|default|do|while|for|switch|if|else)\\b", |
| 600 | "name": "keyword.control.java" |
| 601 | }, |
| 602 | { |
| 603 | "match": "\\b(instanceof)\\b", |
| 604 | "name": "keyword.operator.java" |
| 605 | }, |
| 606 | { |
| 607 | "match": "(<<|>>>?|~|\\^)", |
| 608 | "name": "keyword.operator.bitwise.java" |
| 609 | }, |
| 610 | { |
| 611 | "match": "((&|\\^|\\||<<|>>>?)=)", |
| 612 | "name": "keyword.operator.assignment.bitwise.java" |
| 613 | }, |
| 614 | { |
| 615 | "match": "(===?|!=|<=|>=|<>|<|>)", |
| 616 | "name": "keyword.operator.comparison.java" |
| 617 | }, |
| 618 | { |
| 619 | "match": "([+*/%-]=)", |
| 620 | "name": "keyword.operator.assignment.arithmetic.java" |
| 621 | }, |
| 622 | { |
| 623 | "match": "(=)", |
| 624 | "name": "keyword.operator.assignment.java" |
| 625 | }, |
| 626 | { |
| 627 | "match": "(\\-\\-|\\+\\+)", |
| 628 | "name": "keyword.operator.increment-decrement.java" |
| 629 | }, |
| 630 | { |
| 631 | "match": "(\\-|\\+|\\*|\\/|%)", |
| 632 | "name": "keyword.operator.arithmetic.java" |
| 633 | }, |
| 634 | { |
| 635 | "match": "(!|&&|\\|\\|)", |
| 636 | "name": "keyword.operator.logical.java" |
| 637 | }, |
| 638 | { |
| 639 | "match": "(\\||&)", |
| 640 | "name": "keyword.operator.bitwise.java" |
| 641 | }, |
| 642 | { |
| 643 | "match": "(?<=\\S)\\.(?=\\S)", |
| 644 | "name": "keyword.operator.dereference.java" |
| 645 | }, |
| 646 | { |
| 647 | "match": ";", |
| 648 | "name": "punctuation.terminator.java" |
| 649 | } |
| 650 | ] |
| 651 | }, |
| 652 | "method-call": { |
| 653 | "begin": "([\\w$]+)(\\()", |
| 654 | "beginCaptures": { |
| 655 | "1": { |
| 656 | "name": "meta.method.java" |
| 657 | }, |
| 658 | "2": { |
| 659 | "name": "punctuation.definition.method-parameters.begin.java" |
| 660 | } |
| 661 | }, |
| 662 | "end": "\\)", |
| 663 | "endCaptures": { |
| 664 | "0": { |
| 665 | "name": "punctuation.definition.method-parameters.end.java" |
| 666 | } |
| 667 | }, |
| 668 | "name": "meta.method-call.java", |
| 669 | "patterns": [ |
| 670 | { |
| 671 | "match": ",", |
| 672 | "name": "punctuation.definition.seperator.parameter.java" |
| 673 | }, |
| 674 | { |
| 675 | "include": "#code" |
| 676 | } |
| 677 | ] |
| 678 | }, |
| 679 | "methods": { |
| 680 | "begin": "(?!new)(?=[\\w<].*\\s+)(?=([^=/]|/(?!/))+\\()", |
| 681 | "end": "(})|(?=;)", |
| 682 | "endCaptures": { |
| 683 | "1": { |
| 684 | "name": "punctuation.section.method.end.java" |
| 685 | } |
| 686 | }, |
| 687 | "name": "meta.method.java", |
| 688 | "patterns": [ |
| 689 | { |
| 690 | "include": "#storage-modifiers" |
| 691 | }, |
| 692 | { |
| 693 | "begin": "(\\w+)\\s*\\(", |
| 694 | "beginCaptures": { |
| 695 | "1": { |
| 696 | "name": "entity.name.function.java" |
| 697 | } |
| 698 | }, |
| 699 | "end": "\\)", |
| 700 | "name": "meta.method.identifier.java", |
| 701 | "patterns": [ |
| 702 | { |
| 703 | "include": "#parameters" |
| 704 | }, |
| 705 | { |
| 706 | "include": "#comments" |
| 707 | } |
| 708 | ] |
| 709 | }, |
| 710 | { |
| 711 | "begin": "<", |
| 712 | "end": ">", |
| 713 | "name": "storage.type.token.java", |
| 714 | "patterns": [ |
| 715 | { |
| 716 | "include": "#object-types" |
| 717 | }, |
| 718 | { |
| 719 | "begin": "<", |
| 720 | "comment": "This is just to support <>'s with no actual type prefix", |
| 721 | "end": ">|[^\\w\\s,\\[\\]<]", |
| 722 | "name": "storage.type.generic.java" |
| 723 | } |
| 724 | ] |
| 725 | }, |
| 726 | { |
| 727 | "begin": "(?=\\w.*\\s+\\w+\\s*\\()", |
| 728 | "end": "(?=\\w+\\s*\\()", |
| 729 | "name": "meta.method.return-type.java", |
| 730 | "patterns": [ |
| 731 | { |
| 732 | "include": "#all-types" |
| 733 | }, |
| 734 | { |
| 735 | "include": "#comments" |
| 736 | } |
| 737 | ] |
| 738 | }, |
| 739 | { |
| 740 | "include": "#throws" |
| 741 | }, |
| 742 | { |
| 743 | "begin": "{", |
| 744 | "beginCaptures": { |
| 745 | "0": { |
| 746 | "name": "punctuation.section.method.begin.java" |
| 747 | } |
| 748 | }, |
| 749 | "end": "(?=})", |
| 750 | "name": "meta.method.body.java", |
| 751 | "patterns": [ |
| 752 | { |
| 753 | "include": "#code" |
| 754 | } |
| 755 | ] |
| 756 | }, |
| 757 | { |
| 758 | "include": "#comments" |
| 759 | } |
| 760 | ] |
| 761 | }, |
| 762 | "object-types": { |
| 763 | "patterns": [ |
| 764 | { |
| 765 | "begin": "\\b((?:[a-z]\\w*\\.)*[A-Z]+\\w*)<", |
| 766 | "end": ">|[^\\w\\s,\\?<\\[\\]]", |
| 767 | "name": "storage.type.generic.java", |
| 768 | "patterns": [ |
| 769 | { |
| 770 | "include": "#object-types" |
| 771 | }, |
| 772 | { |
| 773 | "begin": "<", |
| 774 | "comment": "This is just to support <>'s with no actual type prefix", |
| 775 | "end": ">|[^\\w\\s,\\[\\]<]", |
| 776 | "name": "storage.type.generic.java" |
| 777 | } |
| 778 | ] |
| 779 | }, |
| 780 | { |
| 781 | "begin": "\\b((?:[a-z]\\w*\\.)*[A-Z]+\\w*)(?=\\[)", |
| 782 | "end": "(?=[^\\]\\s])", |
| 783 | "name": "storage.type.object.array.java", |
| 784 | "patterns": [ |
| 785 | { |
| 786 | "begin": "\\[", |
| 787 | "end": "\\]", |
| 788 | "patterns": [ |
| 789 | { |
| 790 | "include": "#code" |
| 791 | } |
| 792 | ] |
| 793 | } |
| 794 | ] |
| 795 | }, |
| 796 | { |
| 797 | "captures": { |
| 798 | "1": { |
| 799 | "name": "keyword.operator.dereference.java" |
| 800 | } |
| 801 | }, |
| 802 | "match": "\\b(?:[a-z]\\w*(\\.))*[A-Z]+\\w*\\b", |
| 803 | "name": "storage.type.java" |
| 804 | } |
| 805 | ] |
| 806 | }, |
| 807 | "object-types-inherited": { |
| 808 | "patterns": [ |
| 809 | { |
| 810 | "begin": "\\b((?:[a-z]\\w*\\.)*[A-Z]+\\w*)<", |
| 811 | "end": ">|[^\\w\\s,<]", |
| 812 | "name": "entity.other.inherited-class.java", |
| 813 | "patterns": [ |
| 814 | { |
| 815 | "include": "#object-types" |
| 816 | }, |
| 817 | { |
| 818 | "begin": "<", |
| 819 | "comment": "This is just to support <>'s with no actual type prefix", |
| 820 | "end": ">|[^\\w\\s,<]", |
| 821 | "name": "storage.type.generic.java" |
| 822 | } |
| 823 | ] |
| 824 | }, |
| 825 | { |
| 826 | "captures": { |
| 827 | "1": { |
| 828 | "name": "keyword.operator.dereference.java" |
| 829 | } |
| 830 | }, |
| 831 | "match": "\\b(?:[a-z]\\w*(\\.))*[A-Z]+\\w*", |
| 832 | "name": "entity.other.inherited-class.java" |
| 833 | } |
| 834 | ] |
| 835 | }, |
| 836 | "parameters": { |
| 837 | "patterns": [ |
| 838 | { |
| 839 | "match": "final", |
| 840 | "name": "storage.modifier.java" |
| 841 | }, |
| 842 | { |
| 843 | "include": "#annotations" |
| 844 | }, |
| 845 | { |
| 846 | "include": "#primitive-arrays" |
| 847 | }, |
| 848 | { |
| 849 | "include": "#primitive-types" |
| 850 | }, |
| 851 | { |
| 852 | "include": "#object-types" |
| 853 | }, |
| 854 | { |
| 855 | "match": "\\w+", |
| 856 | "name": "variable.parameter.java" |
| 857 | } |
| 858 | ] |
| 859 | }, |
| 860 | "parens": { |
| 861 | "begin": "\\(", |
| 862 | "end": "\\)", |
| 863 | "patterns": [ |
| 864 | { |
| 865 | "include": "#code" |
| 866 | } |
| 867 | ] |
| 868 | }, |
| 869 | "primitive-arrays": { |
| 870 | "patterns": [ |
| 871 | { |
| 872 | "match": "\\b(?:void|boolean|byte|char|short|int|float|long|double)(\\[\\])*\\b", |
| 873 | "name": "storage.type.primitive.array.java" |
| 874 | } |
| 875 | ] |
| 876 | }, |
| 877 | "primitive-types": { |
| 878 | "patterns": [ |
| 879 | { |
| 880 | "match": "\\b(?:void|boolean|byte|char|short|int|float|long|double)\\b", |
| 881 | "name": "storage.type.primitive.java" |
| 882 | } |
| 883 | ] |
| 884 | }, |
| 885 | "storage-modifiers": { |
| 886 | "captures": { |
| 887 | "1": { |
| 888 | "name": "storage.modifier.java" |
| 889 | } |
| 890 | }, |
| 891 | "match": "\\b(public|private|protected|static|final|native|synchronized|volatile|abstract|threadsafe|transient)\\b" |
| 892 | }, |
| 893 | "strings": { |
| 894 | "patterns": [ |
| 895 | { |
| 896 | "begin": "\"", |
| 897 | "beginCaptures": { |
| 898 | "0": { |
| 899 | "name": "punctuation.definition.string.begin.java" |
| 900 | } |
| 901 | }, |
| 902 | "end": "\"", |
| 903 | "endCaptures": { |
| 904 | "0": { |
| 905 | "name": "punctuation.definition.string.end.java" |
| 906 | } |
| 907 | }, |
| 908 | "name": "string.quoted.double.java", |
| 909 | "patterns": [ |
| 910 | { |
| 911 | "match": "\\\\.", |
| 912 | "name": "constant.character.escape.java" |
| 913 | } |
| 914 | ] |
| 915 | }, |
| 916 | { |
| 917 | "begin": "'", |
| 918 | "beginCaptures": { |
| 919 | "0": { |
| 920 | "name": "punctuation.definition.string.begin.java" |
| 921 | } |
| 922 | }, |
| 923 | "end": "'", |
| 924 | "endCaptures": { |
| 925 | "0": { |
| 926 | "name": "punctuation.definition.string.end.java" |
| 927 | } |
| 928 | }, |
| 929 | "name": "string.quoted.single.java", |
| 930 | "patterns": [ |
| 931 | { |
| 932 | "match": "\\\\.", |
| 933 | "name": "constant.character.escape.java" |
| 934 | } |
| 935 | ] |
| 936 | } |
| 937 | ] |
| 938 | }, |
| 939 | "throws": { |
| 940 | "begin": "throws", |
| 941 | "beginCaptures": { |
| 942 | "0": { |
| 943 | "name": "storage.modifier.java" |
| 944 | } |
| 945 | }, |
| 946 | "end": "(?={|;)", |
| 947 | "name": "meta.throwables.java", |
| 948 | "patterns": [ |
| 949 | { |
| 950 | "include": "#object-types" |
| 951 | } |
| 952 | ] |
| 953 | }, |
| 954 | "values": { |
| 955 | "patterns": [ |
| 956 | { |
| 957 | "include": "#strings" |
| 958 | }, |
| 959 | { |
| 960 | "include": "#object-types" |
| 961 | }, |
| 962 | { |
| 963 | "include": "#constants-and-special-vars" |
| 964 | } |
| 965 | ] |
| 966 | }, |
| 967 | "variables": { |
| 968 | "applyEndPatternLast": 1, |
| 969 | "patterns": [ |
| 970 | { |
| 971 | "begin": "(?x:(?=\n (?:\n (?:private|protected|public|native|synchronized|volatile|abstract|threadsafe|transient|static|final) # visibility/modifier\n |\n (?:def)\n |\n (?:void|boolean|byte|char|short|int|float|long|double)\n |\n (?:(?:[a-z]\\w*\\.)*[A-Z]+\\w*) # object type\n )\n \\s+\n (?!private|protected|public|native|synchronized|volatile|abstract|threadsafe|transient|static|final|def|void|boolean|byte|char|short|int|float|long|double)\n [\\w\\d_<>\\[\\],\\?][\\w\\d_<>\\[\\],\\? \\t]*\n (?:=|$)\n \n\t\t\t\t\t))", |
| 972 | "end": "(?=;)", |
| 973 | "name": "meta.definition.variable.java", |
| 974 | "patterns": [ |
| 975 | { |
| 976 | "match": "\\s" |
| 977 | }, |
| 978 | { |
| 979 | "captures": { |
| 980 | "1": { |
| 981 | "name": "constant.other.variable.java" |
| 982 | } |
| 983 | }, |
| 984 | "match": "([A-Z_0-9]+)\\s+(?=\\=)" |
| 985 | }, |
| 986 | { |
| 987 | "captures": { |
| 988 | "1": { |
| 989 | "name": "meta.definition.variable.name.java" |
| 990 | } |
| 991 | }, |
| 992 | "match": "(\\w[^\\s,]*)\\s+(?=\\=)" |
| 993 | }, |
| 994 | { |
| 995 | "begin": "=", |
| 996 | "beginCaptures": { |
| 997 | "0": { |
| 998 | "name": "keyword.operator.assignment.java" |
| 999 | } |
| 1000 | }, |
| 1001 | "end": "(?=;)", |
| 1002 | "patterns": [ |
| 1003 | { |
| 1004 | "include": "#code" |
| 1005 | } |
| 1006 | ] |
| 1007 | }, |
| 1008 | { |
| 1009 | "captures": { |
| 1010 | "1": { |
| 1011 | "name": "meta.definition.variable.name.java" |
| 1012 | } |
| 1013 | }, |
| 1014 | "match": "(\\w[^\\s=]*)(?=\\s*;)" |
| 1015 | }, |
| 1016 | { |
| 1017 | "include": "#code" |
| 1018 | } |
| 1019 | ] |
| 1020 | } |
| 1021 | ] |
| 1022 | } |
| 1023 | }, |
| 1024 | "scopeName": "source.java", |
| 1025 | "uuid": "2B449DF6-6B1D-11D9-94EC-000D93589AF6", |
| 1026 | "version": "https://github.com/textmate/java.tmbundle/commit/faffa518d0b22b68b4e5e6b4c939722522b97d40" |
| 1027 | } |