| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // | 4 // |
| 5 // This file has been automatically generated. Please do not edit it manually. | 5 // This file has been automatically generated. Please do not edit it manually. |
| 6 // To regenerate the file, use the script | 6 // To regenerate the file, use the script |
| 7 // "pkg/analysis_server/tool/spec/generate_files". | 7 // "pkg/analysis_server/tool/spec/generate_files". |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Matchers for data types defined in the analysis server API | 10 * Matchers for data types defined in the analysis server API |
| 11 */ | 11 */ |
| 12 import 'package:test/test.dart'; | 12 import 'package:test/test.dart'; |
| 13 | 13 |
| 14 import 'integration_tests.dart'; | 14 import 'integration_tests.dart'; |
| 15 | 15 |
| 16 /** | 16 /** |
| 17 * plugin.versionCheck params | |
| 18 * | |
| 19 * { | |
| 20 * "byteStorePath": String | |
| 21 * "version": String | |
| 22 * } | |
| 23 */ | |
| 24 final Matcher isPluginVersionCheckParams = new LazyMatcher(() => | |
| 25 new MatchesJsonObject("plugin.versionCheck params", | |
| 26 {"byteStorePath": isString, "version": isString})); | |
| 27 | |
| 28 /** | |
| 29 * plugin.versionCheck result | |
| 30 * | |
| 31 * { | |
| 32 * "isCompatible": bool | |
| 33 * "name": String | |
| 34 * "version": String | |
| 35 * "contactInfo": optional String | |
| 36 * "interestingFiles": List<String> | |
| 37 * } | |
| 38 */ | |
| 39 final Matcher isPluginVersionCheckResult = | |
| 40 new LazyMatcher(() => new MatchesJsonObject("plugin.versionCheck result", { | |
| 41 "isCompatible": isBool, | |
| 42 "name": isString, | |
| 43 "version": isString, | |
| 44 "interestingFiles": isListOf(isString) | |
| 45 }, optionalFields: { | |
| 46 "contactInfo": 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, "message": isString, "stackTrace": isString})); | |
| 71 | |
| 72 /** | |
| 73 * analysis.handleWatchEvents params | |
| 74 * | |
| 75 * { | |
| 76 * "events": List<WatchEvent> | |
| 77 * } | |
| 78 */ | |
| 79 final Matcher isAnalysisHandleWatchEventsParams = new LazyMatcher(() => | |
| 80 new MatchesJsonObject("analysis.handleWatchEvents params", | |
| 81 {"events": isListOf(isWatchEvent)})); | |
| 82 | |
| 83 /** | |
| 84 * analysis.handleWatchEvents result | |
| 85 */ | |
| 86 final Matcher isAnalysisHandleWatchEventsResult = isNull; | |
| 87 | |
| 88 /** | |
| 89 * analysis.reanalyze params | |
| 90 * | |
| 91 * { | |
| 92 * "roots": optional List<FilePath> | |
| 93 * } | |
| 94 */ | |
| 95 final Matcher isAnalysisReanalyzeParams = new LazyMatcher(() => | |
| 96 new MatchesJsonObject("analysis.reanalyze params", null, | |
| 97 optionalFields: {"roots": isListOf(isFilePath)})); | |
| 98 | |
| 99 /** | |
| 100 * analysis.reanalyze result | |
| 101 */ | |
| 102 final Matcher isAnalysisReanalyzeResult = isNull; | |
| 103 | |
| 104 /** | |
| 105 * analysis.setContextBuilderOptions params | |
| 106 * | |
| 107 * { | |
| 108 * "options": ContextBuilderOptions | |
| 109 * } | |
| 110 */ | |
| 111 final Matcher isAnalysisSetContextBuilderOptionsParams = new LazyMatcher(() => | |
| 112 new MatchesJsonObject("analysis.setContextBuilderOptions params", | |
| 113 {"options": isContextBuilderOptions})); | |
| 114 | |
| 115 /** | |
| 116 * analysis.setContextBuilderOptions result | |
| 117 */ | |
| 118 final Matcher isAnalysisSetContextBuilderOptionsResult = isNull; | |
| 119 | |
| 120 /** | |
| 121 * analysis.setContextRoots params | |
| 122 * | |
| 123 * { | |
| 124 * "roots": List<ContextRoot> | |
| 125 * } | |
| 126 */ | |
| 127 final Matcher isAnalysisSetContextRootsParams = new LazyMatcher(() => | |
| 128 new MatchesJsonObject( | |
| 129 "analysis.setContextRoots params", {"roots": isListOf(isContextRoot)})); | |
| 130 | |
| 131 /** | |
| 132 * analysis.setContextRoots result | |
| 133 */ | |
| 134 final Matcher isAnalysisSetContextRootsResult = isNull; | |
| 135 | |
| 136 /** | |
| 137 * analysis.setPriorityFiles params | |
| 138 * | |
| 139 * { | |
| 140 * "files": List<FilePath> | |
| 141 * } | |
| 142 */ | |
| 143 final Matcher isAnalysisSetPriorityFilesParams = new LazyMatcher(() => | |
| 144 new MatchesJsonObject( | |
| 145 "analysis.setPriorityFiles params", {"files": isListOf(isFilePath)})); | |
| 146 | |
| 147 /** | |
| 148 * analysis.setPriorityFiles result | |
| 149 */ | |
| 150 final Matcher isAnalysisSetPriorityFilesResult = isNull; | |
| 151 | |
| 152 /** | |
| 153 * analysis.setSubscriptions params | |
| 154 * | |
| 155 * { | |
| 156 * "subscriptions": Map<AnalysisService, List<FilePath>> | |
| 157 * } | |
| 158 */ | |
| 159 final Matcher isAnalysisSetSubscriptionsParams = new LazyMatcher(() => | |
| 160 new MatchesJsonObject("analysis.setSubscriptions params", | |
| 161 {"subscriptions": isMapOf(isAnalysisService, isListOf(isFilePath))})); | |
| 162 | |
| 163 /** | |
| 164 * analysis.setSubscriptions result | |
| 165 */ | |
| 166 final Matcher isAnalysisSetSubscriptionsResult = isNull; | |
| 167 | |
| 168 /** | |
| 169 * analysis.updateContent params | |
| 170 * | |
| 171 * { | |
| 172 * "files": Map<FilePath, AddContentOverlay | ChangeContentOverlay | RemoveCon
tentOverlay> | |
| 173 * } | |
| 174 */ | |
| 175 final Matcher isAnalysisUpdateContentParams = new LazyMatcher( | |
| 176 () => new MatchesJsonObject("analysis.updateContent params", { | |
| 177 "files": isMapOf( | |
| 178 isFilePath, | |
| 179 isOneOf([ | |
| 180 isAddContentOverlay, | |
| 181 isChangeContentOverlay, | |
| 182 isRemoveContentOverlay | |
| 183 ])) | |
| 184 })); | |
| 185 | |
| 186 /** | |
| 187 * analysis.updateContent result | |
| 188 */ | |
| 189 final Matcher isAnalysisUpdateContentResult = isNull; | |
| 190 | |
| 191 /** | |
| 192 * analysis.errors params | |
| 193 * | |
| 194 * { | |
| 195 * "file": FilePath | |
| 196 * "errors": List<AnalysisError> | |
| 197 * } | |
| 198 */ | |
| 199 final Matcher isAnalysisErrorsParams = new LazyMatcher(() => | |
| 200 new MatchesJsonObject("analysis.errors params", | |
| 201 {"file": isFilePath, "errors": isListOf(isAnalysisError)})); | |
| 202 | |
| 203 /** | |
| 204 * analysis.folding params | |
| 205 * | |
| 206 * { | |
| 207 * "file": FilePath | |
| 208 * "regions": List<FoldingRegion> | |
| 209 * } | |
| 210 */ | |
| 211 final Matcher isAnalysisFoldingParams = new LazyMatcher(() => | |
| 212 new MatchesJsonObject("analysis.folding params", | |
| 213 {"file": isFilePath, "regions": isListOf(isFoldingRegion)})); | |
| 214 | |
| 215 /** | |
| 216 * analysis.highlights params | |
| 217 * | |
| 218 * { | |
| 219 * "file": FilePath | |
| 220 * "regions": List<HighlightRegion> | |
| 221 * } | |
| 222 */ | |
| 223 final Matcher isAnalysisHighlightsParams = new LazyMatcher(() => | |
| 224 new MatchesJsonObject("analysis.highlights params", | |
| 225 {"file": isFilePath, "regions": isListOf(isHighlightRegion)})); | |
| 226 | |
| 227 /** | |
| 228 * analysis.navigation params | |
| 229 * | |
| 230 * { | |
| 231 * "file": FilePath | |
| 232 * "regions": List<NavigationRegion> | |
| 233 * "targets": List<NavigationTarget> | |
| 234 * "files": List<FilePath> | |
| 235 * } | |
| 236 */ | |
| 237 final Matcher isAnalysisNavigationParams = | |
| 238 new LazyMatcher(() => new MatchesJsonObject("analysis.navigation params", { | |
| 239 "file": isFilePath, | |
| 240 "regions": isListOf(isNavigationRegion), | |
| 241 "targets": isListOf(isNavigationTarget), | |
| 242 "files": isListOf(isFilePath) | |
| 243 })); | |
| 244 | |
| 245 /** | |
| 246 * analysis.occurrences params | |
| 247 * | |
| 248 * { | |
| 249 * "file": FilePath | |
| 250 * "occurrences": List<Occurrences> | |
| 251 * } | |
| 252 */ | |
| 253 final Matcher isAnalysisOccurrencesParams = new LazyMatcher(() => | |
| 254 new MatchesJsonObject("analysis.occurrences params", | |
| 255 {"file": isFilePath, "occurrences": isListOf(isOccurrences)})); | |
| 256 | |
| 257 /** | |
| 258 * analysis.outline params | |
| 259 * | |
| 260 * { | |
| 261 * "file": FilePath | |
| 262 * "outline": List<Outline> | |
| 263 * } | |
| 264 */ | |
| 265 final Matcher isAnalysisOutlineParams = new LazyMatcher(() => | |
| 266 new MatchesJsonObject("analysis.outline params", | |
| 267 {"file": isFilePath, "outline": isListOf(isOutline)})); | |
| 268 | |
| 269 /** | |
| 270 * completion.getSuggestions params | |
| 271 * | |
| 272 * { | |
| 273 * "file": FilePath | |
| 274 * "offset": int | |
| 275 * } | |
| 276 */ | |
| 277 final Matcher isCompletionGetSuggestionsParams = new LazyMatcher(() => | |
| 278 new MatchesJsonObject("completion.getSuggestions params", | |
| 279 {"file": isFilePath, "offset": isInt})); | |
| 280 | |
| 281 /** | |
| 282 * completion.getSuggestions result | |
| 283 * | |
| 284 * { | |
| 285 * "replacementOffset": int | |
| 286 * "replacementLength": int | |
| 287 * "results": List<CompletionSuggestion> | |
| 288 * } | |
| 289 */ | |
| 290 final Matcher isCompletionGetSuggestionsResult = new LazyMatcher( | |
| 291 () => new MatchesJsonObject("completion.getSuggestions result", { | |
| 292 "replacementOffset": isInt, | |
| 293 "replacementLength": isInt, | |
| 294 "results": isListOf(isCompletionSuggestion) | |
| 295 })); | |
| 296 | |
| 297 /** | |
| 298 * edit.getAssists params | |
| 299 * | |
| 300 * { | |
| 301 * "file": FilePath | |
| 302 * "offset": int | |
| 303 * "length": int | |
| 304 * } | |
| 305 */ | |
| 306 final Matcher isEditGetAssistsParams = new LazyMatcher(() => | |
| 307 new MatchesJsonObject("edit.getAssists params", | |
| 308 {"file": isFilePath, "offset": isInt, "length": isInt})); | |
| 309 | |
| 310 /** | |
| 311 * edit.getAssists result | |
| 312 * | |
| 313 * { | |
| 314 * "assists": List<PrioritizedSourceChange> | |
| 315 * } | |
| 316 */ | |
| 317 final Matcher isEditGetAssistsResult = new LazyMatcher(() => | |
| 318 new MatchesJsonObject("edit.getAssists result", | |
| 319 {"assists": isListOf(isPrioritizedSourceChange)})); | |
| 320 | |
| 321 /** | |
| 322 * edit.getAvailableRefactorings params | |
| 323 * | |
| 324 * { | |
| 325 * "file": FilePath | |
| 326 * "offset": int | |
| 327 * "length": int | |
| 328 * } | |
| 329 */ | |
| 330 final Matcher isEditGetAvailableRefactoringsParams = new LazyMatcher(() => | |
| 331 new MatchesJsonObject("edit.getAvailableRefactorings params", | |
| 332 {"file": isFilePath, "offset": isInt, "length": isInt})); | |
| 333 | |
| 334 /** | |
| 335 * edit.getAvailableRefactorings result | |
| 336 * | |
| 337 * { | |
| 338 * "kinds": List<RefactoringKind> | |
| 339 * } | |
| 340 */ | |
| 341 final Matcher isEditGetAvailableRefactoringsResult = new LazyMatcher(() => | |
| 342 new MatchesJsonObject("edit.getAvailableRefactorings result", | |
| 343 {"kinds": isListOf(isRefactoringKind)})); | |
| 344 | |
| 345 /** | |
| 346 * edit.getFixes params | |
| 347 * | |
| 348 * { | |
| 349 * "file": FilePath | |
| 350 * "offset": int | |
| 351 * } | |
| 352 */ | |
| 353 final Matcher isEditGetFixesParams = new LazyMatcher(() => | |
| 354 new MatchesJsonObject( | |
| 355 "edit.getFixes params", {"file": isFilePath, "offset": isInt})); | |
| 356 | |
| 357 /** | |
| 358 * edit.getFixes result | |
| 359 * | |
| 360 * { | |
| 361 * "fixes": List<AnalysisErrorFixes> | |
| 362 * } | |
| 363 */ | |
| 364 final Matcher isEditGetFixesResult = new LazyMatcher(() => | |
| 365 new MatchesJsonObject( | |
| 366 "edit.getFixes result", {"fixes": isListOf(isAnalysisErrorFixes)})); | |
| 367 | |
| 368 /** | |
| 369 * edit.getRefactoring params | |
| 370 * | |
| 371 * { | |
| 372 * "kind": RefactoringKind | |
| 373 * "file": FilePath | |
| 374 * "offset": int | |
| 375 * "length": int | |
| 376 * "validateOnly": bool | |
| 377 * "options": optional RefactoringOptions | |
| 378 * } | |
| 379 */ | |
| 380 final Matcher isEditGetRefactoringParams = | |
| 381 new LazyMatcher(() => new MatchesJsonObject("edit.getRefactoring params", { | |
| 382 "kind": isRefactoringKind, | |
| 383 "file": isFilePath, | |
| 384 "offset": isInt, | |
| 385 "length": isInt, | |
| 386 "validateOnly": isBool | |
| 387 }, optionalFields: { | |
| 388 "options": isRefactoringOptions | |
| 389 })); | |
| 390 | |
| 391 /** | |
| 392 * edit.getRefactoring result | |
| 393 * | |
| 394 * { | |
| 395 * "initialProblems": List<RefactoringProblem> | |
| 396 * "optionsProblems": List<RefactoringProblem> | |
| 397 * "finalProblems": List<RefactoringProblem> | |
| 398 * "feedback": optional RefactoringFeedback | |
| 399 * "change": optional SourceChange | |
| 400 * "potentialEdits": optional List<String> | |
| 401 * } | |
| 402 */ | |
| 403 final Matcher isEditGetRefactoringResult = | |
| 404 new LazyMatcher(() => new MatchesJsonObject("edit.getRefactoring result", { | |
| 405 "initialProblems": isListOf(isRefactoringProblem), | |
| 406 "optionsProblems": isListOf(isRefactoringProblem), | |
| 407 "finalProblems": isListOf(isRefactoringProblem) | |
| 408 }, optionalFields: { | |
| 409 "feedback": isRefactoringFeedback, | |
| 410 "change": isSourceChange, | |
| 411 "potentialEdits": isListOf(isString) | |
| 412 })); | |
| 413 | |
| 414 /** | |
| 415 * AddContentOverlay | 17 * AddContentOverlay |
| 416 * | 18 * |
| 417 * { | 19 * { |
| 418 * "type": "add" | 20 * "type": "add" |
| 419 * "content": String | 21 * "content": String |
| 420 * } | 22 * } |
| 421 */ | 23 */ |
| 422 final Matcher isAddContentOverlay = new LazyMatcher(() => new MatchesJsonObject( | 24 final Matcher isAddContentOverlay = new LazyMatcher(() => new MatchesJsonObject( |
| 423 "AddContentOverlay", {"type": equals("add"), "content": isString})); | 25 "AddContentOverlay", {"type": equals("add"), "content": isString})); |
| 424 | 26 |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 * GETTER | 278 * GETTER |
| 677 * LABEL | 279 * LABEL |
| 678 * LIBRARY | 280 * LIBRARY |
| 679 * LOCAL_VARIABLE | 281 * LOCAL_VARIABLE |
| 680 * METHOD | 282 * METHOD |
| 681 * PARAMETER | 283 * PARAMETER |
| 682 * PREFIX | 284 * PREFIX |
| 683 * SETTER | 285 * SETTER |
| 684 * TOP_LEVEL_VARIABLE | 286 * TOP_LEVEL_VARIABLE |
| 685 * TYPE_PARAMETER | 287 * TYPE_PARAMETER |
| 288 * UNIT_TEST_GROUP |
| 289 * UNIT_TEST_TEST |
| 686 * UNKNOWN | 290 * UNKNOWN |
| 687 * } | 291 * } |
| 688 */ | 292 */ |
| 689 final Matcher isElementKind = new MatchesEnum("ElementKind", [ | 293 final Matcher isElementKind = new MatchesEnum("ElementKind", [ |
| 690 "CLASS", | 294 "CLASS", |
| 691 "CLASS_TYPE_ALIAS", | 295 "CLASS_TYPE_ALIAS", |
| 692 "COMPILATION_UNIT", | 296 "COMPILATION_UNIT", |
| 693 "CONSTRUCTOR", | 297 "CONSTRUCTOR", |
| 694 "ENUM", | 298 "ENUM", |
| 695 "ENUM_CONSTANT", | 299 "ENUM_CONSTANT", |
| 696 "FIELD", | 300 "FIELD", |
| 697 "FILE", | 301 "FILE", |
| 698 "FUNCTION", | 302 "FUNCTION", |
| 699 "FUNCTION_TYPE_ALIAS", | 303 "FUNCTION_TYPE_ALIAS", |
| 700 "GETTER", | 304 "GETTER", |
| 701 "LABEL", | 305 "LABEL", |
| 702 "LIBRARY", | 306 "LIBRARY", |
| 703 "LOCAL_VARIABLE", | 307 "LOCAL_VARIABLE", |
| 704 "METHOD", | 308 "METHOD", |
| 705 "PARAMETER", | 309 "PARAMETER", |
| 706 "PREFIX", | 310 "PREFIX", |
| 707 "SETTER", | 311 "SETTER", |
| 708 "TOP_LEVEL_VARIABLE", | 312 "TOP_LEVEL_VARIABLE", |
| 709 "TYPE_PARAMETER", | 313 "TYPE_PARAMETER", |
| 314 "UNIT_TEST_GROUP", |
| 315 "UNIT_TEST_TEST", |
| 710 "UNKNOWN" | 316 "UNKNOWN" |
| 711 ]); | 317 ]); |
| 712 | 318 |
| 713 /** | 319 /** |
| 714 * FilePath | 320 * FilePath |
| 715 * | 321 * |
| 716 * String | 322 * String |
| 717 */ | 323 */ |
| 718 final Matcher isFilePath = isString; | 324 final Matcher isFilePath = isString; |
| 719 | 325 |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1114 new MatchesJsonObject("RefactoringMethodParameter", { | 720 new MatchesJsonObject("RefactoringMethodParameter", { |
| 1115 "kind": isRefactoringMethodParameterKind, | 721 "kind": isRefactoringMethodParameterKind, |
| 1116 "type": isString, | 722 "type": isString, |
| 1117 "name": isString | 723 "name": isString |
| 1118 }, optionalFields: { | 724 }, optionalFields: { |
| 1119 "id": isString, | 725 "id": isString, |
| 1120 "parameters": isString | 726 "parameters": isString |
| 1121 })); | 727 })); |
| 1122 | 728 |
| 1123 /** | 729 /** |
| 1124 * RefactoringOptions | |
| 1125 * | |
| 1126 * { | |
| 1127 * } | |
| 1128 */ | |
| 1129 final Matcher isRefactoringOptions = | |
| 1130 new LazyMatcher(() => new MatchesJsonObject("RefactoringOptions", null)); | |
| 1131 | |
| 1132 /** | |
| 1133 * RefactoringMethodParameterKind | 730 * RefactoringMethodParameterKind |
| 1134 * | 731 * |
| 1135 * enum { | 732 * enum { |
| 1136 * REQUIRED | 733 * REQUIRED |
| 1137 * POSITIONAL | 734 * POSITIONAL |
| 1138 * NAMED | 735 * NAMED |
| 1139 * } | 736 * } |
| 1140 */ | 737 */ |
| 1141 final Matcher isRefactoringMethodParameterKind = new MatchesEnum( | 738 final Matcher isRefactoringMethodParameterKind = new MatchesEnum( |
| 1142 "RefactoringMethodParameterKind", ["REQUIRED", "POSITIONAL", "NAMED"]); | 739 "RefactoringMethodParameterKind", ["REQUIRED", "POSITIONAL", "NAMED"]); |
| 1143 | 740 |
| 1144 /** | 741 /** |
| 742 * RefactoringOptions |
| 743 * |
| 744 * { |
| 745 * } |
| 746 */ |
| 747 final Matcher isRefactoringOptions = |
| 748 new LazyMatcher(() => new MatchesJsonObject("RefactoringOptions", null)); |
| 749 |
| 750 /** |
| 1145 * RefactoringProblem | 751 * RefactoringProblem |
| 1146 * | 752 * |
| 1147 * { | 753 * { |
| 1148 * "severity": RefactoringProblemSeverity | 754 * "severity": RefactoringProblemSeverity |
| 1149 * "message": String | 755 * "message": String |
| 1150 * "location": optional Location | 756 * "location": optional Location |
| 1151 * } | 757 * } |
| 1152 */ | 758 */ |
| 1153 final Matcher isRefactoringProblem = new LazyMatcher(() => | 759 final Matcher isRefactoringProblem = new LazyMatcher(() => |
| 1154 new MatchesJsonObject("RefactoringProblem", | 760 new MatchesJsonObject("RefactoringProblem", |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1271 * enum { | 877 * enum { |
| 1272 * ADD | 878 * ADD |
| 1273 * MODIFY | 879 * MODIFY |
| 1274 * REMOVE | 880 * REMOVE |
| 1275 * } | 881 * } |
| 1276 */ | 882 */ |
| 1277 final Matcher isWatchEventType = | 883 final Matcher isWatchEventType = |
| 1278 new MatchesEnum("WatchEventType", ["ADD", "MODIFY", "REMOVE"]); | 884 new MatchesEnum("WatchEventType", ["ADD", "MODIFY", "REMOVE"]); |
| 1279 | 885 |
| 1280 /** | 886 /** |
| 887 * analysis.errors params |
| 888 * |
| 889 * { |
| 890 * "file": FilePath |
| 891 * "errors": List<AnalysisError> |
| 892 * } |
| 893 */ |
| 894 final Matcher isAnalysisErrorsParams = new LazyMatcher(() => |
| 895 new MatchesJsonObject("analysis.errors params", |
| 896 {"file": isFilePath, "errors": isListOf(isAnalysisError)})); |
| 897 |
| 898 /** |
| 899 * analysis.folding params |
| 900 * |
| 901 * { |
| 902 * "file": FilePath |
| 903 * "regions": List<FoldingRegion> |
| 904 * } |
| 905 */ |
| 906 final Matcher isAnalysisFoldingParams = new LazyMatcher(() => |
| 907 new MatchesJsonObject("analysis.folding params", |
| 908 {"file": isFilePath, "regions": isListOf(isFoldingRegion)})); |
| 909 |
| 910 /** |
| 911 * analysis.handleWatchEvents params |
| 912 * |
| 913 * { |
| 914 * "events": List<WatchEvent> |
| 915 * } |
| 916 */ |
| 917 final Matcher isAnalysisHandleWatchEventsParams = new LazyMatcher(() => |
| 918 new MatchesJsonObject("analysis.handleWatchEvents params", |
| 919 {"events": isListOf(isWatchEvent)})); |
| 920 |
| 921 /** |
| 922 * analysis.handleWatchEvents result |
| 923 */ |
| 924 final Matcher isAnalysisHandleWatchEventsResult = isNull; |
| 925 |
| 926 /** |
| 927 * analysis.highlights params |
| 928 * |
| 929 * { |
| 930 * "file": FilePath |
| 931 * "regions": List<HighlightRegion> |
| 932 * } |
| 933 */ |
| 934 final Matcher isAnalysisHighlightsParams = new LazyMatcher(() => |
| 935 new MatchesJsonObject("analysis.highlights params", |
| 936 {"file": isFilePath, "regions": isListOf(isHighlightRegion)})); |
| 937 |
| 938 /** |
| 939 * analysis.navigation params |
| 940 * |
| 941 * { |
| 942 * "file": FilePath |
| 943 * "regions": List<NavigationRegion> |
| 944 * "targets": List<NavigationTarget> |
| 945 * "files": List<FilePath> |
| 946 * } |
| 947 */ |
| 948 final Matcher isAnalysisNavigationParams = |
| 949 new LazyMatcher(() => new MatchesJsonObject("analysis.navigation params", { |
| 950 "file": isFilePath, |
| 951 "regions": isListOf(isNavigationRegion), |
| 952 "targets": isListOf(isNavigationTarget), |
| 953 "files": isListOf(isFilePath) |
| 954 })); |
| 955 |
| 956 /** |
| 957 * analysis.occurrences params |
| 958 * |
| 959 * { |
| 960 * "file": FilePath |
| 961 * "occurrences": List<Occurrences> |
| 962 * } |
| 963 */ |
| 964 final Matcher isAnalysisOccurrencesParams = new LazyMatcher(() => |
| 965 new MatchesJsonObject("analysis.occurrences params", |
| 966 {"file": isFilePath, "occurrences": isListOf(isOccurrences)})); |
| 967 |
| 968 /** |
| 969 * analysis.outline params |
| 970 * |
| 971 * { |
| 972 * "file": FilePath |
| 973 * "outline": List<Outline> |
| 974 * } |
| 975 */ |
| 976 final Matcher isAnalysisOutlineParams = new LazyMatcher(() => |
| 977 new MatchesJsonObject("analysis.outline params", |
| 978 {"file": isFilePath, "outline": isListOf(isOutline)})); |
| 979 |
| 980 /** |
| 981 * analysis.reanalyze params |
| 982 * |
| 983 * { |
| 984 * "roots": optional List<FilePath> |
| 985 * } |
| 986 */ |
| 987 final Matcher isAnalysisReanalyzeParams = new LazyMatcher(() => |
| 988 new MatchesJsonObject("analysis.reanalyze params", null, |
| 989 optionalFields: {"roots": isListOf(isFilePath)})); |
| 990 |
| 991 /** |
| 992 * analysis.reanalyze result |
| 993 */ |
| 994 final Matcher isAnalysisReanalyzeResult = isNull; |
| 995 |
| 996 /** |
| 997 * analysis.setContextBuilderOptions params |
| 998 * |
| 999 * { |
| 1000 * "options": ContextBuilderOptions |
| 1001 * } |
| 1002 */ |
| 1003 final Matcher isAnalysisSetContextBuilderOptionsParams = new LazyMatcher(() => |
| 1004 new MatchesJsonObject("analysis.setContextBuilderOptions params", |
| 1005 {"options": isContextBuilderOptions})); |
| 1006 |
| 1007 /** |
| 1008 * analysis.setContextBuilderOptions result |
| 1009 */ |
| 1010 final Matcher isAnalysisSetContextBuilderOptionsResult = isNull; |
| 1011 |
| 1012 /** |
| 1013 * analysis.setContextRoots params |
| 1014 * |
| 1015 * { |
| 1016 * "roots": List<ContextRoot> |
| 1017 * } |
| 1018 */ |
| 1019 final Matcher isAnalysisSetContextRootsParams = new LazyMatcher(() => |
| 1020 new MatchesJsonObject( |
| 1021 "analysis.setContextRoots params", {"roots": isListOf(isContextRoot)})); |
| 1022 |
| 1023 /** |
| 1024 * analysis.setContextRoots result |
| 1025 */ |
| 1026 final Matcher isAnalysisSetContextRootsResult = isNull; |
| 1027 |
| 1028 /** |
| 1029 * analysis.setPriorityFiles params |
| 1030 * |
| 1031 * { |
| 1032 * "files": List<FilePath> |
| 1033 * } |
| 1034 */ |
| 1035 final Matcher isAnalysisSetPriorityFilesParams = new LazyMatcher(() => |
| 1036 new MatchesJsonObject( |
| 1037 "analysis.setPriorityFiles params", {"files": isListOf(isFilePath)})); |
| 1038 |
| 1039 /** |
| 1040 * analysis.setPriorityFiles result |
| 1041 */ |
| 1042 final Matcher isAnalysisSetPriorityFilesResult = isNull; |
| 1043 |
| 1044 /** |
| 1045 * analysis.setSubscriptions params |
| 1046 * |
| 1047 * { |
| 1048 * "subscriptions": Map<AnalysisService, List<FilePath>> |
| 1049 * } |
| 1050 */ |
| 1051 final Matcher isAnalysisSetSubscriptionsParams = new LazyMatcher(() => |
| 1052 new MatchesJsonObject("analysis.setSubscriptions params", |
| 1053 {"subscriptions": isMapOf(isAnalysisService, isListOf(isFilePath))})); |
| 1054 |
| 1055 /** |
| 1056 * analysis.setSubscriptions result |
| 1057 */ |
| 1058 final Matcher isAnalysisSetSubscriptionsResult = isNull; |
| 1059 |
| 1060 /** |
| 1061 * analysis.updateContent params |
| 1062 * |
| 1063 * { |
| 1064 * "files": Map<FilePath, AddContentOverlay | ChangeContentOverlay | RemoveCon
tentOverlay> |
| 1065 * } |
| 1066 */ |
| 1067 final Matcher isAnalysisUpdateContentParams = new LazyMatcher( |
| 1068 () => new MatchesJsonObject("analysis.updateContent params", { |
| 1069 "files": isMapOf( |
| 1070 isFilePath, |
| 1071 isOneOf([ |
| 1072 isAddContentOverlay, |
| 1073 isChangeContentOverlay, |
| 1074 isRemoveContentOverlay |
| 1075 ])) |
| 1076 })); |
| 1077 |
| 1078 /** |
| 1079 * analysis.updateContent result |
| 1080 */ |
| 1081 final Matcher isAnalysisUpdateContentResult = isNull; |
| 1082 |
| 1083 /** |
| 1084 * completion.getSuggestions params |
| 1085 * |
| 1086 * { |
| 1087 * "file": FilePath |
| 1088 * "offset": int |
| 1089 * } |
| 1090 */ |
| 1091 final Matcher isCompletionGetSuggestionsParams = new LazyMatcher(() => |
| 1092 new MatchesJsonObject("completion.getSuggestions params", |
| 1093 {"file": isFilePath, "offset": isInt})); |
| 1094 |
| 1095 /** |
| 1096 * completion.getSuggestions result |
| 1097 * |
| 1098 * { |
| 1099 * "replacementOffset": int |
| 1100 * "replacementLength": int |
| 1101 * "results": List<CompletionSuggestion> |
| 1102 * } |
| 1103 */ |
| 1104 final Matcher isCompletionGetSuggestionsResult = new LazyMatcher( |
| 1105 () => new MatchesJsonObject("completion.getSuggestions result", { |
| 1106 "replacementOffset": isInt, |
| 1107 "replacementLength": isInt, |
| 1108 "results": isListOf(isCompletionSuggestion) |
| 1109 })); |
| 1110 |
| 1111 /** |
| 1281 * convertGetterToMethod feedback | 1112 * convertGetterToMethod feedback |
| 1282 */ | 1113 */ |
| 1283 final Matcher isConvertGetterToMethodFeedback = isNull; | 1114 final Matcher isConvertGetterToMethodFeedback = isNull; |
| 1284 | 1115 |
| 1285 /** | 1116 /** |
| 1286 * convertGetterToMethod options | 1117 * convertGetterToMethod options |
| 1287 */ | 1118 */ |
| 1288 final Matcher isConvertGetterToMethodOptions = isNull; | 1119 final Matcher isConvertGetterToMethodOptions = isNull; |
| 1289 | 1120 |
| 1290 /** | 1121 /** |
| 1291 * convertMethodToGetter feedback | 1122 * convertMethodToGetter feedback |
| 1292 */ | 1123 */ |
| 1293 final Matcher isConvertMethodToGetterFeedback = isNull; | 1124 final Matcher isConvertMethodToGetterFeedback = isNull; |
| 1294 | 1125 |
| 1295 /** | 1126 /** |
| 1296 * convertMethodToGetter options | 1127 * convertMethodToGetter options |
| 1297 */ | 1128 */ |
| 1298 final Matcher isConvertMethodToGetterOptions = isNull; | 1129 final Matcher isConvertMethodToGetterOptions = isNull; |
| 1299 | 1130 |
| 1300 /** | 1131 /** |
| 1132 * edit.getAssists params |
| 1133 * |
| 1134 * { |
| 1135 * "file": FilePath |
| 1136 * "offset": int |
| 1137 * "length": int |
| 1138 * } |
| 1139 */ |
| 1140 final Matcher isEditGetAssistsParams = new LazyMatcher(() => |
| 1141 new MatchesJsonObject("edit.getAssists params", |
| 1142 {"file": isFilePath, "offset": isInt, "length": isInt})); |
| 1143 |
| 1144 /** |
| 1145 * edit.getAssists result |
| 1146 * |
| 1147 * { |
| 1148 * "assists": List<PrioritizedSourceChange> |
| 1149 * } |
| 1150 */ |
| 1151 final Matcher isEditGetAssistsResult = new LazyMatcher(() => |
| 1152 new MatchesJsonObject("edit.getAssists result", |
| 1153 {"assists": isListOf(isPrioritizedSourceChange)})); |
| 1154 |
| 1155 /** |
| 1156 * edit.getAvailableRefactorings params |
| 1157 * |
| 1158 * { |
| 1159 * "file": FilePath |
| 1160 * "offset": int |
| 1161 * "length": int |
| 1162 * } |
| 1163 */ |
| 1164 final Matcher isEditGetAvailableRefactoringsParams = new LazyMatcher(() => |
| 1165 new MatchesJsonObject("edit.getAvailableRefactorings params", |
| 1166 {"file": isFilePath, "offset": isInt, "length": isInt})); |
| 1167 |
| 1168 /** |
| 1169 * edit.getAvailableRefactorings result |
| 1170 * |
| 1171 * { |
| 1172 * "kinds": List<RefactoringKind> |
| 1173 * } |
| 1174 */ |
| 1175 final Matcher isEditGetAvailableRefactoringsResult = new LazyMatcher(() => |
| 1176 new MatchesJsonObject("edit.getAvailableRefactorings result", |
| 1177 {"kinds": isListOf(isRefactoringKind)})); |
| 1178 |
| 1179 /** |
| 1180 * edit.getFixes params |
| 1181 * |
| 1182 * { |
| 1183 * "file": FilePath |
| 1184 * "offset": int |
| 1185 * } |
| 1186 */ |
| 1187 final Matcher isEditGetFixesParams = new LazyMatcher(() => |
| 1188 new MatchesJsonObject( |
| 1189 "edit.getFixes params", {"file": isFilePath, "offset": isInt})); |
| 1190 |
| 1191 /** |
| 1192 * edit.getFixes result |
| 1193 * |
| 1194 * { |
| 1195 * "fixes": List<AnalysisErrorFixes> |
| 1196 * } |
| 1197 */ |
| 1198 final Matcher isEditGetFixesResult = new LazyMatcher(() => |
| 1199 new MatchesJsonObject( |
| 1200 "edit.getFixes result", {"fixes": isListOf(isAnalysisErrorFixes)})); |
| 1201 |
| 1202 /** |
| 1203 * edit.getRefactoring params |
| 1204 * |
| 1205 * { |
| 1206 * "kind": RefactoringKind |
| 1207 * "file": FilePath |
| 1208 * "offset": int |
| 1209 * "length": int |
| 1210 * "validateOnly": bool |
| 1211 * "options": optional RefactoringOptions |
| 1212 * } |
| 1213 */ |
| 1214 final Matcher isEditGetRefactoringParams = |
| 1215 new LazyMatcher(() => new MatchesJsonObject("edit.getRefactoring params", { |
| 1216 "kind": isRefactoringKind, |
| 1217 "file": isFilePath, |
| 1218 "offset": isInt, |
| 1219 "length": isInt, |
| 1220 "validateOnly": isBool |
| 1221 }, optionalFields: { |
| 1222 "options": isRefactoringOptions |
| 1223 })); |
| 1224 |
| 1225 /** |
| 1226 * edit.getRefactoring result |
| 1227 * |
| 1228 * { |
| 1229 * "initialProblems": List<RefactoringProblem> |
| 1230 * "optionsProblems": List<RefactoringProblem> |
| 1231 * "finalProblems": List<RefactoringProblem> |
| 1232 * "feedback": optional RefactoringFeedback |
| 1233 * "change": optional SourceChange |
| 1234 * "potentialEdits": optional List<String> |
| 1235 * } |
| 1236 */ |
| 1237 final Matcher isEditGetRefactoringResult = |
| 1238 new LazyMatcher(() => new MatchesJsonObject("edit.getRefactoring result", { |
| 1239 "initialProblems": isListOf(isRefactoringProblem), |
| 1240 "optionsProblems": isListOf(isRefactoringProblem), |
| 1241 "finalProblems": isListOf(isRefactoringProblem) |
| 1242 }, optionalFields: { |
| 1243 "feedback": isRefactoringFeedback, |
| 1244 "change": isSourceChange, |
| 1245 "potentialEdits": isListOf(isString) |
| 1246 })); |
| 1247 |
| 1248 /** |
| 1301 * extractLocalVariable feedback | 1249 * extractLocalVariable feedback |
| 1302 * | 1250 * |
| 1303 * { | 1251 * { |
| 1304 * "coveringExpressionOffsets": optional List<int> | 1252 * "coveringExpressionOffsets": optional List<int> |
| 1305 * "coveringExpressionLengths": optional List<int> | 1253 * "coveringExpressionLengths": optional List<int> |
| 1306 * "names": List<String> | 1254 * "names": List<String> |
| 1307 * "offsets": List<int> | 1255 * "offsets": List<int> |
| 1308 * "lengths": List<int> | 1256 * "lengths": List<int> |
| 1309 * } | 1257 * } |
| 1310 */ | 1258 */ |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1428 * moveFile options | 1376 * moveFile options |
| 1429 * | 1377 * |
| 1430 * { | 1378 * { |
| 1431 * "newFile": FilePath | 1379 * "newFile": FilePath |
| 1432 * } | 1380 * } |
| 1433 */ | 1381 */ |
| 1434 final Matcher isMoveFileOptions = new LazyMatcher( | 1382 final Matcher isMoveFileOptions = new LazyMatcher( |
| 1435 () => new MatchesJsonObject("moveFile options", {"newFile": isFilePath})); | 1383 () => new MatchesJsonObject("moveFile options", {"newFile": isFilePath})); |
| 1436 | 1384 |
| 1437 /** | 1385 /** |
| 1386 * plugin.error params |
| 1387 * |
| 1388 * { |
| 1389 * "isFatal": bool |
| 1390 * "message": String |
| 1391 * "stackTrace": String |
| 1392 * } |
| 1393 */ |
| 1394 final Matcher isPluginErrorParams = new LazyMatcher(() => new MatchesJsonObject( |
| 1395 "plugin.error params", |
| 1396 {"isFatal": isBool, "message": isString, "stackTrace": isString})); |
| 1397 |
| 1398 /** |
| 1399 * plugin.shutdown params |
| 1400 */ |
| 1401 final Matcher isPluginShutdownParams = isNull; |
| 1402 |
| 1403 /** |
| 1404 * plugin.shutdown result |
| 1405 */ |
| 1406 final Matcher isPluginShutdownResult = isNull; |
| 1407 |
| 1408 /** |
| 1409 * plugin.versionCheck params |
| 1410 * |
| 1411 * { |
| 1412 * "byteStorePath": String |
| 1413 * "version": String |
| 1414 * } |
| 1415 */ |
| 1416 final Matcher isPluginVersionCheckParams = new LazyMatcher(() => |
| 1417 new MatchesJsonObject("plugin.versionCheck params", |
| 1418 {"byteStorePath": isString, "version": isString})); |
| 1419 |
| 1420 /** |
| 1421 * plugin.versionCheck result |
| 1422 * |
| 1423 * { |
| 1424 * "isCompatible": bool |
| 1425 * "name": String |
| 1426 * "version": String |
| 1427 * "contactInfo": optional String |
| 1428 * "interestingFiles": List<String> |
| 1429 * } |
| 1430 */ |
| 1431 final Matcher isPluginVersionCheckResult = |
| 1432 new LazyMatcher(() => new MatchesJsonObject("plugin.versionCheck result", { |
| 1433 "isCompatible": isBool, |
| 1434 "name": isString, |
| 1435 "version": isString, |
| 1436 "interestingFiles": isListOf(isString) |
| 1437 }, optionalFields: { |
| 1438 "contactInfo": isString |
| 1439 })); |
| 1440 |
| 1441 /** |
| 1438 * rename feedback | 1442 * rename feedback |
| 1439 * | 1443 * |
| 1440 * { | 1444 * { |
| 1441 * "offset": int | 1445 * "offset": int |
| 1442 * "length": int | 1446 * "length": int |
| 1443 * "elementKindName": String | 1447 * "elementKindName": String |
| 1444 * "oldName": String | 1448 * "oldName": String |
| 1445 * } | 1449 * } |
| 1446 */ | 1450 */ |
| 1447 final Matcher isRenameFeedback = | 1451 final Matcher isRenameFeedback = |
| 1448 new LazyMatcher(() => new MatchesJsonObject("rename feedback", { | 1452 new LazyMatcher(() => new MatchesJsonObject("rename feedback", { |
| 1449 "offset": isInt, | 1453 "offset": isInt, |
| 1450 "length": isInt, | 1454 "length": isInt, |
| 1451 "elementKindName": isString, | 1455 "elementKindName": isString, |
| 1452 "oldName": isString | 1456 "oldName": isString |
| 1453 })); | 1457 })); |
| 1454 | 1458 |
| 1455 /** | 1459 /** |
| 1456 * rename options | 1460 * rename options |
| 1457 * | 1461 * |
| 1458 * { | 1462 * { |
| 1459 * "newName": String | 1463 * "newName": String |
| 1460 * } | 1464 * } |
| 1461 */ | 1465 */ |
| 1462 final Matcher isRenameOptions = new LazyMatcher( | 1466 final Matcher isRenameOptions = new LazyMatcher( |
| 1463 () => new MatchesJsonObject("rename options", {"newName": isString})); | 1467 () => new MatchesJsonObject("rename options", {"newName": isString})); |
| OLD | NEW |