Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(718)

Unified Diff: pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart

Issue 2876023003: Allow the common spec types to be in a separate document (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart
diff --git a/pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart b/pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart
index 05f51a7e1f98e8414fde3bd6cf00f2f9b3a4c79e..87dd5a4385bc1463788e4620a2f4f25c85356e1b 100644
--- a/pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart
+++ b/pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart
@@ -14,1288 +14,1236 @@ import 'package:test/test.dart';
import 'integration_tests.dart';
/**
- * plugin.versionCheck params
+ * AddContentOverlay
*
* {
- * "byteStorePath": String
- * "version": String
+ * "type": "add"
+ * "content": String
* }
*/
-final Matcher isPluginVersionCheckParams = new LazyMatcher(() =>
- new MatchesJsonObject("plugin.versionCheck params",
- {"byteStorePath": isString, "version": isString}));
+final Matcher isAddContentOverlay = new LazyMatcher(() => new MatchesJsonObject(
+ "AddContentOverlay", {"type": equals("add"), "content": isString}));
/**
- * plugin.versionCheck result
+ * AnalysisError
*
* {
- * "isCompatible": bool
- * "name": String
- * "version": String
- * "contactInfo": optional String
- * "interestingFiles": List<String>
+ * "severity": AnalysisErrorSeverity
+ * "type": AnalysisErrorType
+ * "location": Location
+ * "message": String
+ * "correction": optional String
+ * "code": String
+ * "hasFix": optional bool
* }
*/
-final Matcher isPluginVersionCheckResult =
- new LazyMatcher(() => new MatchesJsonObject("plugin.versionCheck result", {
- "isCompatible": isBool,
- "name": isString,
- "version": isString,
- "interestingFiles": isListOf(isString)
+final Matcher isAnalysisError =
+ new LazyMatcher(() => new MatchesJsonObject("AnalysisError", {
+ "severity": isAnalysisErrorSeverity,
+ "type": isAnalysisErrorType,
+ "location": isLocation,
+ "message": isString,
+ "code": isString
}, optionalFields: {
- "contactInfo": isString
+ "correction": isString,
+ "hasFix": isBool
}));
/**
- * plugin.shutdown params
- */
-final Matcher isPluginShutdownParams = isNull;
-
-/**
- * plugin.shutdown result
- */
-final Matcher isPluginShutdownResult = isNull;
-
-/**
- * plugin.error params
+ * AnalysisErrorFixes
*
* {
- * "isFatal": bool
- * "message": String
- * "stackTrace": String
+ * "error": AnalysisError
+ * "fixes": List<PrioritizedSourceChange>
* }
*/
-final Matcher isPluginErrorParams = new LazyMatcher(() => new MatchesJsonObject(
- "plugin.error params",
- {"isFatal": isBool, "message": isString, "stackTrace": isString}));
+final Matcher isAnalysisErrorFixes = new LazyMatcher(() =>
+ new MatchesJsonObject("AnalysisErrorFixes", {
+ "error": isAnalysisError,
+ "fixes": isListOf(isPrioritizedSourceChange)
+ }));
/**
- * analysis.handleWatchEvents params
+ * AnalysisErrorSeverity
*
- * {
- * "events": List<WatchEvent>
+ * enum {
+ * INFO
+ * WARNING
+ * ERROR
* }
*/
-final Matcher isAnalysisHandleWatchEventsParams = new LazyMatcher(() =>
- new MatchesJsonObject("analysis.handleWatchEvents params",
- {"events": isListOf(isWatchEvent)}));
-
-/**
- * analysis.handleWatchEvents result
- */
-final Matcher isAnalysisHandleWatchEventsResult = isNull;
+final Matcher isAnalysisErrorSeverity =
+ new MatchesEnum("AnalysisErrorSeverity", ["INFO", "WARNING", "ERROR"]);
/**
- * analysis.reanalyze params
+ * AnalysisErrorType
*
- * {
- * "roots": optional List<FilePath>
+ * enum {
+ * CHECKED_MODE_COMPILE_TIME_ERROR
+ * COMPILE_TIME_ERROR
+ * HINT
+ * LINT
+ * STATIC_TYPE_WARNING
+ * STATIC_WARNING
+ * SYNTACTIC_ERROR
+ * TODO
* }
*/
-final Matcher isAnalysisReanalyzeParams = new LazyMatcher(() =>
- new MatchesJsonObject("analysis.reanalyze params", null,
- optionalFields: {"roots": isListOf(isFilePath)}));
+final Matcher isAnalysisErrorType = new MatchesEnum("AnalysisErrorType", [
+ "CHECKED_MODE_COMPILE_TIME_ERROR",
+ "COMPILE_TIME_ERROR",
+ "HINT",
+ "LINT",
+ "STATIC_TYPE_WARNING",
+ "STATIC_WARNING",
+ "SYNTACTIC_ERROR",
+ "TODO"
+]);
/**
- * analysis.reanalyze result
+ * AnalysisService
+ *
+ * enum {
+ * FOLDING
+ * HIGHLIGHTS
+ * NAVIGATION
+ * OCCURRENCES
+ * OUTLINE
+ * }
*/
-final Matcher isAnalysisReanalyzeResult = isNull;
+final Matcher isAnalysisService = new MatchesEnum("AnalysisService",
+ ["FOLDING", "HIGHLIGHTS", "NAVIGATION", "OCCURRENCES", "OUTLINE"]);
/**
- * analysis.setContextBuilderOptions params
+ * ChangeContentOverlay
*
* {
- * "options": ContextBuilderOptions
+ * "type": "change"
+ * "edits": List<SourceEdit>
* }
*/
-final Matcher isAnalysisSetContextBuilderOptionsParams = new LazyMatcher(() =>
- new MatchesJsonObject("analysis.setContextBuilderOptions params",
- {"options": isContextBuilderOptions}));
-
-/**
- * analysis.setContextBuilderOptions result
- */
-final Matcher isAnalysisSetContextBuilderOptionsResult = isNull;
+final Matcher isChangeContentOverlay = new LazyMatcher(() =>
+ new MatchesJsonObject("ChangeContentOverlay",
+ {"type": equals("change"), "edits": isListOf(isSourceEdit)}));
/**
- * analysis.setContextRoots params
+ * CompletionSuggestion
*
* {
- * "roots": List<ContextRoot>
+ * "kind": CompletionSuggestionKind
+ * "relevance": int
+ * "completion": String
+ * "selectionOffset": int
+ * "selectionLength": int
+ * "isDeprecated": bool
+ * "isPotential": bool
+ * "docSummary": optional String
+ * "docComplete": optional String
+ * "declaringType": optional String
+ * "defaultArgumentListString": optional String
+ * "defaultArgumentListTextRanges": optional List<int>
+ * "element": optional Element
+ * "returnType": optional String
+ * "parameterNames": optional List<String>
+ * "parameterTypes": optional List<String>
+ * "requiredParameterCount": optional int
+ * "hasNamedParameters": optional bool
+ * "parameterName": optional String
+ * "parameterType": optional String
+ * "importUri": optional String
* }
*/
-final Matcher isAnalysisSetContextRootsParams = new LazyMatcher(() =>
- new MatchesJsonObject(
- "analysis.setContextRoots params", {"roots": isListOf(isContextRoot)}));
+final Matcher isCompletionSuggestion =
+ new LazyMatcher(() => new MatchesJsonObject("CompletionSuggestion", {
+ "kind": isCompletionSuggestionKind,
+ "relevance": isInt,
+ "completion": isString,
+ "selectionOffset": isInt,
+ "selectionLength": isInt,
+ "isDeprecated": isBool,
+ "isPotential": isBool
+ }, optionalFields: {
+ "docSummary": isString,
+ "docComplete": isString,
+ "declaringType": isString,
+ "defaultArgumentListString": isString,
+ "defaultArgumentListTextRanges": isListOf(isInt),
+ "element": isElement,
+ "returnType": isString,
+ "parameterNames": isListOf(isString),
+ "parameterTypes": isListOf(isString),
+ "requiredParameterCount": isInt,
+ "hasNamedParameters": isBool,
+ "parameterName": isString,
+ "parameterType": isString,
+ "importUri": isString
+ }));
/**
- * analysis.setContextRoots result
+ * CompletionSuggestionKind
+ *
+ * enum {
+ * ARGUMENT_LIST
+ * IMPORT
+ * IDENTIFIER
+ * INVOCATION
+ * KEYWORD
+ * NAMED_ARGUMENT
+ * OPTIONAL_ARGUMENT
+ * PARAMETER
+ * }
*/
-final Matcher isAnalysisSetContextRootsResult = isNull;
+final Matcher isCompletionSuggestionKind =
+ new MatchesEnum("CompletionSuggestionKind", [
+ "ARGUMENT_LIST",
+ "IMPORT",
+ "IDENTIFIER",
+ "INVOCATION",
+ "KEYWORD",
+ "NAMED_ARGUMENT",
+ "OPTIONAL_ARGUMENT",
+ "PARAMETER"
+]);
/**
- * analysis.setPriorityFiles params
+ * ContextBuilderOptions
*
* {
- * "files": List<FilePath>
+ * "dartSdkSummaryPath": optional String
+ * "defaultAnalysisOptionsFilePath": optional List<String>
+ * "declaredVariables": optional Map<String, String>
+ * "defaultPackageFilePath": optional List<String>
+ * "defaultPackagesDirectoryPath": optional List<String>
* }
*/
-final Matcher isAnalysisSetPriorityFilesParams = new LazyMatcher(() =>
- new MatchesJsonObject(
- "analysis.setPriorityFiles params", {"files": isListOf(isFilePath)}));
+final Matcher isContextBuilderOptions = new LazyMatcher(
+ () => new MatchesJsonObject("ContextBuilderOptions", null, optionalFields: {
+ "dartSdkSummaryPath": isString,
+ "defaultAnalysisOptionsFilePath": isListOf(isString),
+ "declaredVariables": isMapOf(isString, isString),
+ "defaultPackageFilePath": isListOf(isString),
+ "defaultPackagesDirectoryPath": isListOf(isString)
+ }));
/**
- * analysis.setPriorityFiles result
+ * ContextRoot
+ *
+ * {
+ * "root": String
+ * "exclude": List<String>
+ * }
*/
-final Matcher isAnalysisSetPriorityFilesResult = isNull;
+final Matcher isContextRoot = new LazyMatcher(() => new MatchesJsonObject(
+ "ContextRoot", {"root": isString, "exclude": isListOf(isString)}));
/**
- * analysis.setSubscriptions params
+ * Element
*
* {
- * "subscriptions": Map<AnalysisService, List<FilePath>>
+ * "kind": ElementKind
+ * "name": String
+ * "location": optional Location
+ * "flags": int
+ * "parameters": optional String
+ * "returnType": optional String
+ * "typeParameters": optional String
* }
*/
-final Matcher isAnalysisSetSubscriptionsParams = new LazyMatcher(() =>
- new MatchesJsonObject("analysis.setSubscriptions params",
- {"subscriptions": isMapOf(isAnalysisService, isListOf(isFilePath))}));
-
-/**
- * analysis.setSubscriptions result
- */
-final Matcher isAnalysisSetSubscriptionsResult = isNull;
-
-/**
- * analysis.updateContent params
- *
- * {
- * "files": Map<FilePath, AddContentOverlay | ChangeContentOverlay | RemoveContentOverlay>
- * }
- */
-final Matcher isAnalysisUpdateContentParams = new LazyMatcher(
- () => new MatchesJsonObject("analysis.updateContent params", {
- "files": isMapOf(
- isFilePath,
- isOneOf([
- isAddContentOverlay,
- isChangeContentOverlay,
- isRemoveContentOverlay
- ]))
- }));
-
-/**
- * analysis.updateContent result
- */
-final Matcher isAnalysisUpdateContentResult = isNull;
-
-/**
- * analysis.errors params
- *
- * {
- * "file": FilePath
- * "errors": List<AnalysisError>
- * }
- */
-final Matcher isAnalysisErrorsParams = new LazyMatcher(() =>
- new MatchesJsonObject("analysis.errors params",
- {"file": isFilePath, "errors": isListOf(isAnalysisError)}));
-
-/**
- * analysis.folding params
- *
- * {
- * "file": FilePath
- * "regions": List<FoldingRegion>
- * }
- */
-final Matcher isAnalysisFoldingParams = new LazyMatcher(() =>
- new MatchesJsonObject("analysis.folding params",
- {"file": isFilePath, "regions": isListOf(isFoldingRegion)}));
-
-/**
- * analysis.highlights params
- *
- * {
- * "file": FilePath
- * "regions": List<HighlightRegion>
- * }
- */
-final Matcher isAnalysisHighlightsParams = new LazyMatcher(() =>
- new MatchesJsonObject("analysis.highlights params",
- {"file": isFilePath, "regions": isListOf(isHighlightRegion)}));
-
-/**
- * analysis.navigation params
- *
- * {
- * "file": FilePath
- * "regions": List<NavigationRegion>
- * "targets": List<NavigationTarget>
- * "files": List<FilePath>
- * }
- */
-final Matcher isAnalysisNavigationParams =
- new LazyMatcher(() => new MatchesJsonObject("analysis.navigation params", {
- "file": isFilePath,
- "regions": isListOf(isNavigationRegion),
- "targets": isListOf(isNavigationTarget),
- "files": isListOf(isFilePath)
+final Matcher isElement =
+ new LazyMatcher(() => new MatchesJsonObject("Element", {
+ "kind": isElementKind,
+ "name": isString,
+ "flags": isInt
+ }, optionalFields: {
+ "location": isLocation,
+ "parameters": isString,
+ "returnType": isString,
+ "typeParameters": isString
}));
/**
- * analysis.occurrences params
- *
- * {
- * "file": FilePath
- * "occurrences": List<Occurrences>
- * }
- */
-final Matcher isAnalysisOccurrencesParams = new LazyMatcher(() =>
- new MatchesJsonObject("analysis.occurrences params",
- {"file": isFilePath, "occurrences": isListOf(isOccurrences)}));
-
-/**
- * analysis.outline params
+ * ElementKind
*
- * {
- * "file": FilePath
- * "outline": List<Outline>
+ * enum {
+ * CLASS
+ * CLASS_TYPE_ALIAS
+ * COMPILATION_UNIT
+ * CONSTRUCTOR
+ * ENUM
+ * ENUM_CONSTANT
+ * FIELD
+ * FILE
+ * FUNCTION
+ * FUNCTION_TYPE_ALIAS
+ * GETTER
+ * LABEL
+ * LIBRARY
+ * LOCAL_VARIABLE
+ * METHOD
+ * PARAMETER
+ * PREFIX
+ * SETTER
+ * TOP_LEVEL_VARIABLE
+ * TYPE_PARAMETER
+ * UNIT_TEST_GROUP
+ * UNIT_TEST_TEST
+ * UNKNOWN
* }
*/
-final Matcher isAnalysisOutlineParams = new LazyMatcher(() =>
- new MatchesJsonObject("analysis.outline params",
- {"file": isFilePath, "outline": isListOf(isOutline)}));
+final Matcher isElementKind = new MatchesEnum("ElementKind", [
+ "CLASS",
+ "CLASS_TYPE_ALIAS",
+ "COMPILATION_UNIT",
+ "CONSTRUCTOR",
+ "ENUM",
+ "ENUM_CONSTANT",
+ "FIELD",
+ "FILE",
+ "FUNCTION",
+ "FUNCTION_TYPE_ALIAS",
+ "GETTER",
+ "LABEL",
+ "LIBRARY",
+ "LOCAL_VARIABLE",
+ "METHOD",
+ "PARAMETER",
+ "PREFIX",
+ "SETTER",
+ "TOP_LEVEL_VARIABLE",
+ "TYPE_PARAMETER",
+ "UNIT_TEST_GROUP",
+ "UNIT_TEST_TEST",
+ "UNKNOWN"
+]);
/**
- * completion.getSuggestions params
+ * FilePath
*
- * {
- * "file": FilePath
- * "offset": int
- * }
+ * String
*/
-final Matcher isCompletionGetSuggestionsParams = new LazyMatcher(() =>
- new MatchesJsonObject("completion.getSuggestions params",
- {"file": isFilePath, "offset": isInt}));
+final Matcher isFilePath = isString;
/**
- * completion.getSuggestions result
+ * FoldingKind
*
- * {
- * "replacementOffset": int
- * "replacementLength": int
- * "results": List<CompletionSuggestion>
+ * enum {
+ * COMMENT
+ * CLASS_MEMBER
+ * DIRECTIVES
+ * DOCUMENTATION_COMMENT
+ * TOP_LEVEL_DECLARATION
* }
*/
-final Matcher isCompletionGetSuggestionsResult = new LazyMatcher(
- () => new MatchesJsonObject("completion.getSuggestions result", {
- "replacementOffset": isInt,
- "replacementLength": isInt,
- "results": isListOf(isCompletionSuggestion)
- }));
+final Matcher isFoldingKind = new MatchesEnum("FoldingKind", [
+ "COMMENT",
+ "CLASS_MEMBER",
+ "DIRECTIVES",
+ "DOCUMENTATION_COMMENT",
+ "TOP_LEVEL_DECLARATION"
+]);
/**
- * edit.getAssists params
+ * FoldingRegion
*
* {
- * "file": FilePath
+ * "kind": FoldingKind
* "offset": int
* "length": int
* }
*/
-final Matcher isEditGetAssistsParams = new LazyMatcher(() =>
- new MatchesJsonObject("edit.getAssists params",
- {"file": isFilePath, "offset": isInt, "length": isInt}));
-
-/**
- * edit.getAssists result
- *
- * {
- * "assists": List<PrioritizedSourceChange>
- * }
- */
-final Matcher isEditGetAssistsResult = new LazyMatcher(() =>
- new MatchesJsonObject("edit.getAssists result",
- {"assists": isListOf(isPrioritizedSourceChange)}));
+final Matcher isFoldingRegion = new LazyMatcher(() => new MatchesJsonObject(
+ "FoldingRegion",
+ {"kind": isFoldingKind, "offset": isInt, "length": isInt}));
/**
- * edit.getAvailableRefactorings params
+ * HighlightRegion
*
* {
- * "file": FilePath
+ * "type": HighlightRegionType
* "offset": int
* "length": int
* }
*/
-final Matcher isEditGetAvailableRefactoringsParams = new LazyMatcher(() =>
- new MatchesJsonObject("edit.getAvailableRefactorings params",
- {"file": isFilePath, "offset": isInt, "length": isInt}));
-
-/**
- * edit.getAvailableRefactorings result
- *
- * {
- * "kinds": List<RefactoringKind>
- * }
- */
-final Matcher isEditGetAvailableRefactoringsResult = new LazyMatcher(() =>
- new MatchesJsonObject("edit.getAvailableRefactorings result",
- {"kinds": isListOf(isRefactoringKind)}));
-
-/**
- * edit.getFixes params
- *
- * {
- * "file": FilePath
- * "offset": int
- * }
- */
-final Matcher isEditGetFixesParams = new LazyMatcher(() =>
- new MatchesJsonObject(
- "edit.getFixes params", {"file": isFilePath, "offset": isInt}));
+final Matcher isHighlightRegion = new LazyMatcher(() => new MatchesJsonObject(
+ "HighlightRegion",
+ {"type": isHighlightRegionType, "offset": isInt, "length": isInt}));
/**
- * edit.getFixes result
+ * HighlightRegionType
*
- * {
- * "fixes": List<AnalysisErrorFixes>
- * }
- */
-final Matcher isEditGetFixesResult = new LazyMatcher(() =>
- new MatchesJsonObject(
- "edit.getFixes result", {"fixes": isListOf(isAnalysisErrorFixes)}));
+ * enum {
+ * ANNOTATION
+ * BUILT_IN
+ * CLASS
+ * COMMENT_BLOCK
+ * COMMENT_DOCUMENTATION
+ * COMMENT_END_OF_LINE
+ * CONSTRUCTOR
+ * DIRECTIVE
+ * DYNAMIC_TYPE
+ * DYNAMIC_LOCAL_VARIABLE_DECLARATION
+ * DYNAMIC_LOCAL_VARIABLE_REFERENCE
+ * DYNAMIC_PARAMETER_DECLARATION
+ * DYNAMIC_PARAMETER_REFERENCE
+ * ENUM
+ * ENUM_CONSTANT
+ * FIELD
+ * FIELD_STATIC
+ * FUNCTION
+ * FUNCTION_DECLARATION
+ * FUNCTION_TYPE_ALIAS
+ * GETTER_DECLARATION
+ * IDENTIFIER_DEFAULT
+ * IMPORT_PREFIX
+ * INSTANCE_FIELD_DECLARATION
+ * INSTANCE_FIELD_REFERENCE
+ * INSTANCE_GETTER_DECLARATION
+ * INSTANCE_GETTER_REFERENCE
+ * INSTANCE_METHOD_DECLARATION
+ * INSTANCE_METHOD_REFERENCE
+ * INSTANCE_SETTER_DECLARATION
+ * INSTANCE_SETTER_REFERENCE
+ * INVALID_STRING_ESCAPE
+ * KEYWORD
+ * LABEL
+ * LIBRARY_NAME
+ * LITERAL_BOOLEAN
+ * LITERAL_DOUBLE
+ * LITERAL_INTEGER
+ * LITERAL_LIST
+ * LITERAL_MAP
+ * LITERAL_STRING
+ * LOCAL_FUNCTION_DECLARATION
+ * LOCAL_FUNCTION_REFERENCE
+ * LOCAL_VARIABLE
+ * LOCAL_VARIABLE_DECLARATION
+ * LOCAL_VARIABLE_REFERENCE
+ * METHOD
+ * METHOD_DECLARATION
+ * METHOD_DECLARATION_STATIC
+ * METHOD_STATIC
+ * PARAMETER
+ * SETTER_DECLARATION
+ * TOP_LEVEL_VARIABLE
+ * PARAMETER_DECLARATION
+ * PARAMETER_REFERENCE
+ * STATIC_FIELD_DECLARATION
+ * STATIC_GETTER_DECLARATION
+ * STATIC_GETTER_REFERENCE
+ * STATIC_METHOD_DECLARATION
+ * STATIC_METHOD_REFERENCE
+ * STATIC_SETTER_DECLARATION
+ * STATIC_SETTER_REFERENCE
+ * TOP_LEVEL_FUNCTION_DECLARATION
+ * TOP_LEVEL_FUNCTION_REFERENCE
+ * TOP_LEVEL_GETTER_DECLARATION
+ * TOP_LEVEL_GETTER_REFERENCE
+ * TOP_LEVEL_SETTER_DECLARATION
+ * TOP_LEVEL_SETTER_REFERENCE
+ * TOP_LEVEL_VARIABLE_DECLARATION
+ * TYPE_NAME_DYNAMIC
+ * TYPE_PARAMETER
+ * UNRESOLVED_INSTANCE_MEMBER_REFERENCE
+ * VALID_STRING_ESCAPE
+ * }
+ */
+final Matcher isHighlightRegionType = new MatchesEnum("HighlightRegionType", [
+ "ANNOTATION",
+ "BUILT_IN",
+ "CLASS",
+ "COMMENT_BLOCK",
+ "COMMENT_DOCUMENTATION",
+ "COMMENT_END_OF_LINE",
+ "CONSTRUCTOR",
+ "DIRECTIVE",
+ "DYNAMIC_TYPE",
+ "DYNAMIC_LOCAL_VARIABLE_DECLARATION",
+ "DYNAMIC_LOCAL_VARIABLE_REFERENCE",
+ "DYNAMIC_PARAMETER_DECLARATION",
+ "DYNAMIC_PARAMETER_REFERENCE",
+ "ENUM",
+ "ENUM_CONSTANT",
+ "FIELD",
+ "FIELD_STATIC",
+ "FUNCTION",
+ "FUNCTION_DECLARATION",
+ "FUNCTION_TYPE_ALIAS",
+ "GETTER_DECLARATION",
+ "IDENTIFIER_DEFAULT",
+ "IMPORT_PREFIX",
+ "INSTANCE_FIELD_DECLARATION",
+ "INSTANCE_FIELD_REFERENCE",
+ "INSTANCE_GETTER_DECLARATION",
+ "INSTANCE_GETTER_REFERENCE",
+ "INSTANCE_METHOD_DECLARATION",
+ "INSTANCE_METHOD_REFERENCE",
+ "INSTANCE_SETTER_DECLARATION",
+ "INSTANCE_SETTER_REFERENCE",
+ "INVALID_STRING_ESCAPE",
+ "KEYWORD",
+ "LABEL",
+ "LIBRARY_NAME",
+ "LITERAL_BOOLEAN",
+ "LITERAL_DOUBLE",
+ "LITERAL_INTEGER",
+ "LITERAL_LIST",
+ "LITERAL_MAP",
+ "LITERAL_STRING",
+ "LOCAL_FUNCTION_DECLARATION",
+ "LOCAL_FUNCTION_REFERENCE",
+ "LOCAL_VARIABLE",
+ "LOCAL_VARIABLE_DECLARATION",
+ "LOCAL_VARIABLE_REFERENCE",
+ "METHOD",
+ "METHOD_DECLARATION",
+ "METHOD_DECLARATION_STATIC",
+ "METHOD_STATIC",
+ "PARAMETER",
+ "SETTER_DECLARATION",
+ "TOP_LEVEL_VARIABLE",
+ "PARAMETER_DECLARATION",
+ "PARAMETER_REFERENCE",
+ "STATIC_FIELD_DECLARATION",
+ "STATIC_GETTER_DECLARATION",
+ "STATIC_GETTER_REFERENCE",
+ "STATIC_METHOD_DECLARATION",
+ "STATIC_METHOD_REFERENCE",
+ "STATIC_SETTER_DECLARATION",
+ "STATIC_SETTER_REFERENCE",
+ "TOP_LEVEL_FUNCTION_DECLARATION",
+ "TOP_LEVEL_FUNCTION_REFERENCE",
+ "TOP_LEVEL_GETTER_DECLARATION",
+ "TOP_LEVEL_GETTER_REFERENCE",
+ "TOP_LEVEL_SETTER_DECLARATION",
+ "TOP_LEVEL_SETTER_REFERENCE",
+ "TOP_LEVEL_VARIABLE_DECLARATION",
+ "TYPE_NAME_DYNAMIC",
+ "TYPE_PARAMETER",
+ "UNRESOLVED_INSTANCE_MEMBER_REFERENCE",
+ "VALID_STRING_ESCAPE"
+]);
/**
- * edit.getRefactoring params
+ * LinkedEditGroup
*
* {
- * "kind": RefactoringKind
- * "file": FilePath
- * "offset": int
+ * "positions": List<Position>
* "length": int
- * "validateOnly": bool
- * "options": optional RefactoringOptions
+ * "suggestions": List<LinkedEditSuggestion>
* }
*/
-final Matcher isEditGetRefactoringParams =
- new LazyMatcher(() => new MatchesJsonObject("edit.getRefactoring params", {
- "kind": isRefactoringKind,
- "file": isFilePath,
- "offset": isInt,
+final Matcher isLinkedEditGroup =
+ new LazyMatcher(() => new MatchesJsonObject("LinkedEditGroup", {
+ "positions": isListOf(isPosition),
"length": isInt,
- "validateOnly": isBool
- }, optionalFields: {
- "options": isRefactoringOptions
+ "suggestions": isListOf(isLinkedEditSuggestion)
}));
/**
- * edit.getRefactoring result
+ * LinkedEditSuggestion
*
* {
- * "initialProblems": List<RefactoringProblem>
- * "optionsProblems": List<RefactoringProblem>
- * "finalProblems": List<RefactoringProblem>
- * "feedback": optional RefactoringFeedback
- * "change": optional SourceChange
- * "potentialEdits": optional List<String>
+ * "value": String
+ * "kind": LinkedEditSuggestionKind
* }
*/
-final Matcher isEditGetRefactoringResult =
- new LazyMatcher(() => new MatchesJsonObject("edit.getRefactoring result", {
- "initialProblems": isListOf(isRefactoringProblem),
- "optionsProblems": isListOf(isRefactoringProblem),
- "finalProblems": isListOf(isRefactoringProblem)
- }, optionalFields: {
- "feedback": isRefactoringFeedback,
- "change": isSourceChange,
- "potentialEdits": isListOf(isString)
- }));
+final Matcher isLinkedEditSuggestion = new LazyMatcher(() =>
+ new MatchesJsonObject("LinkedEditSuggestion",
+ {"value": isString, "kind": isLinkedEditSuggestionKind}));
/**
- * AddContentOverlay
+ * LinkedEditSuggestionKind
*
- * {
- * "type": "add"
- * "content": String
+ * enum {
+ * METHOD
+ * PARAMETER
+ * TYPE
+ * VARIABLE
* }
*/
-final Matcher isAddContentOverlay = new LazyMatcher(() => new MatchesJsonObject(
- "AddContentOverlay", {"type": equals("add"), "content": isString}));
+final Matcher isLinkedEditSuggestionKind = new MatchesEnum(
+ "LinkedEditSuggestionKind", ["METHOD", "PARAMETER", "TYPE", "VARIABLE"]);
/**
- * AnalysisError
+ * Location
*
* {
- * "severity": AnalysisErrorSeverity
- * "type": AnalysisErrorType
- * "location": Location
- * "message": String
- * "correction": optional String
- * "code": String
- * "hasFix": optional bool
+ * "file": FilePath
+ * "offset": int
+ * "length": int
+ * "startLine": int
+ * "startColumn": int
* }
*/
-final Matcher isAnalysisError =
- new LazyMatcher(() => new MatchesJsonObject("AnalysisError", {
- "severity": isAnalysisErrorSeverity,
- "type": isAnalysisErrorType,
- "location": isLocation,
- "message": isString,
- "code": isString
- }, optionalFields: {
- "correction": isString,
- "hasFix": isBool
+final Matcher isLocation =
+ new LazyMatcher(() => new MatchesJsonObject("Location", {
+ "file": isFilePath,
+ "offset": isInt,
+ "length": isInt,
+ "startLine": isInt,
+ "startColumn": isInt
}));
/**
- * AnalysisErrorFixes
+ * NavigationRegion
*
* {
- * "error": AnalysisError
- * "fixes": List<PrioritizedSourceChange>
+ * "offset": int
+ * "length": int
+ * "targets": List<int>
* }
*/
-final Matcher isAnalysisErrorFixes = new LazyMatcher(() =>
- new MatchesJsonObject("AnalysisErrorFixes", {
- "error": isAnalysisError,
- "fixes": isListOf(isPrioritizedSourceChange)
- }));
+final Matcher isNavigationRegion = new LazyMatcher(() => new MatchesJsonObject(
+ "NavigationRegion",
+ {"offset": isInt, "length": isInt, "targets": isListOf(isInt)}));
/**
- * AnalysisErrorSeverity
+ * NavigationTarget
*
- * enum {
- * INFO
- * WARNING
- * ERROR
+ * {
+ * "kind": ElementKind
+ * "fileIndex": int
+ * "offset": int
+ * "length": int
+ * "startLine": int
+ * "startColumn": int
* }
*/
-final Matcher isAnalysisErrorSeverity =
- new MatchesEnum("AnalysisErrorSeverity", ["INFO", "WARNING", "ERROR"]);
+final Matcher isNavigationTarget =
+ new LazyMatcher(() => new MatchesJsonObject("NavigationTarget", {
+ "kind": isElementKind,
+ "fileIndex": isInt,
+ "offset": isInt,
+ "length": isInt,
+ "startLine": isInt,
+ "startColumn": isInt
+ }));
/**
- * AnalysisErrorType
+ * Occurrences
*
- * enum {
- * CHECKED_MODE_COMPILE_TIME_ERROR
- * COMPILE_TIME_ERROR
- * HINT
- * LINT
- * STATIC_TYPE_WARNING
- * STATIC_WARNING
- * SYNTACTIC_ERROR
- * TODO
+ * {
+ * "element": Element
+ * "offsets": List<int>
+ * "length": int
* }
*/
-final Matcher isAnalysisErrorType = new MatchesEnum("AnalysisErrorType", [
- "CHECKED_MODE_COMPILE_TIME_ERROR",
- "COMPILE_TIME_ERROR",
- "HINT",
- "LINT",
- "STATIC_TYPE_WARNING",
- "STATIC_WARNING",
- "SYNTACTIC_ERROR",
- "TODO"
-]);
+final Matcher isOccurrences = new LazyMatcher(() => new MatchesJsonObject(
+ "Occurrences",
+ {"element": isElement, "offsets": isListOf(isInt), "length": isInt}));
/**
- * AnalysisService
+ * Outline
*
- * enum {
- * FOLDING
- * HIGHLIGHTS
- * NAVIGATION
- * OCCURRENCES
- * OUTLINE
+ * {
+ * "element": Element
+ * "offset": int
+ * "length": int
+ * "children": optional List<Outline>
* }
*/
-final Matcher isAnalysisService = new MatchesEnum("AnalysisService",
- ["FOLDING", "HIGHLIGHTS", "NAVIGATION", "OCCURRENCES", "OUTLINE"]);
+final Matcher isOutline = new LazyMatcher(() => new MatchesJsonObject(
+ "Outline", {"element": isElement, "offset": isInt, "length": isInt},
+ optionalFields: {"children": isListOf(isOutline)}));
/**
- * ChangeContentOverlay
+ * Position
*
* {
- * "type": "change"
- * "edits": List<SourceEdit>
+ * "file": FilePath
+ * "offset": int
* }
*/
-final Matcher isChangeContentOverlay = new LazyMatcher(() =>
- new MatchesJsonObject("ChangeContentOverlay",
- {"type": equals("change"), "edits": isListOf(isSourceEdit)}));
+final Matcher isPosition = new LazyMatcher(() =>
+ new MatchesJsonObject("Position", {"file": isFilePath, "offset": isInt}));
/**
- * CompletionSuggestion
+ * PrioritizedSourceChange
*
* {
- * "kind": CompletionSuggestionKind
- * "relevance": int
- * "completion": String
- * "selectionOffset": int
- * "selectionLength": int
- * "isDeprecated": bool
- * "isPotential": bool
- * "docSummary": optional String
- * "docComplete": optional String
- * "declaringType": optional String
- * "defaultArgumentListString": optional String
- * "defaultArgumentListTextRanges": optional List<int>
- * "element": optional Element
- * "returnType": optional String
- * "parameterNames": optional List<String>
- * "parameterTypes": optional List<String>
- * "requiredParameterCount": optional int
- * "hasNamedParameters": optional bool
- * "parameterName": optional String
- * "parameterType": optional String
- * "importUri": optional String
+ * "priority": int
+ * "change": SourceChange
* }
*/
-final Matcher isCompletionSuggestion =
- new LazyMatcher(() => new MatchesJsonObject("CompletionSuggestion", {
- "kind": isCompletionSuggestionKind,
- "relevance": isInt,
- "completion": isString,
- "selectionOffset": isInt,
- "selectionLength": isInt,
- "isDeprecated": isBool,
- "isPotential": isBool
- }, optionalFields: {
- "docSummary": isString,
- "docComplete": isString,
- "declaringType": isString,
- "defaultArgumentListString": isString,
- "defaultArgumentListTextRanges": isListOf(isInt),
- "element": isElement,
- "returnType": isString,
- "parameterNames": isListOf(isString),
- "parameterTypes": isListOf(isString),
- "requiredParameterCount": isInt,
- "hasNamedParameters": isBool,
- "parameterName": isString,
- "parameterType": isString,
- "importUri": isString
- }));
+final Matcher isPrioritizedSourceChange = new LazyMatcher(() =>
+ new MatchesJsonObject("PrioritizedSourceChange",
+ {"priority": isInt, "change": isSourceChange}));
/**
- * CompletionSuggestionKind
+ * RefactoringFeedback
+ *
+ * {
+ * }
+ */
+final Matcher isRefactoringFeedback =
+ new LazyMatcher(() => new MatchesJsonObject("RefactoringFeedback", null));
+
+/**
+ * RefactoringKind
*
* enum {
- * ARGUMENT_LIST
- * IMPORT
- * IDENTIFIER
- * INVOCATION
- * KEYWORD
- * NAMED_ARGUMENT
- * OPTIONAL_ARGUMENT
- * PARAMETER
+ * CONVERT_GETTER_TO_METHOD
+ * CONVERT_METHOD_TO_GETTER
+ * EXTRACT_LOCAL_VARIABLE
+ * EXTRACT_METHOD
+ * INLINE_LOCAL_VARIABLE
+ * INLINE_METHOD
+ * MOVE_FILE
+ * RENAME
+ * SORT_MEMBERS
* }
*/
-final Matcher isCompletionSuggestionKind =
- new MatchesEnum("CompletionSuggestionKind", [
- "ARGUMENT_LIST",
- "IMPORT",
- "IDENTIFIER",
- "INVOCATION",
- "KEYWORD",
- "NAMED_ARGUMENT",
- "OPTIONAL_ARGUMENT",
- "PARAMETER"
+final Matcher isRefactoringKind = new MatchesEnum("RefactoringKind", [
+ "CONVERT_GETTER_TO_METHOD",
+ "CONVERT_METHOD_TO_GETTER",
+ "EXTRACT_LOCAL_VARIABLE",
+ "EXTRACT_METHOD",
+ "INLINE_LOCAL_VARIABLE",
+ "INLINE_METHOD",
+ "MOVE_FILE",
+ "RENAME",
+ "SORT_MEMBERS"
]);
/**
- * ContextBuilderOptions
+ * RefactoringMethodParameter
*
* {
- * "dartSdkSummaryPath": optional String
- * "defaultAnalysisOptionsFilePath": optional List<String>
- * "declaredVariables": optional Map<String, String>
- * "defaultPackageFilePath": optional List<String>
- * "defaultPackagesDirectoryPath": optional List<String>
+ * "id": optional String
+ * "kind": RefactoringMethodParameterKind
+ * "type": String
+ * "name": String
+ * "parameters": optional String
* }
*/
-final Matcher isContextBuilderOptions = new LazyMatcher(
- () => new MatchesJsonObject("ContextBuilderOptions", null, optionalFields: {
- "dartSdkSummaryPath": isString,
- "defaultAnalysisOptionsFilePath": isListOf(isString),
- "declaredVariables": isMapOf(isString, isString),
- "defaultPackageFilePath": isListOf(isString),
- "defaultPackagesDirectoryPath": isListOf(isString)
- }));
+final Matcher isRefactoringMethodParameter = new LazyMatcher(() =>
+ new MatchesJsonObject("RefactoringMethodParameter", {
+ "kind": isRefactoringMethodParameterKind,
+ "type": isString,
+ "name": isString
+ }, optionalFields: {
+ "id": isString,
+ "parameters": isString
+ }));
/**
- * ContextRoot
+ * RefactoringMethodParameterKind
+ *
+ * enum {
+ * REQUIRED
+ * POSITIONAL
+ * NAMED
+ * }
+ */
+final Matcher isRefactoringMethodParameterKind = new MatchesEnum(
+ "RefactoringMethodParameterKind", ["REQUIRED", "POSITIONAL", "NAMED"]);
+
+/**
+ * RefactoringOptions
*
* {
- * "root": String
- * "exclude": List<String>
* }
*/
-final Matcher isContextRoot = new LazyMatcher(() => new MatchesJsonObject(
- "ContextRoot", {"root": isString, "exclude": isListOf(isString)}));
+final Matcher isRefactoringOptions =
+ new LazyMatcher(() => new MatchesJsonObject("RefactoringOptions", null));
/**
- * Element
+ * RefactoringProblem
*
* {
- * "kind": ElementKind
- * "name": String
+ * "severity": RefactoringProblemSeverity
+ * "message": String
* "location": optional Location
- * "flags": int
- * "parameters": optional String
- * "returnType": optional String
- * "typeParameters": optional String
* }
*/
-final Matcher isElement =
- new LazyMatcher(() => new MatchesJsonObject("Element", {
- "kind": isElementKind,
- "name": isString,
- "flags": isInt
- }, optionalFields: {
- "location": isLocation,
- "parameters": isString,
- "returnType": isString,
- "typeParameters": isString
- }));
+final Matcher isRefactoringProblem = new LazyMatcher(() =>
+ new MatchesJsonObject("RefactoringProblem",
+ {"severity": isRefactoringProblemSeverity, "message": isString},
+ optionalFields: {"location": isLocation}));
/**
- * ElementKind
+ * RefactoringProblemSeverity
*
* enum {
- * CLASS
- * CLASS_TYPE_ALIAS
- * COMPILATION_UNIT
- * CONSTRUCTOR
- * ENUM
- * ENUM_CONSTANT
- * FIELD
- * FILE
- * FUNCTION
- * FUNCTION_TYPE_ALIAS
- * GETTER
- * LABEL
- * LIBRARY
- * LOCAL_VARIABLE
- * METHOD
- * PARAMETER
- * PREFIX
- * SETTER
- * TOP_LEVEL_VARIABLE
- * TYPE_PARAMETER
- * UNKNOWN
+ * INFO
+ * WARNING
+ * ERROR
+ * FATAL
* }
*/
-final Matcher isElementKind = new MatchesEnum("ElementKind", [
- "CLASS",
- "CLASS_TYPE_ALIAS",
- "COMPILATION_UNIT",
- "CONSTRUCTOR",
- "ENUM",
- "ENUM_CONSTANT",
- "FIELD",
- "FILE",
- "FUNCTION",
- "FUNCTION_TYPE_ALIAS",
- "GETTER",
- "LABEL",
- "LIBRARY",
- "LOCAL_VARIABLE",
- "METHOD",
- "PARAMETER",
- "PREFIX",
- "SETTER",
- "TOP_LEVEL_VARIABLE",
- "TYPE_PARAMETER",
- "UNKNOWN"
-]);
+final Matcher isRefactoringProblemSeverity = new MatchesEnum(
+ "RefactoringProblemSeverity", ["INFO", "WARNING", "ERROR", "FATAL"]);
/**
- * FilePath
+ * RemoveContentOverlay
*
- * String
+ * {
+ * "type": "remove"
+ * }
*/
-final Matcher isFilePath = isString;
+final Matcher isRemoveContentOverlay = new LazyMatcher(() =>
+ new MatchesJsonObject("RemoveContentOverlay", {"type": equals("remove")}));
/**
- * FoldingKind
+ * RequestError
+ *
+ * {
+ * "code": RequestErrorCode
+ * "message": String
+ * "stackTrace": optional String
+ * }
+ */
+final Matcher isRequestError = new LazyMatcher(() => new MatchesJsonObject(
+ "RequestError", {"code": isRequestErrorCode, "message": isString},
+ optionalFields: {"stackTrace": isString}));
+
+/**
+ * RequestErrorCode
*
* enum {
- * COMMENT
- * CLASS_MEMBER
- * DIRECTIVES
- * DOCUMENTATION_COMMENT
- * TOP_LEVEL_DECLARATION
+ * INVALID_OVERLAY_CHANGE
+ * INVALID_PARAMETER
+ * PLUGIN_ERROR
+ * UNKNOWN_REQUEST
* }
*/
-final Matcher isFoldingKind = new MatchesEnum("FoldingKind", [
- "COMMENT",
- "CLASS_MEMBER",
- "DIRECTIVES",
- "DOCUMENTATION_COMMENT",
- "TOP_LEVEL_DECLARATION"
+final Matcher isRequestErrorCode = new MatchesEnum("RequestErrorCode", [
+ "INVALID_OVERLAY_CHANGE",
+ "INVALID_PARAMETER",
+ "PLUGIN_ERROR",
+ "UNKNOWN_REQUEST"
]);
/**
- * FoldingRegion
+ * SourceChange
*
* {
- * "kind": FoldingKind
- * "offset": int
- * "length": int
+ * "message": String
+ * "edits": List<SourceFileEdit>
+ * "linkedEditGroups": List<LinkedEditGroup>
+ * "selection": optional Position
* }
*/
-final Matcher isFoldingRegion = new LazyMatcher(() => new MatchesJsonObject(
- "FoldingRegion",
- {"kind": isFoldingKind, "offset": isInt, "length": isInt}));
+final Matcher isSourceChange =
+ new LazyMatcher(() => new MatchesJsonObject("SourceChange", {
+ "message": isString,
+ "edits": isListOf(isSourceFileEdit),
+ "linkedEditGroups": isListOf(isLinkedEditGroup)
+ }, optionalFields: {
+ "selection": isPosition
+ }));
/**
- * HighlightRegion
+ * SourceEdit
*
* {
- * "type": HighlightRegionType
* "offset": int
* "length": int
+ * "replacement": String
+ * "id": optional String
* }
*/
-final Matcher isHighlightRegion = new LazyMatcher(() => new MatchesJsonObject(
- "HighlightRegion",
- {"type": isHighlightRegionType, "offset": isInt, "length": isInt}));
+final Matcher isSourceEdit = new LazyMatcher(() => new MatchesJsonObject(
+ "SourceEdit", {"offset": isInt, "length": isInt, "replacement": isString},
+ optionalFields: {"id": isString}));
/**
- * HighlightRegionType
+ * SourceFileEdit
+ *
+ * {
+ * "file": FilePath
+ * "fileStamp": long
+ * "edits": List<SourceEdit>
+ * }
+ */
+final Matcher isSourceFileEdit = new LazyMatcher(() => new MatchesJsonObject(
+ "SourceFileEdit",
+ {"file": isFilePath, "fileStamp": isInt, "edits": isListOf(isSourceEdit)}));
+
+/**
+ * WatchEvent
+ *
+ * {
+ * "type": WatchEventType
+ * "path": String
+ * }
+ */
+final Matcher isWatchEvent = new LazyMatcher(() => new MatchesJsonObject(
+ "WatchEvent", {"type": isWatchEventType, "path": isString}));
+
+/**
+ * WatchEventType
*
* enum {
- * ANNOTATION
- * BUILT_IN
- * CLASS
- * COMMENT_BLOCK
- * COMMENT_DOCUMENTATION
- * COMMENT_END_OF_LINE
- * CONSTRUCTOR
- * DIRECTIVE
- * DYNAMIC_TYPE
- * DYNAMIC_LOCAL_VARIABLE_DECLARATION
- * DYNAMIC_LOCAL_VARIABLE_REFERENCE
- * DYNAMIC_PARAMETER_DECLARATION
- * DYNAMIC_PARAMETER_REFERENCE
- * ENUM
- * ENUM_CONSTANT
- * FIELD
- * FIELD_STATIC
- * FUNCTION
- * FUNCTION_DECLARATION
- * FUNCTION_TYPE_ALIAS
- * GETTER_DECLARATION
- * IDENTIFIER_DEFAULT
- * IMPORT_PREFIX
- * INSTANCE_FIELD_DECLARATION
- * INSTANCE_FIELD_REFERENCE
- * INSTANCE_GETTER_DECLARATION
- * INSTANCE_GETTER_REFERENCE
- * INSTANCE_METHOD_DECLARATION
- * INSTANCE_METHOD_REFERENCE
- * INSTANCE_SETTER_DECLARATION
- * INSTANCE_SETTER_REFERENCE
- * INVALID_STRING_ESCAPE
- * KEYWORD
- * LABEL
- * LIBRARY_NAME
- * LITERAL_BOOLEAN
- * LITERAL_DOUBLE
- * LITERAL_INTEGER
- * LITERAL_LIST
- * LITERAL_MAP
- * LITERAL_STRING
- * LOCAL_FUNCTION_DECLARATION
- * LOCAL_FUNCTION_REFERENCE
- * LOCAL_VARIABLE
- * LOCAL_VARIABLE_DECLARATION
- * LOCAL_VARIABLE_REFERENCE
- * METHOD
- * METHOD_DECLARATION
- * METHOD_DECLARATION_STATIC
- * METHOD_STATIC
- * PARAMETER
- * SETTER_DECLARATION
- * TOP_LEVEL_VARIABLE
- * PARAMETER_DECLARATION
- * PARAMETER_REFERENCE
- * STATIC_FIELD_DECLARATION
- * STATIC_GETTER_DECLARATION
- * STATIC_GETTER_REFERENCE
- * STATIC_METHOD_DECLARATION
- * STATIC_METHOD_REFERENCE
- * STATIC_SETTER_DECLARATION
- * STATIC_SETTER_REFERENCE
- * TOP_LEVEL_FUNCTION_DECLARATION
- * TOP_LEVEL_FUNCTION_REFERENCE
- * TOP_LEVEL_GETTER_DECLARATION
- * TOP_LEVEL_GETTER_REFERENCE
- * TOP_LEVEL_SETTER_DECLARATION
- * TOP_LEVEL_SETTER_REFERENCE
- * TOP_LEVEL_VARIABLE_DECLARATION
- * TYPE_NAME_DYNAMIC
- * TYPE_PARAMETER
- * UNRESOLVED_INSTANCE_MEMBER_REFERENCE
- * VALID_STRING_ESCAPE
+ * ADD
+ * MODIFY
+ * REMOVE
* }
*/
-final Matcher isHighlightRegionType = new MatchesEnum("HighlightRegionType", [
- "ANNOTATION",
- "BUILT_IN",
- "CLASS",
- "COMMENT_BLOCK",
- "COMMENT_DOCUMENTATION",
- "COMMENT_END_OF_LINE",
- "CONSTRUCTOR",
- "DIRECTIVE",
- "DYNAMIC_TYPE",
- "DYNAMIC_LOCAL_VARIABLE_DECLARATION",
- "DYNAMIC_LOCAL_VARIABLE_REFERENCE",
- "DYNAMIC_PARAMETER_DECLARATION",
- "DYNAMIC_PARAMETER_REFERENCE",
- "ENUM",
- "ENUM_CONSTANT",
- "FIELD",
- "FIELD_STATIC",
- "FUNCTION",
- "FUNCTION_DECLARATION",
- "FUNCTION_TYPE_ALIAS",
- "GETTER_DECLARATION",
- "IDENTIFIER_DEFAULT",
- "IMPORT_PREFIX",
- "INSTANCE_FIELD_DECLARATION",
- "INSTANCE_FIELD_REFERENCE",
- "INSTANCE_GETTER_DECLARATION",
- "INSTANCE_GETTER_REFERENCE",
- "INSTANCE_METHOD_DECLARATION",
- "INSTANCE_METHOD_REFERENCE",
- "INSTANCE_SETTER_DECLARATION",
- "INSTANCE_SETTER_REFERENCE",
- "INVALID_STRING_ESCAPE",
- "KEYWORD",
- "LABEL",
- "LIBRARY_NAME",
- "LITERAL_BOOLEAN",
- "LITERAL_DOUBLE",
- "LITERAL_INTEGER",
- "LITERAL_LIST",
- "LITERAL_MAP",
- "LITERAL_STRING",
- "LOCAL_FUNCTION_DECLARATION",
- "LOCAL_FUNCTION_REFERENCE",
- "LOCAL_VARIABLE",
- "LOCAL_VARIABLE_DECLARATION",
- "LOCAL_VARIABLE_REFERENCE",
- "METHOD",
- "METHOD_DECLARATION",
- "METHOD_DECLARATION_STATIC",
- "METHOD_STATIC",
- "PARAMETER",
- "SETTER_DECLARATION",
- "TOP_LEVEL_VARIABLE",
- "PARAMETER_DECLARATION",
- "PARAMETER_REFERENCE",
- "STATIC_FIELD_DECLARATION",
- "STATIC_GETTER_DECLARATION",
- "STATIC_GETTER_REFERENCE",
- "STATIC_METHOD_DECLARATION",
- "STATIC_METHOD_REFERENCE",
- "STATIC_SETTER_DECLARATION",
- "STATIC_SETTER_REFERENCE",
- "TOP_LEVEL_FUNCTION_DECLARATION",
- "TOP_LEVEL_FUNCTION_REFERENCE",
- "TOP_LEVEL_GETTER_DECLARATION",
- "TOP_LEVEL_GETTER_REFERENCE",
- "TOP_LEVEL_SETTER_DECLARATION",
- "TOP_LEVEL_SETTER_REFERENCE",
- "TOP_LEVEL_VARIABLE_DECLARATION",
- "TYPE_NAME_DYNAMIC",
- "TYPE_PARAMETER",
- "UNRESOLVED_INSTANCE_MEMBER_REFERENCE",
- "VALID_STRING_ESCAPE"
-]);
+final Matcher isWatchEventType =
+ new MatchesEnum("WatchEventType", ["ADD", "MODIFY", "REMOVE"]);
/**
- * LinkedEditGroup
+ * analysis.errors params
*
* {
- * "positions": List<Position>
- * "length": int
- * "suggestions": List<LinkedEditSuggestion>
+ * "file": FilePath
+ * "errors": List<AnalysisError>
* }
*/
-final Matcher isLinkedEditGroup =
- new LazyMatcher(() => new MatchesJsonObject("LinkedEditGroup", {
- "positions": isListOf(isPosition),
- "length": isInt,
- "suggestions": isListOf(isLinkedEditSuggestion)
- }));
+final Matcher isAnalysisErrorsParams = new LazyMatcher(() =>
+ new MatchesJsonObject("analysis.errors params",
+ {"file": isFilePath, "errors": isListOf(isAnalysisError)}));
/**
- * LinkedEditSuggestion
+ * analysis.folding params
*
* {
- * "value": String
- * "kind": LinkedEditSuggestionKind
+ * "file": FilePath
+ * "regions": List<FoldingRegion>
* }
*/
-final Matcher isLinkedEditSuggestion = new LazyMatcher(() =>
- new MatchesJsonObject("LinkedEditSuggestion",
- {"value": isString, "kind": isLinkedEditSuggestionKind}));
+final Matcher isAnalysisFoldingParams = new LazyMatcher(() =>
+ new MatchesJsonObject("analysis.folding params",
+ {"file": isFilePath, "regions": isListOf(isFoldingRegion)}));
/**
- * LinkedEditSuggestionKind
+ * analysis.handleWatchEvents params
*
- * enum {
- * METHOD
- * PARAMETER
- * TYPE
- * VARIABLE
+ * {
+ * "events": List<WatchEvent>
* }
*/
-final Matcher isLinkedEditSuggestionKind = new MatchesEnum(
- "LinkedEditSuggestionKind", ["METHOD", "PARAMETER", "TYPE", "VARIABLE"]);
+final Matcher isAnalysisHandleWatchEventsParams = new LazyMatcher(() =>
+ new MatchesJsonObject("analysis.handleWatchEvents params",
+ {"events": isListOf(isWatchEvent)}));
/**
- * Location
+ * analysis.handleWatchEvents result
+ */
+final Matcher isAnalysisHandleWatchEventsResult = isNull;
+
+/**
+ * analysis.highlights params
*
* {
* "file": FilePath
- * "offset": int
- * "length": int
- * "startLine": int
- * "startColumn": int
+ * "regions": List<HighlightRegion>
* }
*/
-final Matcher isLocation =
- new LazyMatcher(() => new MatchesJsonObject("Location", {
- "file": isFilePath,
- "offset": isInt,
- "length": isInt,
- "startLine": isInt,
- "startColumn": isInt
- }));
+final Matcher isAnalysisHighlightsParams = new LazyMatcher(() =>
+ new MatchesJsonObject("analysis.highlights params",
+ {"file": isFilePath, "regions": isListOf(isHighlightRegion)}));
/**
- * NavigationRegion
+ * analysis.navigation params
*
* {
- * "offset": int
- * "length": int
- * "targets": List<int>
+ * "file": FilePath
+ * "regions": List<NavigationRegion>
+ * "targets": List<NavigationTarget>
+ * "files": List<FilePath>
* }
*/
-final Matcher isNavigationRegion = new LazyMatcher(() => new MatchesJsonObject(
- "NavigationRegion",
- {"offset": isInt, "length": isInt, "targets": isListOf(isInt)}));
+final Matcher isAnalysisNavigationParams =
+ new LazyMatcher(() => new MatchesJsonObject("analysis.navigation params", {
+ "file": isFilePath,
+ "regions": isListOf(isNavigationRegion),
+ "targets": isListOf(isNavigationTarget),
+ "files": isListOf(isFilePath)
+ }));
/**
- * NavigationTarget
+ * analysis.occurrences params
*
* {
- * "kind": ElementKind
- * "fileIndex": int
- * "offset": int
- * "length": int
- * "startLine": int
- * "startColumn": int
+ * "file": FilePath
+ * "occurrences": List<Occurrences>
* }
*/
-final Matcher isNavigationTarget =
- new LazyMatcher(() => new MatchesJsonObject("NavigationTarget", {
- "kind": isElementKind,
- "fileIndex": isInt,
- "offset": isInt,
- "length": isInt,
- "startLine": isInt,
- "startColumn": isInt
- }));
+final Matcher isAnalysisOccurrencesParams = new LazyMatcher(() =>
+ new MatchesJsonObject("analysis.occurrences params",
+ {"file": isFilePath, "occurrences": isListOf(isOccurrences)}));
/**
- * Occurrences
+ * analysis.outline params
*
* {
- * "element": Element
- * "offsets": List<int>
- * "length": int
+ * "file": FilePath
+ * "outline": List<Outline>
* }
*/
-final Matcher isOccurrences = new LazyMatcher(() => new MatchesJsonObject(
- "Occurrences",
- {"element": isElement, "offsets": isListOf(isInt), "length": isInt}));
+final Matcher isAnalysisOutlineParams = new LazyMatcher(() =>
+ new MatchesJsonObject("analysis.outline params",
+ {"file": isFilePath, "outline": isListOf(isOutline)}));
/**
- * Outline
+ * analysis.reanalyze params
*
* {
- * "element": Element
- * "offset": int
- * "length": int
- * "children": optional List<Outline>
+ * "roots": optional List<FilePath>
* }
*/
-final Matcher isOutline = new LazyMatcher(() => new MatchesJsonObject(
- "Outline", {"element": isElement, "offset": isInt, "length": isInt},
- optionalFields: {"children": isListOf(isOutline)}));
+final Matcher isAnalysisReanalyzeParams = new LazyMatcher(() =>
+ new MatchesJsonObject("analysis.reanalyze params", null,
+ optionalFields: {"roots": isListOf(isFilePath)}));
/**
- * Position
+ * analysis.reanalyze result
+ */
+final Matcher isAnalysisReanalyzeResult = isNull;
+
+/**
+ * analysis.setContextBuilderOptions params
*
* {
- * "file": FilePath
- * "offset": int
+ * "options": ContextBuilderOptions
* }
*/
-final Matcher isPosition = new LazyMatcher(() =>
- new MatchesJsonObject("Position", {"file": isFilePath, "offset": isInt}));
+final Matcher isAnalysisSetContextBuilderOptionsParams = new LazyMatcher(() =>
+ new MatchesJsonObject("analysis.setContextBuilderOptions params",
+ {"options": isContextBuilderOptions}));
/**
- * PrioritizedSourceChange
+ * analysis.setContextBuilderOptions result
+ */
+final Matcher isAnalysisSetContextBuilderOptionsResult = isNull;
+
+/**
+ * analysis.setContextRoots params
*
* {
- * "priority": int
- * "change": SourceChange
+ * "roots": List<ContextRoot>
* }
*/
-final Matcher isPrioritizedSourceChange = new LazyMatcher(() =>
- new MatchesJsonObject("PrioritizedSourceChange",
- {"priority": isInt, "change": isSourceChange}));
+final Matcher isAnalysisSetContextRootsParams = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "analysis.setContextRoots params", {"roots": isListOf(isContextRoot)}));
/**
- * RefactoringFeedback
+ * analysis.setContextRoots result
+ */
+final Matcher isAnalysisSetContextRootsResult = isNull;
+
+/**
+ * analysis.setPriorityFiles params
*
* {
+ * "files": List<FilePath>
* }
*/
-final Matcher isRefactoringFeedback =
- new LazyMatcher(() => new MatchesJsonObject("RefactoringFeedback", null));
+final Matcher isAnalysisSetPriorityFilesParams = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "analysis.setPriorityFiles params", {"files": isListOf(isFilePath)}));
/**
- * RefactoringKind
- *
- * enum {
- * CONVERT_GETTER_TO_METHOD
- * CONVERT_METHOD_TO_GETTER
- * EXTRACT_LOCAL_VARIABLE
- * EXTRACT_METHOD
- * INLINE_LOCAL_VARIABLE
- * INLINE_METHOD
- * MOVE_FILE
- * RENAME
- * SORT_MEMBERS
- * }
+ * analysis.setPriorityFiles result
*/
-final Matcher isRefactoringKind = new MatchesEnum("RefactoringKind", [
- "CONVERT_GETTER_TO_METHOD",
- "CONVERT_METHOD_TO_GETTER",
- "EXTRACT_LOCAL_VARIABLE",
- "EXTRACT_METHOD",
- "INLINE_LOCAL_VARIABLE",
- "INLINE_METHOD",
- "MOVE_FILE",
- "RENAME",
- "SORT_MEMBERS"
-]);
+final Matcher isAnalysisSetPriorityFilesResult = isNull;
/**
- * RefactoringMethodParameter
+ * analysis.setSubscriptions params
*
* {
- * "id": optional String
- * "kind": RefactoringMethodParameterKind
- * "type": String
- * "name": String
- * "parameters": optional String
+ * "subscriptions": Map<AnalysisService, List<FilePath>>
* }
*/
-final Matcher isRefactoringMethodParameter = new LazyMatcher(() =>
- new MatchesJsonObject("RefactoringMethodParameter", {
- "kind": isRefactoringMethodParameterKind,
- "type": isString,
- "name": isString
- }, optionalFields: {
- "id": isString,
- "parameters": isString
- }));
+final Matcher isAnalysisSetSubscriptionsParams = new LazyMatcher(() =>
+ new MatchesJsonObject("analysis.setSubscriptions params",
+ {"subscriptions": isMapOf(isAnalysisService, isListOf(isFilePath))}));
/**
- * RefactoringOptions
+ * analysis.setSubscriptions result
+ */
+final Matcher isAnalysisSetSubscriptionsResult = isNull;
+
+/**
+ * analysis.updateContent params
*
* {
+ * "files": Map<FilePath, AddContentOverlay | ChangeContentOverlay | RemoveContentOverlay>
* }
*/
-final Matcher isRefactoringOptions =
- new LazyMatcher(() => new MatchesJsonObject("RefactoringOptions", null));
+final Matcher isAnalysisUpdateContentParams = new LazyMatcher(
+ () => new MatchesJsonObject("analysis.updateContent params", {
+ "files": isMapOf(
+ isFilePath,
+ isOneOf([
+ isAddContentOverlay,
+ isChangeContentOverlay,
+ isRemoveContentOverlay
+ ]))
+ }));
/**
- * RefactoringMethodParameterKind
+ * analysis.updateContent result
+ */
+final Matcher isAnalysisUpdateContentResult = isNull;
+
+/**
+ * completion.getSuggestions params
*
- * enum {
- * REQUIRED
- * POSITIONAL
- * NAMED
+ * {
+ * "file": FilePath
+ * "offset": int
* }
*/
-final Matcher isRefactoringMethodParameterKind = new MatchesEnum(
- "RefactoringMethodParameterKind", ["REQUIRED", "POSITIONAL", "NAMED"]);
+final Matcher isCompletionGetSuggestionsParams = new LazyMatcher(() =>
+ new MatchesJsonObject("completion.getSuggestions params",
+ {"file": isFilePath, "offset": isInt}));
/**
- * RefactoringProblem
+ * completion.getSuggestions result
*
* {
- * "severity": RefactoringProblemSeverity
- * "message": String
- * "location": optional Location
+ * "replacementOffset": int
+ * "replacementLength": int
+ * "results": List<CompletionSuggestion>
* }
*/
-final Matcher isRefactoringProblem = new LazyMatcher(() =>
- new MatchesJsonObject("RefactoringProblem",
- {"severity": isRefactoringProblemSeverity, "message": isString},
- optionalFields: {"location": isLocation}));
+final Matcher isCompletionGetSuggestionsResult = new LazyMatcher(
+ () => new MatchesJsonObject("completion.getSuggestions result", {
+ "replacementOffset": isInt,
+ "replacementLength": isInt,
+ "results": isListOf(isCompletionSuggestion)
+ }));
/**
- * RefactoringProblemSeverity
- *
- * enum {
- * INFO
- * WARNING
- * ERROR
- * FATAL
- * }
+ * convertGetterToMethod feedback
*/
-final Matcher isRefactoringProblemSeverity = new MatchesEnum(
- "RefactoringProblemSeverity", ["INFO", "WARNING", "ERROR", "FATAL"]);
+final Matcher isConvertGetterToMethodFeedback = isNull;
/**
- * RemoveContentOverlay
- *
- * {
- * "type": "remove"
- * }
+ * convertGetterToMethod options
*/
-final Matcher isRemoveContentOverlay = new LazyMatcher(() =>
- new MatchesJsonObject("RemoveContentOverlay", {"type": equals("remove")}));
+final Matcher isConvertGetterToMethodOptions = isNull;
/**
- * RequestError
- *
- * {
- * "code": RequestErrorCode
- * "message": String
- * "stackTrace": optional String
- * }
+ * convertMethodToGetter feedback
*/
-final Matcher isRequestError = new LazyMatcher(() => new MatchesJsonObject(
- "RequestError", {"code": isRequestErrorCode, "message": isString},
- optionalFields: {"stackTrace": isString}));
+final Matcher isConvertMethodToGetterFeedback = isNull;
/**
- * RequestErrorCode
- *
- * enum {
- * INVALID_OVERLAY_CHANGE
- * INVALID_PARAMETER
- * PLUGIN_ERROR
- * UNKNOWN_REQUEST
- * }
+ * convertMethodToGetter options
*/
-final Matcher isRequestErrorCode = new MatchesEnum("RequestErrorCode", [
- "INVALID_OVERLAY_CHANGE",
- "INVALID_PARAMETER",
- "PLUGIN_ERROR",
- "UNKNOWN_REQUEST"
-]);
+final Matcher isConvertMethodToGetterOptions = isNull;
/**
- * SourceChange
+ * edit.getAssists params
*
* {
- * "message": String
- * "edits": List<SourceFileEdit>
- * "linkedEditGroups": List<LinkedEditGroup>
- * "selection": optional Position
+ * "file": FilePath
+ * "offset": int
+ * "length": int
* }
*/
-final Matcher isSourceChange =
- new LazyMatcher(() => new MatchesJsonObject("SourceChange", {
- "message": isString,
- "edits": isListOf(isSourceFileEdit),
- "linkedEditGroups": isListOf(isLinkedEditGroup)
- }, optionalFields: {
- "selection": isPosition
- }));
+final Matcher isEditGetAssistsParams = new LazyMatcher(() =>
+ new MatchesJsonObject("edit.getAssists params",
+ {"file": isFilePath, "offset": isInt, "length": isInt}));
/**
- * SourceEdit
+ * edit.getAssists result
*
* {
- * "offset": int
- * "length": int
- * "replacement": String
- * "id": optional String
+ * "assists": List<PrioritizedSourceChange>
* }
*/
-final Matcher isSourceEdit = new LazyMatcher(() => new MatchesJsonObject(
- "SourceEdit", {"offset": isInt, "length": isInt, "replacement": isString},
- optionalFields: {"id": isString}));
+final Matcher isEditGetAssistsResult = new LazyMatcher(() =>
+ new MatchesJsonObject("edit.getAssists result",
+ {"assists": isListOf(isPrioritizedSourceChange)}));
/**
- * SourceFileEdit
+ * edit.getAvailableRefactorings params
*
* {
* "file": FilePath
- * "fileStamp": long
- * "edits": List<SourceEdit>
+ * "offset": int
+ * "length": int
* }
*/
-final Matcher isSourceFileEdit = new LazyMatcher(() => new MatchesJsonObject(
- "SourceFileEdit",
- {"file": isFilePath, "fileStamp": isInt, "edits": isListOf(isSourceEdit)}));
+final Matcher isEditGetAvailableRefactoringsParams = new LazyMatcher(() =>
+ new MatchesJsonObject("edit.getAvailableRefactorings params",
+ {"file": isFilePath, "offset": isInt, "length": isInt}));
/**
- * WatchEvent
+ * edit.getAvailableRefactorings result
*
* {
- * "type": WatchEventType
- * "path": String
+ * "kinds": List<RefactoringKind>
* }
*/
-final Matcher isWatchEvent = new LazyMatcher(() => new MatchesJsonObject(
- "WatchEvent", {"type": isWatchEventType, "path": isString}));
+final Matcher isEditGetAvailableRefactoringsResult = new LazyMatcher(() =>
+ new MatchesJsonObject("edit.getAvailableRefactorings result",
+ {"kinds": isListOf(isRefactoringKind)}));
/**
- * WatchEventType
+ * edit.getFixes params
*
- * enum {
- * ADD
- * MODIFY
- * REMOVE
+ * {
+ * "file": FilePath
+ * "offset": int
* }
*/
-final Matcher isWatchEventType =
- new MatchesEnum("WatchEventType", ["ADD", "MODIFY", "REMOVE"]);
-
-/**
- * convertGetterToMethod feedback
- */
-final Matcher isConvertGetterToMethodFeedback = isNull;
+final Matcher isEditGetFixesParams = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "edit.getFixes params", {"file": isFilePath, "offset": isInt}));
/**
- * convertGetterToMethod options
+ * edit.getFixes result
+ *
+ * {
+ * "fixes": List<AnalysisErrorFixes>
+ * }
*/
-final Matcher isConvertGetterToMethodOptions = isNull;
+final Matcher isEditGetFixesResult = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "edit.getFixes result", {"fixes": isListOf(isAnalysisErrorFixes)}));
/**
- * convertMethodToGetter feedback
+ * edit.getRefactoring params
+ *
+ * {
+ * "kind": RefactoringKind
+ * "file": FilePath
+ * "offset": int
+ * "length": int
+ * "validateOnly": bool
+ * "options": optional RefactoringOptions
+ * }
*/
-final Matcher isConvertMethodToGetterFeedback = isNull;
+final Matcher isEditGetRefactoringParams =
+ new LazyMatcher(() => new MatchesJsonObject("edit.getRefactoring params", {
+ "kind": isRefactoringKind,
+ "file": isFilePath,
+ "offset": isInt,
+ "length": isInt,
+ "validateOnly": isBool
+ }, optionalFields: {
+ "options": isRefactoringOptions
+ }));
/**
- * convertMethodToGetter options
+ * edit.getRefactoring result
+ *
+ * {
+ * "initialProblems": List<RefactoringProblem>
+ * "optionsProblems": List<RefactoringProblem>
+ * "finalProblems": List<RefactoringProblem>
+ * "feedback": optional RefactoringFeedback
+ * "change": optional SourceChange
+ * "potentialEdits": optional List<String>
+ * }
*/
-final Matcher isConvertMethodToGetterOptions = isNull;
+final Matcher isEditGetRefactoringResult =
+ new LazyMatcher(() => new MatchesJsonObject("edit.getRefactoring result", {
+ "initialProblems": isListOf(isRefactoringProblem),
+ "optionsProblems": isListOf(isRefactoringProblem),
+ "finalProblems": isListOf(isRefactoringProblem)
+ }, optionalFields: {
+ "feedback": isRefactoringFeedback,
+ "change": isSourceChange,
+ "potentialEdits": isListOf(isString)
+ }));
/**
* extractLocalVariable feedback
@@ -1435,6 +1383,62 @@ final Matcher isMoveFileOptions = new LazyMatcher(
() => new MatchesJsonObject("moveFile options", {"newFile": isFilePath}));
/**
+ * plugin.error params
+ *
+ * {
+ * "isFatal": bool
+ * "message": String
+ * "stackTrace": String
+ * }
+ */
+final Matcher isPluginErrorParams = new LazyMatcher(() => new MatchesJsonObject(
+ "plugin.error params",
+ {"isFatal": isBool, "message": isString, "stackTrace": isString}));
+
+/**
+ * plugin.shutdown params
+ */
+final Matcher isPluginShutdownParams = isNull;
+
+/**
+ * plugin.shutdown result
+ */
+final Matcher isPluginShutdownResult = isNull;
+
+/**
+ * plugin.versionCheck params
+ *
+ * {
+ * "byteStorePath": String
+ * "version": String
+ * }
+ */
+final Matcher isPluginVersionCheckParams = new LazyMatcher(() =>
+ new MatchesJsonObject("plugin.versionCheck params",
+ {"byteStorePath": isString, "version": isString}));
+
+/**
+ * plugin.versionCheck result
+ *
+ * {
+ * "isCompatible": bool
+ * "name": String
+ * "version": String
+ * "contactInfo": optional String
+ * "interestingFiles": List<String>
+ * }
+ */
+final Matcher isPluginVersionCheckResult =
+ new LazyMatcher(() => new MatchesJsonObject("plugin.versionCheck result", {
+ "isCompatible": isBool,
+ "name": isString,
+ "version": isString,
+ "interestingFiles": isListOf(isString)
+ }, optionalFields: {
+ "contactInfo": isString
+ }));
+
+/**
* rename feedback
*
* {
« no previous file with comments | « pkg/analyzer_plugin/lib/protocol/protocol_generated.dart ('k') | pkg/analyzer_plugin/tool/spec/codegen_matchers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698