OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // |
| 5 // This file has been automatically generated. Please do not edit it manually. |
| 6 // To regenerate the file, use the script |
| 7 // "pkg/analysis_server/tool/spec/generate_files". |
| 8 |
| 9 /** |
| 10 * Matchers for data types defined in the analysis server API |
| 11 */ |
| 12 import 'package:test/test.dart'; |
| 13 |
| 14 import 'integration_tests.dart'; |
| 15 |
| 16 /** |
| 17 * plugin.versionCheck params |
| 18 * |
| 19 * { |
| 20 * "version": String |
| 21 * } |
| 22 */ |
| 23 final Matcher isPluginVersionCheckParams = new LazyMatcher(() => new MatchesJson
Object( |
| 24 "plugin.versionCheck params", { |
| 25 "version": isString |
| 26 })); |
| 27 |
| 28 /** |
| 29 * plugin.versionCheck result |
| 30 * |
| 31 * { |
| 32 * "isCompatible": bool |
| 33 * "name": String |
| 34 * "version": String |
| 35 * "email": optional String |
| 36 * "interestingFiles": List<String> |
| 37 * } |
| 38 */ |
| 39 final Matcher isPluginVersionCheckResult = new LazyMatcher(() => new MatchesJson
Object( |
| 40 "plugin.versionCheck result", { |
| 41 "isCompatible": isBool, |
| 42 "name": isString, |
| 43 "version": isString, |
| 44 "interestingFiles": isListOf(isString) |
| 45 }, optionalFields: { |
| 46 "email": isString |
| 47 })); |
| 48 |
| 49 /** |
| 50 * plugin.shutdown params |
| 51 */ |
| 52 final Matcher isPluginShutdownParams = isNull; |
| 53 |
| 54 /** |
| 55 * plugin.shutdown result |
| 56 */ |
| 57 final Matcher isPluginShutdownResult = isNull; |
| 58 |
| 59 /** |
| 60 * plugin.error params |
| 61 * |
| 62 * { |
| 63 * "isFatal": bool |
| 64 * "message": String |
| 65 * "stackTrace": String |
| 66 * } |
| 67 */ |
| 68 final Matcher isPluginErrorParams = new LazyMatcher(() => new MatchesJsonObject( |
| 69 "plugin.error params", { |
| 70 "isFatal": isBool, |
| 71 "message": isString, |
| 72 "stackTrace": isString |
| 73 })); |
| 74 |
| 75 /** |
| 76 * analysis.handleWatchEvents params |
| 77 * |
| 78 * { |
| 79 * "events": List<WatchEvent> |
| 80 * } |
| 81 */ |
| 82 final Matcher isAnalysisHandleWatchEventsParams = new LazyMatcher(() => new Matc
hesJsonObject( |
| 83 "analysis.handleWatchEvents params", { |
| 84 "events": isListOf(isWatchEvent) |
| 85 })); |
| 86 |
| 87 /** |
| 88 * analysis.handleWatchEvents result |
| 89 */ |
| 90 final Matcher isAnalysisHandleWatchEventsResult = isNull; |
| 91 |
| 92 /** |
| 93 * analysis.reanalyze params |
| 94 * |
| 95 * { |
| 96 * "roots": optional List<FilePath> |
| 97 * } |
| 98 */ |
| 99 final Matcher isAnalysisReanalyzeParams = new LazyMatcher(() => new MatchesJsonO
bject( |
| 100 "analysis.reanalyze params", null, optionalFields: { |
| 101 "roots": isListOf(isFilePath) |
| 102 })); |
| 103 |
| 104 /** |
| 105 * analysis.reanalyze result |
| 106 */ |
| 107 final Matcher isAnalysisReanalyzeResult = isNull; |
| 108 |
| 109 /** |
| 110 * analysis.setContextBuilderOptions params |
| 111 * |
| 112 * { |
| 113 * "options": ContextBuilderOptions |
| 114 * } |
| 115 */ |
| 116 final Matcher isAnalysisSetContextBuilderOptionsParams = new LazyMatcher(() => n
ew MatchesJsonObject( |
| 117 "analysis.setContextBuilderOptions params", { |
| 118 "options": isContextBuilderOptions |
| 119 })); |
| 120 |
| 121 /** |
| 122 * analysis.setContextBuilderOptions result |
| 123 */ |
| 124 final Matcher isAnalysisSetContextBuilderOptionsResult = isNull; |
| 125 |
| 126 /** |
| 127 * analysis.setContextRoots params |
| 128 * |
| 129 * { |
| 130 * "roots": List<ContextRoot> |
| 131 * } |
| 132 */ |
| 133 final Matcher isAnalysisSetContextRootsParams = new LazyMatcher(() => new Matche
sJsonObject( |
| 134 "analysis.setContextRoots params", { |
| 135 "roots": isListOf(isContextRoot) |
| 136 })); |
| 137 |
| 138 /** |
| 139 * analysis.setContextRoots result |
| 140 */ |
| 141 final Matcher isAnalysisSetContextRootsResult = isNull; |
| 142 |
| 143 /** |
| 144 * analysis.setPriorityFiles params |
| 145 * |
| 146 * { |
| 147 * "files": List<FilePath> |
| 148 * } |
| 149 */ |
| 150 final Matcher isAnalysisSetPriorityFilesParams = new LazyMatcher(() => new Match
esJsonObject( |
| 151 "analysis.setPriorityFiles params", { |
| 152 "files": isListOf(isFilePath) |
| 153 })); |
| 154 |
| 155 /** |
| 156 * analysis.setPriorityFiles result |
| 157 */ |
| 158 final Matcher isAnalysisSetPriorityFilesResult = isNull; |
| 159 |
| 160 /** |
| 161 * analysis.setSubscriptions params |
| 162 * |
| 163 * { |
| 164 * "subscriptions": Map<AnalysisService, List<FilePath>> |
| 165 * } |
| 166 */ |
| 167 final Matcher isAnalysisSetSubscriptionsParams = new LazyMatcher(() => new Match
esJsonObject( |
| 168 "analysis.setSubscriptions params", { |
| 169 "subscriptions": isMapOf(isAnalysisService, isListOf(isFilePath)) |
| 170 })); |
| 171 |
| 172 /** |
| 173 * analysis.setSubscriptions result |
| 174 */ |
| 175 final Matcher isAnalysisSetSubscriptionsResult = isNull; |
| 176 |
| 177 /** |
| 178 * analysis.updateContent params |
| 179 * |
| 180 * { |
| 181 * "files": Map<FilePath, AddContentOverlay | ChangeContentOverlay | RemoveCon
tentOverlay> |
| 182 * } |
| 183 */ |
| 184 final Matcher isAnalysisUpdateContentParams = new LazyMatcher(() => new MatchesJ
sonObject( |
| 185 "analysis.updateContent params", { |
| 186 "files": isMapOf(isFilePath, isOneOf([isAddContentOverlay, isChangeContentOv
erlay, isRemoveContentOverlay])) |
| 187 })); |
| 188 |
| 189 /** |
| 190 * analysis.updateContent result |
| 191 */ |
| 192 final Matcher isAnalysisUpdateContentResult = isNull; |
| 193 |
| 194 /** |
| 195 * analysis.errors params |
| 196 * |
| 197 * { |
| 198 * "file": FilePath |
| 199 * "errors": List<AnalysisError> |
| 200 * } |
| 201 */ |
| 202 final Matcher isAnalysisErrorsParams = new LazyMatcher(() => new MatchesJsonObje
ct( |
| 203 "analysis.errors params", { |
| 204 "file": isFilePath, |
| 205 "errors": isListOf(isAnalysisError) |
| 206 })); |
| 207 |
| 208 /** |
| 209 * analysis.folding params |
| 210 * |
| 211 * { |
| 212 * "file": FilePath |
| 213 * "regions": List<FoldingRegion> |
| 214 * } |
| 215 */ |
| 216 final Matcher isAnalysisFoldingParams = new LazyMatcher(() => new MatchesJsonObj
ect( |
| 217 "analysis.folding params", { |
| 218 "file": isFilePath, |
| 219 "regions": isListOf(isFoldingRegion) |
| 220 })); |
| 221 |
| 222 /** |
| 223 * analysis.highlights params |
| 224 * |
| 225 * { |
| 226 * "file": FilePath |
| 227 * "regions": List<HighlightRegion> |
| 228 * } |
| 229 */ |
| 230 final Matcher isAnalysisHighlightsParams = new LazyMatcher(() => new MatchesJson
Object( |
| 231 "analysis.highlights params", { |
| 232 "file": isFilePath, |
| 233 "regions": isListOf(isHighlightRegion) |
| 234 })); |
| 235 |
| 236 /** |
| 237 * analysis.navigation params |
| 238 * |
| 239 * { |
| 240 * "file": FilePath |
| 241 * "regions": List<NavigationRegion> |
| 242 * "targets": List<NavigationTarget> |
| 243 * "files": List<FilePath> |
| 244 * } |
| 245 */ |
| 246 final Matcher isAnalysisNavigationParams = new LazyMatcher(() => new MatchesJson
Object( |
| 247 "analysis.navigation params", { |
| 248 "file": isFilePath, |
| 249 "regions": isListOf(isNavigationRegion), |
| 250 "targets": isListOf(isNavigationTarget), |
| 251 "files": isListOf(isFilePath) |
| 252 })); |
| 253 |
| 254 /** |
| 255 * analysis.occurrences params |
| 256 * |
| 257 * { |
| 258 * "file": FilePath |
| 259 * "occurrences": List<Occurrences> |
| 260 * } |
| 261 */ |
| 262 final Matcher isAnalysisOccurrencesParams = new LazyMatcher(() => new MatchesJso
nObject( |
| 263 "analysis.occurrences params", { |
| 264 "file": isFilePath, |
| 265 "occurrences": isListOf(isOccurrences) |
| 266 })); |
| 267 |
| 268 /** |
| 269 * analysis.outline params |
| 270 * |
| 271 * { |
| 272 * "file": FilePath |
| 273 * "outline": List<Outline> |
| 274 * } |
| 275 */ |
| 276 final Matcher isAnalysisOutlineParams = new LazyMatcher(() => new MatchesJsonObj
ect( |
| 277 "analysis.outline params", { |
| 278 "file": isFilePath, |
| 279 "outline": isListOf(isOutline) |
| 280 })); |
| 281 |
| 282 /** |
| 283 * completion.getSuggestions params |
| 284 * |
| 285 * { |
| 286 * "file": FilePath |
| 287 * "offset": int |
| 288 * } |
| 289 */ |
| 290 final Matcher isCompletionGetSuggestionsParams = new LazyMatcher(() => new Match
esJsonObject( |
| 291 "completion.getSuggestions params", { |
| 292 "file": isFilePath, |
| 293 "offset": isInt |
| 294 })); |
| 295 |
| 296 /** |
| 297 * completion.getSuggestions result |
| 298 * |
| 299 * { |
| 300 * "replacementOffset": int |
| 301 * "replacementLength": int |
| 302 * "results": List<CompletionSuggestion> |
| 303 * } |
| 304 */ |
| 305 final Matcher isCompletionGetSuggestionsResult = new LazyMatcher(() => new Match
esJsonObject( |
| 306 "completion.getSuggestions result", { |
| 307 "replacementOffset": isInt, |
| 308 "replacementLength": isInt, |
| 309 "results": isListOf(isCompletionSuggestion) |
| 310 })); |
| 311 |
| 312 /** |
| 313 * edit.getAssists params |
| 314 * |
| 315 * { |
| 316 * "file": FilePath |
| 317 * "offset": int |
| 318 * "length": int |
| 319 * } |
| 320 */ |
| 321 final Matcher isEditGetAssistsParams = new LazyMatcher(() => new MatchesJsonObje
ct( |
| 322 "edit.getAssists params", { |
| 323 "file": isFilePath, |
| 324 "offset": isInt, |
| 325 "length": isInt |
| 326 })); |
| 327 |
| 328 /** |
| 329 * edit.getAssists result |
| 330 * |
| 331 * { |
| 332 * "assists": List<SourceChange> |
| 333 * } |
| 334 */ |
| 335 final Matcher isEditGetAssistsResult = new LazyMatcher(() => new MatchesJsonObje
ct( |
| 336 "edit.getAssists result", { |
| 337 "assists": isListOf(isSourceChange) |
| 338 })); |
| 339 |
| 340 /** |
| 341 * edit.getAvailableRefactorings params |
| 342 * |
| 343 * { |
| 344 * "file": FilePath |
| 345 * "offset": int |
| 346 * "length": int |
| 347 * } |
| 348 */ |
| 349 final Matcher isEditGetAvailableRefactoringsParams = new LazyMatcher(() => new M
atchesJsonObject( |
| 350 "edit.getAvailableRefactorings params", { |
| 351 "file": isFilePath, |
| 352 "offset": isInt, |
| 353 "length": isInt |
| 354 })); |
| 355 |
| 356 /** |
| 357 * edit.getAvailableRefactorings result |
| 358 * |
| 359 * { |
| 360 * "kinds": List<RefactoringKind> |
| 361 * } |
| 362 */ |
| 363 final Matcher isEditGetAvailableRefactoringsResult = new LazyMatcher(() => new M
atchesJsonObject( |
| 364 "edit.getAvailableRefactorings result", { |
| 365 "kinds": isListOf(isRefactoringKind) |
| 366 })); |
| 367 |
| 368 /** |
| 369 * edit.getFixes params |
| 370 * |
| 371 * { |
| 372 * "file": FilePath |
| 373 * "offset": int |
| 374 * } |
| 375 */ |
| 376 final Matcher isEditGetFixesParams = new LazyMatcher(() => new MatchesJsonObject
( |
| 377 "edit.getFixes params", { |
| 378 "file": isFilePath, |
| 379 "offset": isInt |
| 380 })); |
| 381 |
| 382 /** |
| 383 * edit.getFixes result |
| 384 * |
| 385 * { |
| 386 * "fixes": List<AnalysisErrorFixes> |
| 387 * } |
| 388 */ |
| 389 final Matcher isEditGetFixesResult = new LazyMatcher(() => new MatchesJsonObject
( |
| 390 "edit.getFixes result", { |
| 391 "fixes": isListOf(isAnalysisErrorFixes) |
| 392 })); |
| 393 |
| 394 /** |
| 395 * edit.getRefactoring params |
| 396 * |
| 397 * { |
| 398 * "kind": RefactoringKind |
| 399 * "file": FilePath |
| 400 * "offset": int |
| 401 * "length": int |
| 402 * "validateOnly": bool |
| 403 * "options": optional RefactoringOptions |
| 404 * } |
| 405 */ |
| 406 final Matcher isEditGetRefactoringParams = new LazyMatcher(() => new MatchesJson
Object( |
| 407 "edit.getRefactoring params", { |
| 408 "kind": isRefactoringKind, |
| 409 "file": isFilePath, |
| 410 "offset": isInt, |
| 411 "length": isInt, |
| 412 "validateOnly": isBool |
| 413 }, optionalFields: { |
| 414 "options": isRefactoringOptions |
| 415 })); |
| 416 |
| 417 /** |
| 418 * edit.getRefactoring result |
| 419 * |
| 420 * { |
| 421 * "initialProblems": List<RefactoringProblem> |
| 422 * "optionsProblems": List<RefactoringProblem> |
| 423 * "finalProblems": List<RefactoringProblem> |
| 424 * "feedback": optional RefactoringFeedback |
| 425 * "change": optional SourceChange |
| 426 * "potentialEdits": optional List<String> |
| 427 * } |
| 428 */ |
| 429 final Matcher isEditGetRefactoringResult = new LazyMatcher(() => new MatchesJson
Object( |
| 430 "edit.getRefactoring result", { |
| 431 "initialProblems": isListOf(isRefactoringProblem), |
| 432 "optionsProblems": isListOf(isRefactoringProblem), |
| 433 "finalProblems": isListOf(isRefactoringProblem) |
| 434 }, optionalFields: { |
| 435 "feedback": isRefactoringFeedback, |
| 436 "change": isSourceChange, |
| 437 "potentialEdits": isListOf(isString) |
| 438 })); |
| 439 |
| 440 /** |
| 441 * AddContentOverlay |
| 442 * |
| 443 * { |
| 444 * "type": "add" |
| 445 * "content": String |
| 446 * } |
| 447 */ |
| 448 final Matcher isAddContentOverlay = new LazyMatcher(() => new MatchesJsonObject( |
| 449 "AddContentOverlay", { |
| 450 "type": equals("add"), |
| 451 "content": isString |
| 452 })); |
| 453 |
| 454 /** |
| 455 * AnalysisError |
| 456 * |
| 457 * { |
| 458 * "severity": AnalysisErrorSeverity |
| 459 * "type": AnalysisErrorType |
| 460 * "location": Location |
| 461 * "message": String |
| 462 * "correction": optional String |
| 463 * "code": String |
| 464 * "hasFix": optional bool |
| 465 * } |
| 466 */ |
| 467 final Matcher isAnalysisError = new LazyMatcher(() => new MatchesJsonObject( |
| 468 "AnalysisError", { |
| 469 "severity": isAnalysisErrorSeverity, |
| 470 "type": isAnalysisErrorType, |
| 471 "location": isLocation, |
| 472 "message": isString, |
| 473 "code": isString |
| 474 }, optionalFields: { |
| 475 "correction": isString, |
| 476 "hasFix": isBool |
| 477 })); |
| 478 |
| 479 /** |
| 480 * AnalysisErrorFixes |
| 481 * |
| 482 * { |
| 483 * "error": AnalysisError |
| 484 * "fixes": List<SourceChange> |
| 485 * } |
| 486 */ |
| 487 final Matcher isAnalysisErrorFixes = new LazyMatcher(() => new MatchesJsonObject
( |
| 488 "AnalysisErrorFixes", { |
| 489 "error": isAnalysisError, |
| 490 "fixes": isListOf(isSourceChange) |
| 491 })); |
| 492 |
| 493 /** |
| 494 * AnalysisErrorSeverity |
| 495 * |
| 496 * enum { |
| 497 * INFO |
| 498 * WARNING |
| 499 * ERROR |
| 500 * } |
| 501 */ |
| 502 final Matcher isAnalysisErrorSeverity = new MatchesEnum("AnalysisErrorSeverity",
[ |
| 503 "INFO", |
| 504 "WARNING", |
| 505 "ERROR" |
| 506 ]); |
| 507 |
| 508 /** |
| 509 * AnalysisErrorType |
| 510 * |
| 511 * enum { |
| 512 * CHECKED_MODE_COMPILE_TIME_ERROR |
| 513 * COMPILE_TIME_ERROR |
| 514 * HINT |
| 515 * LINT |
| 516 * STATIC_TYPE_WARNING |
| 517 * STATIC_WARNING |
| 518 * SYNTACTIC_ERROR |
| 519 * TODO |
| 520 * } |
| 521 */ |
| 522 final Matcher isAnalysisErrorType = new MatchesEnum("AnalysisErrorType", [ |
| 523 "CHECKED_MODE_COMPILE_TIME_ERROR", |
| 524 "COMPILE_TIME_ERROR", |
| 525 "HINT", |
| 526 "LINT", |
| 527 "STATIC_TYPE_WARNING", |
| 528 "STATIC_WARNING", |
| 529 "SYNTACTIC_ERROR", |
| 530 "TODO" |
| 531 ]); |
| 532 |
| 533 /** |
| 534 * AnalysisService |
| 535 * |
| 536 * enum { |
| 537 * FOLDING |
| 538 * HIGHLIGHTS |
| 539 * NAVIGATION |
| 540 * OCCURRENCES |
| 541 * OUTLINE |
| 542 * } |
| 543 */ |
| 544 final Matcher isAnalysisService = new MatchesEnum("AnalysisService", [ |
| 545 "FOLDING", |
| 546 "HIGHLIGHTS", |
| 547 "NAVIGATION", |
| 548 "OCCURRENCES", |
| 549 "OUTLINE" |
| 550 ]); |
| 551 |
| 552 /** |
| 553 * ChangeContentOverlay |
| 554 * |
| 555 * { |
| 556 * "type": "change" |
| 557 * "edits": List<SourceEdit> |
| 558 * } |
| 559 */ |
| 560 final Matcher isChangeContentOverlay = new LazyMatcher(() => new MatchesJsonObje
ct( |
| 561 "ChangeContentOverlay", { |
| 562 "type": equals("change"), |
| 563 "edits": isListOf(isSourceEdit) |
| 564 })); |
| 565 |
| 566 /** |
| 567 * CompletionSuggestion |
| 568 * |
| 569 * { |
| 570 * "kind": CompletionSuggestionKind |
| 571 * "relevance": int |
| 572 * "completion": String |
| 573 * "selectionOffset": int |
| 574 * "selectionLength": int |
| 575 * "isDeprecated": bool |
| 576 * "isPotential": bool |
| 577 * "docSummary": optional String |
| 578 * "docComplete": optional String |
| 579 * "declaringType": optional String |
| 580 * "element": optional Element |
| 581 * "returnType": optional String |
| 582 * "parameterNames": optional List<String> |
| 583 * "parameterTypes": optional List<String> |
| 584 * "requiredParameterCount": optional int |
| 585 * "hasNamedParameters": optional bool |
| 586 * "parameterName": optional String |
| 587 * "parameterType": optional String |
| 588 * "importUri": optional String |
| 589 * } |
| 590 */ |
| 591 final Matcher isCompletionSuggestion = new LazyMatcher(() => new MatchesJsonObje
ct( |
| 592 "CompletionSuggestion", { |
| 593 "kind": isCompletionSuggestionKind, |
| 594 "relevance": isInt, |
| 595 "completion": isString, |
| 596 "selectionOffset": isInt, |
| 597 "selectionLength": isInt, |
| 598 "isDeprecated": isBool, |
| 599 "isPotential": isBool |
| 600 }, optionalFields: { |
| 601 "docSummary": isString, |
| 602 "docComplete": isString, |
| 603 "declaringType": isString, |
| 604 "element": isElement, |
| 605 "returnType": isString, |
| 606 "parameterNames": isListOf(isString), |
| 607 "parameterTypes": isListOf(isString), |
| 608 "requiredParameterCount": isInt, |
| 609 "hasNamedParameters": isBool, |
| 610 "parameterName": isString, |
| 611 "parameterType": isString, |
| 612 "importUri": isString |
| 613 })); |
| 614 |
| 615 /** |
| 616 * CompletionSuggestionKind |
| 617 * |
| 618 * enum { |
| 619 * ARGUMENT_LIST |
| 620 * IMPORT |
| 621 * IDENTIFIER |
| 622 * INVOCATION |
| 623 * KEYWORD |
| 624 * NAMED_ARGUMENT |
| 625 * OPTIONAL_ARGUMENT |
| 626 * PARAMETER |
| 627 * } |
| 628 */ |
| 629 final Matcher isCompletionSuggestionKind = new MatchesEnum("CompletionSuggestion
Kind", [ |
| 630 "ARGUMENT_LIST", |
| 631 "IMPORT", |
| 632 "IDENTIFIER", |
| 633 "INVOCATION", |
| 634 "KEYWORD", |
| 635 "NAMED_ARGUMENT", |
| 636 "OPTIONAL_ARGUMENT", |
| 637 "PARAMETER" |
| 638 ]); |
| 639 |
| 640 /** |
| 641 * ContextBuilderOptions |
| 642 * |
| 643 * { |
| 644 * "dartSdkSummaryPath": optional String |
| 645 * "defaultAnalysisOptionsFilePath": optional List<String> |
| 646 * "declaredVariables": optional Map<String, String> |
| 647 * "defaultPackageFilePath": optional List<String> |
| 648 * "defaultPackagesDirectoryPath": optional List<String> |
| 649 * } |
| 650 */ |
| 651 final Matcher isContextBuilderOptions = new LazyMatcher(() => new MatchesJsonObj
ect( |
| 652 "ContextBuilderOptions", null, optionalFields: { |
| 653 "dartSdkSummaryPath": isString, |
| 654 "defaultAnalysisOptionsFilePath": isListOf(isString), |
| 655 "declaredVariables": isMapOf(isString, isString), |
| 656 "defaultPackageFilePath": isListOf(isString), |
| 657 "defaultPackagesDirectoryPath": isListOf(isString) |
| 658 })); |
| 659 |
| 660 /** |
| 661 * ContextRoot |
| 662 * |
| 663 * { |
| 664 * "root": String |
| 665 * "exclude": List<String> |
| 666 * } |
| 667 */ |
| 668 final Matcher isContextRoot = new LazyMatcher(() => new MatchesJsonObject( |
| 669 "ContextRoot", { |
| 670 "root": isString, |
| 671 "exclude": isListOf(isString) |
| 672 })); |
| 673 |
| 674 /** |
| 675 * Element |
| 676 * |
| 677 * { |
| 678 * "kind": ElementKind |
| 679 * "name": String |
| 680 * "location": optional Location |
| 681 * "flags": int |
| 682 * "parameters": optional String |
| 683 * "returnType": optional String |
| 684 * "typeParameters": optional String |
| 685 * } |
| 686 */ |
| 687 final Matcher isElement = new LazyMatcher(() => new MatchesJsonObject( |
| 688 "Element", { |
| 689 "kind": isElementKind, |
| 690 "name": isString, |
| 691 "flags": isInt |
| 692 }, optionalFields: { |
| 693 "location": isLocation, |
| 694 "parameters": isString, |
| 695 "returnType": isString, |
| 696 "typeParameters": isString |
| 697 })); |
| 698 |
| 699 /** |
| 700 * ElementKind |
| 701 * |
| 702 * enum { |
| 703 * CLASS |
| 704 * CLASS_TYPE_ALIAS |
| 705 * COMPILATION_UNIT |
| 706 * CONSTRUCTOR |
| 707 * ENUM |
| 708 * ENUM_CONSTANT |
| 709 * FIELD |
| 710 * FILE |
| 711 * FUNCTION |
| 712 * FUNCTION_TYPE_ALIAS |
| 713 * GETTER |
| 714 * LABEL |
| 715 * LIBRARY |
| 716 * LOCAL_VARIABLE |
| 717 * METHOD |
| 718 * PARAMETER |
| 719 * PREFIX |
| 720 * SETTER |
| 721 * TOP_LEVEL_VARIABLE |
| 722 * TYPE_PARAMETER |
| 723 * UNKNOWN |
| 724 * } |
| 725 */ |
| 726 final Matcher isElementKind = new MatchesEnum("ElementKind", [ |
| 727 "CLASS", |
| 728 "CLASS_TYPE_ALIAS", |
| 729 "COMPILATION_UNIT", |
| 730 "CONSTRUCTOR", |
| 731 "ENUM", |
| 732 "ENUM_CONSTANT", |
| 733 "FIELD", |
| 734 "FILE", |
| 735 "FUNCTION", |
| 736 "FUNCTION_TYPE_ALIAS", |
| 737 "GETTER", |
| 738 "LABEL", |
| 739 "LIBRARY", |
| 740 "LOCAL_VARIABLE", |
| 741 "METHOD", |
| 742 "PARAMETER", |
| 743 "PREFIX", |
| 744 "SETTER", |
| 745 "TOP_LEVEL_VARIABLE", |
| 746 "TYPE_PARAMETER", |
| 747 "UNKNOWN" |
| 748 ]); |
| 749 |
| 750 /** |
| 751 * FilePath |
| 752 * |
| 753 * String |
| 754 */ |
| 755 final Matcher isFilePath = isString; |
| 756 |
| 757 /** |
| 758 * FoldingKind |
| 759 * |
| 760 * enum { |
| 761 * COMMENT |
| 762 * CLASS_MEMBER |
| 763 * DIRECTIVES |
| 764 * DOCUMENTATION_COMMENT |
| 765 * TOP_LEVEL_DECLARATION |
| 766 * } |
| 767 */ |
| 768 final Matcher isFoldingKind = new MatchesEnum("FoldingKind", [ |
| 769 "COMMENT", |
| 770 "CLASS_MEMBER", |
| 771 "DIRECTIVES", |
| 772 "DOCUMENTATION_COMMENT", |
| 773 "TOP_LEVEL_DECLARATION" |
| 774 ]); |
| 775 |
| 776 /** |
| 777 * FoldingRegion |
| 778 * |
| 779 * { |
| 780 * "kind": FoldingKind |
| 781 * "offset": int |
| 782 * "length": int |
| 783 * } |
| 784 */ |
| 785 final Matcher isFoldingRegion = new LazyMatcher(() => new MatchesJsonObject( |
| 786 "FoldingRegion", { |
| 787 "kind": isFoldingKind, |
| 788 "offset": isInt, |
| 789 "length": isInt |
| 790 })); |
| 791 |
| 792 /** |
| 793 * HighlightRegion |
| 794 * |
| 795 * { |
| 796 * "type": HighlightRegionType |
| 797 * "offset": int |
| 798 * "length": int |
| 799 * } |
| 800 */ |
| 801 final Matcher isHighlightRegion = new LazyMatcher(() => new MatchesJsonObject( |
| 802 "HighlightRegion", { |
| 803 "type": isHighlightRegionType, |
| 804 "offset": isInt, |
| 805 "length": isInt |
| 806 })); |
| 807 |
| 808 /** |
| 809 * HighlightRegionType |
| 810 * |
| 811 * enum { |
| 812 * ANNOTATION |
| 813 * BUILT_IN |
| 814 * CLASS |
| 815 * COMMENT_BLOCK |
| 816 * COMMENT_DOCUMENTATION |
| 817 * COMMENT_END_OF_LINE |
| 818 * CONSTRUCTOR |
| 819 * DIRECTIVE |
| 820 * DYNAMIC_TYPE |
| 821 * DYNAMIC_LOCAL_VARIABLE_DECLARATION |
| 822 * DYNAMIC_LOCAL_VARIABLE_REFERENCE |
| 823 * DYNAMIC_PARAMETER_DECLARATION |
| 824 * DYNAMIC_PARAMETER_REFERENCE |
| 825 * ENUM |
| 826 * ENUM_CONSTANT |
| 827 * FIELD |
| 828 * FIELD_STATIC |
| 829 * FUNCTION |
| 830 * FUNCTION_DECLARATION |
| 831 * FUNCTION_TYPE_ALIAS |
| 832 * GETTER_DECLARATION |
| 833 * IDENTIFIER_DEFAULT |
| 834 * IMPORT_PREFIX |
| 835 * INSTANCE_FIELD_DECLARATION |
| 836 * INSTANCE_FIELD_REFERENCE |
| 837 * INSTANCE_GETTER_DECLARATION |
| 838 * INSTANCE_GETTER_REFERENCE |
| 839 * INSTANCE_METHOD_DECLARATION |
| 840 * INSTANCE_METHOD_REFERENCE |
| 841 * INSTANCE_SETTER_DECLARATION |
| 842 * INSTANCE_SETTER_REFERENCE |
| 843 * INVALID_STRING_ESCAPE |
| 844 * KEYWORD |
| 845 * LABEL |
| 846 * LIBRARY_NAME |
| 847 * LITERAL_BOOLEAN |
| 848 * LITERAL_DOUBLE |
| 849 * LITERAL_INTEGER |
| 850 * LITERAL_LIST |
| 851 * LITERAL_MAP |
| 852 * LITERAL_STRING |
| 853 * LOCAL_FUNCTION_DECLARATION |
| 854 * LOCAL_FUNCTION_REFERENCE |
| 855 * LOCAL_VARIABLE |
| 856 * LOCAL_VARIABLE_DECLARATION |
| 857 * LOCAL_VARIABLE_REFERENCE |
| 858 * METHOD |
| 859 * METHOD_DECLARATION |
| 860 * METHOD_DECLARATION_STATIC |
| 861 * METHOD_STATIC |
| 862 * PARAMETER |
| 863 * SETTER_DECLARATION |
| 864 * TOP_LEVEL_VARIABLE |
| 865 * PARAMETER_DECLARATION |
| 866 * PARAMETER_REFERENCE |
| 867 * STATIC_FIELD_DECLARATION |
| 868 * STATIC_GETTER_DECLARATION |
| 869 * STATIC_GETTER_REFERENCE |
| 870 * STATIC_METHOD_DECLARATION |
| 871 * STATIC_METHOD_REFERENCE |
| 872 * STATIC_SETTER_DECLARATION |
| 873 * STATIC_SETTER_REFERENCE |
| 874 * TOP_LEVEL_FUNCTION_DECLARATION |
| 875 * TOP_LEVEL_FUNCTION_REFERENCE |
| 876 * TOP_LEVEL_GETTER_DECLARATION |
| 877 * TOP_LEVEL_GETTER_REFERENCE |
| 878 * TOP_LEVEL_SETTER_DECLARATION |
| 879 * TOP_LEVEL_SETTER_REFERENCE |
| 880 * TOP_LEVEL_VARIABLE_DECLARATION |
| 881 * TYPE_NAME_DYNAMIC |
| 882 * TYPE_PARAMETER |
| 883 * UNRESOLVED_INSTANCE_MEMBER_REFERENCE |
| 884 * VALID_STRING_ESCAPE |
| 885 * } |
| 886 */ |
| 887 final Matcher isHighlightRegionType = new MatchesEnum("HighlightRegionType", [ |
| 888 "ANNOTATION", |
| 889 "BUILT_IN", |
| 890 "CLASS", |
| 891 "COMMENT_BLOCK", |
| 892 "COMMENT_DOCUMENTATION", |
| 893 "COMMENT_END_OF_LINE", |
| 894 "CONSTRUCTOR", |
| 895 "DIRECTIVE", |
| 896 "DYNAMIC_TYPE", |
| 897 "DYNAMIC_LOCAL_VARIABLE_DECLARATION", |
| 898 "DYNAMIC_LOCAL_VARIABLE_REFERENCE", |
| 899 "DYNAMIC_PARAMETER_DECLARATION", |
| 900 "DYNAMIC_PARAMETER_REFERENCE", |
| 901 "ENUM", |
| 902 "ENUM_CONSTANT", |
| 903 "FIELD", |
| 904 "FIELD_STATIC", |
| 905 "FUNCTION", |
| 906 "FUNCTION_DECLARATION", |
| 907 "FUNCTION_TYPE_ALIAS", |
| 908 "GETTER_DECLARATION", |
| 909 "IDENTIFIER_DEFAULT", |
| 910 "IMPORT_PREFIX", |
| 911 "INSTANCE_FIELD_DECLARATION", |
| 912 "INSTANCE_FIELD_REFERENCE", |
| 913 "INSTANCE_GETTER_DECLARATION", |
| 914 "INSTANCE_GETTER_REFERENCE", |
| 915 "INSTANCE_METHOD_DECLARATION", |
| 916 "INSTANCE_METHOD_REFERENCE", |
| 917 "INSTANCE_SETTER_DECLARATION", |
| 918 "INSTANCE_SETTER_REFERENCE", |
| 919 "INVALID_STRING_ESCAPE", |
| 920 "KEYWORD", |
| 921 "LABEL", |
| 922 "LIBRARY_NAME", |
| 923 "LITERAL_BOOLEAN", |
| 924 "LITERAL_DOUBLE", |
| 925 "LITERAL_INTEGER", |
| 926 "LITERAL_LIST", |
| 927 "LITERAL_MAP", |
| 928 "LITERAL_STRING", |
| 929 "LOCAL_FUNCTION_DECLARATION", |
| 930 "LOCAL_FUNCTION_REFERENCE", |
| 931 "LOCAL_VARIABLE", |
| 932 "LOCAL_VARIABLE_DECLARATION", |
| 933 "LOCAL_VARIABLE_REFERENCE", |
| 934 "METHOD", |
| 935 "METHOD_DECLARATION", |
| 936 "METHOD_DECLARATION_STATIC", |
| 937 "METHOD_STATIC", |
| 938 "PARAMETER", |
| 939 "SETTER_DECLARATION", |
| 940 "TOP_LEVEL_VARIABLE", |
| 941 "PARAMETER_DECLARATION", |
| 942 "PARAMETER_REFERENCE", |
| 943 "STATIC_FIELD_DECLARATION", |
| 944 "STATIC_GETTER_DECLARATION", |
| 945 "STATIC_GETTER_REFERENCE", |
| 946 "STATIC_METHOD_DECLARATION", |
| 947 "STATIC_METHOD_REFERENCE", |
| 948 "STATIC_SETTER_DECLARATION", |
| 949 "STATIC_SETTER_REFERENCE", |
| 950 "TOP_LEVEL_FUNCTION_DECLARATION", |
| 951 "TOP_LEVEL_FUNCTION_REFERENCE", |
| 952 "TOP_LEVEL_GETTER_DECLARATION", |
| 953 "TOP_LEVEL_GETTER_REFERENCE", |
| 954 "TOP_LEVEL_SETTER_DECLARATION", |
| 955 "TOP_LEVEL_SETTER_REFERENCE", |
| 956 "TOP_LEVEL_VARIABLE_DECLARATION", |
| 957 "TYPE_NAME_DYNAMIC", |
| 958 "TYPE_PARAMETER", |
| 959 "UNRESOLVED_INSTANCE_MEMBER_REFERENCE", |
| 960 "VALID_STRING_ESCAPE" |
| 961 ]); |
| 962 |
| 963 /** |
| 964 * LinkedEditGroup |
| 965 * |
| 966 * { |
| 967 * "positions": List<Position> |
| 968 * "length": int |
| 969 * "suggestions": List<LinkedEditSuggestion> |
| 970 * } |
| 971 */ |
| 972 final Matcher isLinkedEditGroup = new LazyMatcher(() => new MatchesJsonObject( |
| 973 "LinkedEditGroup", { |
| 974 "positions": isListOf(isPosition), |
| 975 "length": isInt, |
| 976 "suggestions": isListOf(isLinkedEditSuggestion) |
| 977 })); |
| 978 |
| 979 /** |
| 980 * LinkedEditSuggestion |
| 981 * |
| 982 * { |
| 983 * "value": String |
| 984 * "kind": LinkedEditSuggestionKind |
| 985 * } |
| 986 */ |
| 987 final Matcher isLinkedEditSuggestion = new LazyMatcher(() => new MatchesJsonObje
ct( |
| 988 "LinkedEditSuggestion", { |
| 989 "value": isString, |
| 990 "kind": isLinkedEditSuggestionKind |
| 991 })); |
| 992 |
| 993 /** |
| 994 * LinkedEditSuggestionKind |
| 995 * |
| 996 * enum { |
| 997 * METHOD |
| 998 * PARAMETER |
| 999 * TYPE |
| 1000 * VARIABLE |
| 1001 * } |
| 1002 */ |
| 1003 final Matcher isLinkedEditSuggestionKind = new MatchesEnum("LinkedEditSuggestion
Kind", [ |
| 1004 "METHOD", |
| 1005 "PARAMETER", |
| 1006 "TYPE", |
| 1007 "VARIABLE" |
| 1008 ]); |
| 1009 |
| 1010 /** |
| 1011 * Location |
| 1012 * |
| 1013 * { |
| 1014 * "file": FilePath |
| 1015 * "offset": int |
| 1016 * "length": int |
| 1017 * "startLine": int |
| 1018 * "startColumn": int |
| 1019 * } |
| 1020 */ |
| 1021 final Matcher isLocation = new LazyMatcher(() => new MatchesJsonObject( |
| 1022 "Location", { |
| 1023 "file": isFilePath, |
| 1024 "offset": isInt, |
| 1025 "length": isInt, |
| 1026 "startLine": isInt, |
| 1027 "startColumn": isInt |
| 1028 })); |
| 1029 |
| 1030 /** |
| 1031 * NavigationRegion |
| 1032 * |
| 1033 * { |
| 1034 * "offset": int |
| 1035 * "length": int |
| 1036 * "targets": List<int> |
| 1037 * } |
| 1038 */ |
| 1039 final Matcher isNavigationRegion = new LazyMatcher(() => new MatchesJsonObject( |
| 1040 "NavigationRegion", { |
| 1041 "offset": isInt, |
| 1042 "length": isInt, |
| 1043 "targets": isListOf(isInt) |
| 1044 })); |
| 1045 |
| 1046 /** |
| 1047 * NavigationTarget |
| 1048 * |
| 1049 * { |
| 1050 * "kind": ElementKind |
| 1051 * "fileIndex": int |
| 1052 * "offset": int |
| 1053 * "length": int |
| 1054 * "startLine": int |
| 1055 * "startColumn": int |
| 1056 * } |
| 1057 */ |
| 1058 final Matcher isNavigationTarget = new LazyMatcher(() => new MatchesJsonObject( |
| 1059 "NavigationTarget", { |
| 1060 "kind": isElementKind, |
| 1061 "fileIndex": isInt, |
| 1062 "offset": isInt, |
| 1063 "length": isInt, |
| 1064 "startLine": isInt, |
| 1065 "startColumn": isInt |
| 1066 })); |
| 1067 |
| 1068 /** |
| 1069 * Occurrences |
| 1070 * |
| 1071 * { |
| 1072 * "element": Element |
| 1073 * "offsets": List<int> |
| 1074 * "length": int |
| 1075 * } |
| 1076 */ |
| 1077 final Matcher isOccurrences = new LazyMatcher(() => new MatchesJsonObject( |
| 1078 "Occurrences", { |
| 1079 "element": isElement, |
| 1080 "offsets": isListOf(isInt), |
| 1081 "length": isInt |
| 1082 })); |
| 1083 |
| 1084 /** |
| 1085 * Outline |
| 1086 * |
| 1087 * { |
| 1088 * "element": Element |
| 1089 * "offset": int |
| 1090 * "length": int |
| 1091 * "children": optional List<Outline> |
| 1092 * } |
| 1093 */ |
| 1094 final Matcher isOutline = new LazyMatcher(() => new MatchesJsonObject( |
| 1095 "Outline", { |
| 1096 "element": isElement, |
| 1097 "offset": isInt, |
| 1098 "length": isInt |
| 1099 }, optionalFields: { |
| 1100 "children": isListOf(isOutline) |
| 1101 })); |
| 1102 |
| 1103 /** |
| 1104 * Position |
| 1105 * |
| 1106 * { |
| 1107 * "file": FilePath |
| 1108 * "offset": int |
| 1109 * } |
| 1110 */ |
| 1111 final Matcher isPosition = new LazyMatcher(() => new MatchesJsonObject( |
| 1112 "Position", { |
| 1113 "file": isFilePath, |
| 1114 "offset": isInt |
| 1115 })); |
| 1116 |
| 1117 /** |
| 1118 * RefactoringFeedback |
| 1119 * |
| 1120 * { |
| 1121 * } |
| 1122 */ |
| 1123 final Matcher isRefactoringFeedback = new LazyMatcher(() => new MatchesJsonObjec
t( |
| 1124 "RefactoringFeedback", null)); |
| 1125 |
| 1126 /** |
| 1127 * RefactoringKind |
| 1128 * |
| 1129 * enum { |
| 1130 * CONVERT_GETTER_TO_METHOD |
| 1131 * CONVERT_METHOD_TO_GETTER |
| 1132 * EXTRACT_LOCAL_VARIABLE |
| 1133 * EXTRACT_METHOD |
| 1134 * INLINE_LOCAL_VARIABLE |
| 1135 * INLINE_METHOD |
| 1136 * MOVE_FILE |
| 1137 * RENAME |
| 1138 * SORT_MEMBERS |
| 1139 * } |
| 1140 */ |
| 1141 final Matcher isRefactoringKind = new MatchesEnum("RefactoringKind", [ |
| 1142 "CONVERT_GETTER_TO_METHOD", |
| 1143 "CONVERT_METHOD_TO_GETTER", |
| 1144 "EXTRACT_LOCAL_VARIABLE", |
| 1145 "EXTRACT_METHOD", |
| 1146 "INLINE_LOCAL_VARIABLE", |
| 1147 "INLINE_METHOD", |
| 1148 "MOVE_FILE", |
| 1149 "RENAME", |
| 1150 "SORT_MEMBERS" |
| 1151 ]); |
| 1152 |
| 1153 /** |
| 1154 * RefactoringMethodParameter |
| 1155 * |
| 1156 * { |
| 1157 * "id": optional String |
| 1158 * "kind": RefactoringMethodParameterKind |
| 1159 * "type": String |
| 1160 * "name": String |
| 1161 * "parameters": optional String |
| 1162 * } |
| 1163 */ |
| 1164 final Matcher isRefactoringMethodParameter = new LazyMatcher(() => new MatchesJs
onObject( |
| 1165 "RefactoringMethodParameter", { |
| 1166 "kind": isRefactoringMethodParameterKind, |
| 1167 "type": isString, |
| 1168 "name": isString |
| 1169 }, optionalFields: { |
| 1170 "id": isString, |
| 1171 "parameters": isString |
| 1172 })); |
| 1173 |
| 1174 /** |
| 1175 * RefactoringOptions |
| 1176 * |
| 1177 * { |
| 1178 * } |
| 1179 */ |
| 1180 final Matcher isRefactoringOptions = new LazyMatcher(() => new MatchesJsonObject
( |
| 1181 "RefactoringOptions", null)); |
| 1182 |
| 1183 /** |
| 1184 * RefactoringMethodParameterKind |
| 1185 * |
| 1186 * enum { |
| 1187 * REQUIRED |
| 1188 * POSITIONAL |
| 1189 * NAMED |
| 1190 * } |
| 1191 */ |
| 1192 final Matcher isRefactoringMethodParameterKind = new MatchesEnum("RefactoringMet
hodParameterKind", [ |
| 1193 "REQUIRED", |
| 1194 "POSITIONAL", |
| 1195 "NAMED" |
| 1196 ]); |
| 1197 |
| 1198 /** |
| 1199 * RefactoringProblem |
| 1200 * |
| 1201 * { |
| 1202 * "severity": RefactoringProblemSeverity |
| 1203 * "message": String |
| 1204 * "location": optional Location |
| 1205 * } |
| 1206 */ |
| 1207 final Matcher isRefactoringProblem = new LazyMatcher(() => new MatchesJsonObject
( |
| 1208 "RefactoringProblem", { |
| 1209 "severity": isRefactoringProblemSeverity, |
| 1210 "message": isString |
| 1211 }, optionalFields: { |
| 1212 "location": isLocation |
| 1213 })); |
| 1214 |
| 1215 /** |
| 1216 * RefactoringProblemSeverity |
| 1217 * |
| 1218 * enum { |
| 1219 * INFO |
| 1220 * WARNING |
| 1221 * ERROR |
| 1222 * FATAL |
| 1223 * } |
| 1224 */ |
| 1225 final Matcher isRefactoringProblemSeverity = new MatchesEnum("RefactoringProblem
Severity", [ |
| 1226 "INFO", |
| 1227 "WARNING", |
| 1228 "ERROR", |
| 1229 "FATAL" |
| 1230 ]); |
| 1231 |
| 1232 /** |
| 1233 * RemoveContentOverlay |
| 1234 * |
| 1235 * { |
| 1236 * "type": "remove" |
| 1237 * } |
| 1238 */ |
| 1239 final Matcher isRemoveContentOverlay = new LazyMatcher(() => new MatchesJsonObje
ct( |
| 1240 "RemoveContentOverlay", { |
| 1241 "type": equals("remove") |
| 1242 })); |
| 1243 |
| 1244 /** |
| 1245 * RequestError |
| 1246 * |
| 1247 * { |
| 1248 * "code": RequestErrorCode |
| 1249 * "message": String |
| 1250 * "stackTrace": optional String |
| 1251 * } |
| 1252 */ |
| 1253 final Matcher isRequestError = new LazyMatcher(() => new MatchesJsonObject( |
| 1254 "RequestError", { |
| 1255 "code": isRequestErrorCode, |
| 1256 "message": isString |
| 1257 }, optionalFields: { |
| 1258 "stackTrace": isString |
| 1259 })); |
| 1260 |
| 1261 /** |
| 1262 * RequestErrorCode |
| 1263 * |
| 1264 * enum { |
| 1265 * INVALID_OVERLAY_CHANGE |
| 1266 * INVALID_PARAMETER |
| 1267 * PLUGIN_ERROR |
| 1268 * UNKNOWN_REQUEST |
| 1269 * } |
| 1270 */ |
| 1271 final Matcher isRequestErrorCode = new MatchesEnum("RequestErrorCode", [ |
| 1272 "INVALID_OVERLAY_CHANGE", |
| 1273 "INVALID_PARAMETER", |
| 1274 "PLUGIN_ERROR", |
| 1275 "UNKNOWN_REQUEST" |
| 1276 ]); |
| 1277 |
| 1278 /** |
| 1279 * SourceChange |
| 1280 * |
| 1281 * { |
| 1282 * "message": String |
| 1283 * "edits": List<SourceFileEdit> |
| 1284 * "linkedEditGroups": List<LinkedEditGroup> |
| 1285 * "selection": optional Position |
| 1286 * } |
| 1287 */ |
| 1288 final Matcher isSourceChange = new LazyMatcher(() => new MatchesJsonObject( |
| 1289 "SourceChange", { |
| 1290 "message": isString, |
| 1291 "edits": isListOf(isSourceFileEdit), |
| 1292 "linkedEditGroups": isListOf(isLinkedEditGroup) |
| 1293 }, optionalFields: { |
| 1294 "selection": isPosition |
| 1295 })); |
| 1296 |
| 1297 /** |
| 1298 * SourceEdit |
| 1299 * |
| 1300 * { |
| 1301 * "offset": int |
| 1302 * "length": int |
| 1303 * "replacement": String |
| 1304 * "id": optional String |
| 1305 * } |
| 1306 */ |
| 1307 final Matcher isSourceEdit = new LazyMatcher(() => new MatchesJsonObject( |
| 1308 "SourceEdit", { |
| 1309 "offset": isInt, |
| 1310 "length": isInt, |
| 1311 "replacement": isString |
| 1312 }, optionalFields: { |
| 1313 "id": isString |
| 1314 })); |
| 1315 |
| 1316 /** |
| 1317 * SourceFileEdit |
| 1318 * |
| 1319 * { |
| 1320 * "file": FilePath |
| 1321 * "fileStamp": long |
| 1322 * "edits": List<SourceEdit> |
| 1323 * } |
| 1324 */ |
| 1325 final Matcher isSourceFileEdit = new LazyMatcher(() => new MatchesJsonObject( |
| 1326 "SourceFileEdit", { |
| 1327 "file": isFilePath, |
| 1328 "fileStamp": isInt, |
| 1329 "edits": isListOf(isSourceEdit) |
| 1330 })); |
| 1331 |
| 1332 /** |
| 1333 * WatchEvent |
| 1334 * |
| 1335 * { |
| 1336 * "type": WatchEventType |
| 1337 * "path": String |
| 1338 * } |
| 1339 */ |
| 1340 final Matcher isWatchEvent = new LazyMatcher(() => new MatchesJsonObject( |
| 1341 "WatchEvent", { |
| 1342 "type": isWatchEventType, |
| 1343 "path": isString |
| 1344 })); |
| 1345 |
| 1346 /** |
| 1347 * WatchEventType |
| 1348 * |
| 1349 * enum { |
| 1350 * ADD |
| 1351 * MODIFY |
| 1352 * REMOVE |
| 1353 * } |
| 1354 */ |
| 1355 final Matcher isWatchEventType = new MatchesEnum("WatchEventType", [ |
| 1356 "ADD", |
| 1357 "MODIFY", |
| 1358 "REMOVE" |
| 1359 ]); |
| 1360 |
| 1361 /** |
| 1362 * convertGetterToMethod feedback |
| 1363 */ |
| 1364 final Matcher isConvertGetterToMethodFeedback = isNull; |
| 1365 |
| 1366 /** |
| 1367 * convertGetterToMethod options |
| 1368 */ |
| 1369 final Matcher isConvertGetterToMethodOptions = isNull; |
| 1370 |
| 1371 /** |
| 1372 * convertMethodToGetter feedback |
| 1373 */ |
| 1374 final Matcher isConvertMethodToGetterFeedback = isNull; |
| 1375 |
| 1376 /** |
| 1377 * convertMethodToGetter options |
| 1378 */ |
| 1379 final Matcher isConvertMethodToGetterOptions = isNull; |
| 1380 |
| 1381 /** |
| 1382 * extractLocalVariable feedback |
| 1383 * |
| 1384 * { |
| 1385 * "coveringExpressionOffsets": optional List<int> |
| 1386 * "coveringExpressionLengths": optional List<int> |
| 1387 * "names": List<String> |
| 1388 * "offsets": List<int> |
| 1389 * "lengths": List<int> |
| 1390 * } |
| 1391 */ |
| 1392 final Matcher isExtractLocalVariableFeedback = new LazyMatcher(() => new Matches
JsonObject( |
| 1393 "extractLocalVariable feedback", { |
| 1394 "names": isListOf(isString), |
| 1395 "offsets": isListOf(isInt), |
| 1396 "lengths": isListOf(isInt) |
| 1397 }, optionalFields: { |
| 1398 "coveringExpressionOffsets": isListOf(isInt), |
| 1399 "coveringExpressionLengths": isListOf(isInt) |
| 1400 })); |
| 1401 |
| 1402 /** |
| 1403 * extractLocalVariable options |
| 1404 * |
| 1405 * { |
| 1406 * "name": String |
| 1407 * "extractAll": bool |
| 1408 * } |
| 1409 */ |
| 1410 final Matcher isExtractLocalVariableOptions = new LazyMatcher(() => new MatchesJ
sonObject( |
| 1411 "extractLocalVariable options", { |
| 1412 "name": isString, |
| 1413 "extractAll": isBool |
| 1414 })); |
| 1415 |
| 1416 /** |
| 1417 * extractMethod feedback |
| 1418 * |
| 1419 * { |
| 1420 * "offset": int |
| 1421 * "length": int |
| 1422 * "returnType": String |
| 1423 * "names": List<String> |
| 1424 * "canCreateGetter": bool |
| 1425 * "parameters": List<RefactoringMethodParameter> |
| 1426 * "offsets": List<int> |
| 1427 * "lengths": List<int> |
| 1428 * } |
| 1429 */ |
| 1430 final Matcher isExtractMethodFeedback = new LazyMatcher(() => new MatchesJsonObj
ect( |
| 1431 "extractMethod feedback", { |
| 1432 "offset": isInt, |
| 1433 "length": isInt, |
| 1434 "returnType": isString, |
| 1435 "names": isListOf(isString), |
| 1436 "canCreateGetter": isBool, |
| 1437 "parameters": isListOf(isRefactoringMethodParameter), |
| 1438 "offsets": isListOf(isInt), |
| 1439 "lengths": isListOf(isInt) |
| 1440 })); |
| 1441 |
| 1442 /** |
| 1443 * extractMethod options |
| 1444 * |
| 1445 * { |
| 1446 * "returnType": String |
| 1447 * "createGetter": bool |
| 1448 * "name": String |
| 1449 * "parameters": List<RefactoringMethodParameter> |
| 1450 * "extractAll": bool |
| 1451 * } |
| 1452 */ |
| 1453 final Matcher isExtractMethodOptions = new LazyMatcher(() => new MatchesJsonObje
ct( |
| 1454 "extractMethod options", { |
| 1455 "returnType": isString, |
| 1456 "createGetter": isBool, |
| 1457 "name": isString, |
| 1458 "parameters": isListOf(isRefactoringMethodParameter), |
| 1459 "extractAll": isBool |
| 1460 })); |
| 1461 |
| 1462 /** |
| 1463 * inlineLocalVariable feedback |
| 1464 * |
| 1465 * { |
| 1466 * "name": String |
| 1467 * "occurrences": int |
| 1468 * } |
| 1469 */ |
| 1470 final Matcher isInlineLocalVariableFeedback = new LazyMatcher(() => new MatchesJ
sonObject( |
| 1471 "inlineLocalVariable feedback", { |
| 1472 "name": isString, |
| 1473 "occurrences": isInt |
| 1474 })); |
| 1475 |
| 1476 /** |
| 1477 * inlineLocalVariable options |
| 1478 */ |
| 1479 final Matcher isInlineLocalVariableOptions = isNull; |
| 1480 |
| 1481 /** |
| 1482 * inlineMethod feedback |
| 1483 * |
| 1484 * { |
| 1485 * "className": optional String |
| 1486 * "methodName": String |
| 1487 * "isDeclaration": bool |
| 1488 * } |
| 1489 */ |
| 1490 final Matcher isInlineMethodFeedback = new LazyMatcher(() => new MatchesJsonObje
ct( |
| 1491 "inlineMethod feedback", { |
| 1492 "methodName": isString, |
| 1493 "isDeclaration": isBool |
| 1494 }, optionalFields: { |
| 1495 "className": isString |
| 1496 })); |
| 1497 |
| 1498 /** |
| 1499 * inlineMethod options |
| 1500 * |
| 1501 * { |
| 1502 * "deleteSource": bool |
| 1503 * "inlineAll": bool |
| 1504 * } |
| 1505 */ |
| 1506 final Matcher isInlineMethodOptions = new LazyMatcher(() => new MatchesJsonObjec
t( |
| 1507 "inlineMethod options", { |
| 1508 "deleteSource": isBool, |
| 1509 "inlineAll": isBool |
| 1510 })); |
| 1511 |
| 1512 /** |
| 1513 * moveFile feedback |
| 1514 */ |
| 1515 final Matcher isMoveFileFeedback = isNull; |
| 1516 |
| 1517 /** |
| 1518 * moveFile options |
| 1519 * |
| 1520 * { |
| 1521 * "newFile": FilePath |
| 1522 * } |
| 1523 */ |
| 1524 final Matcher isMoveFileOptions = new LazyMatcher(() => new MatchesJsonObject( |
| 1525 "moveFile options", { |
| 1526 "newFile": isFilePath |
| 1527 })); |
| 1528 |
| 1529 /** |
| 1530 * rename feedback |
| 1531 * |
| 1532 * { |
| 1533 * "offset": int |
| 1534 * "length": int |
| 1535 * "elementKindName": String |
| 1536 * "oldName": String |
| 1537 * } |
| 1538 */ |
| 1539 final Matcher isRenameFeedback = new LazyMatcher(() => new MatchesJsonObject( |
| 1540 "rename feedback", { |
| 1541 "offset": isInt, |
| 1542 "length": isInt, |
| 1543 "elementKindName": isString, |
| 1544 "oldName": isString |
| 1545 })); |
| 1546 |
| 1547 /** |
| 1548 * rename options |
| 1549 * |
| 1550 * { |
| 1551 * "newName": String |
| 1552 * } |
| 1553 */ |
| 1554 final Matcher isRenameOptions = new LazyMatcher(() => new MatchesJsonObject( |
| 1555 "rename options", { |
| 1556 "newName": isString |
| 1557 })); |
| 1558 |
OLD | NEW |