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

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

Issue 2879273002: Make server use the common protocol classes (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/analysis_server/test/integration/support/protocol_matchers.dart
diff --git a/pkg/analysis_server/test/integration/support/protocol_matchers.dart b/pkg/analysis_server/test/integration/support/protocol_matchers.dart
index c0455a3f9686e3d01246158ee81a49fc3cf2c100..3c1749da27cbb88deb1f14b03152c99807be10ed 100644
--- a/pkg/analysis_server/test/integration/support/protocol_matchers.dart
+++ b/pkg/analysis_server/test/integration/support/protocol_matchers.dart
@@ -14,2170 +14,1958 @@ import 'package:test/test.dart';
import 'integration_tests.dart';
/**
- * server.getVersion params
- */
-final Matcher isServerGetVersionParams = isNull;
-
-/**
- * server.getVersion result
+ * AddContentOverlay
*
* {
- * "version": String
+ * "type": "add"
+ * "content": String
* }
*/
-final Matcher isServerGetVersionResult = new LazyMatcher(() =>
- new MatchesJsonObject("server.getVersion result", {"version": isString}));
-
-/**
- * server.shutdown params
- */
-final Matcher isServerShutdownParams = isNull;
-
-/**
- * server.shutdown result
- */
-final Matcher isServerShutdownResult = isNull;
+final Matcher isAddContentOverlay = new LazyMatcher(() => new MatchesJsonObject(
+ "AddContentOverlay", {"type": equals("add"), "content": isString}));
/**
- * server.setSubscriptions params
+ * AnalysisError
*
* {
- * "subscriptions": List<ServerService>
+ * "severity": AnalysisErrorSeverity
+ * "type": AnalysisErrorType
+ * "location": Location
+ * "message": String
+ * "correction": optional String
+ * "code": String
+ * "hasFix": optional bool
* }
*/
-final Matcher isServerSetSubscriptionsParams = new LazyMatcher(() =>
- new MatchesJsonObject("server.setSubscriptions params",
- {"subscriptions": isListOf(isServerService)}));
-
-/**
- * server.setSubscriptions result
- */
-final Matcher isServerSetSubscriptionsResult = isNull;
+final Matcher isAnalysisError =
+ new LazyMatcher(() => new MatchesJsonObject("AnalysisError", {
+ "severity": isAnalysisErrorSeverity,
+ "type": isAnalysisErrorType,
+ "location": isLocation,
+ "message": isString,
+ "code": isString
+ }, optionalFields: {
+ "correction": isString,
+ "hasFix": isBool
+ }));
/**
- * server.connected params
+ * AnalysisErrorFixes
*
* {
- * "version": String
- * "pid": int
- * "sessionId": optional String
+ * "error": AnalysisError
+ * "fixes": List<SourceChange>
* }
*/
-final Matcher isServerConnectedParams = new LazyMatcher(() =>
- new MatchesJsonObject(
- "server.connected params", {"version": isString, "pid": isInt},
- optionalFields: {"sessionId": isString}));
+final Matcher isAnalysisErrorFixes = new LazyMatcher(() =>
+ new MatchesJsonObject("AnalysisErrorFixes",
+ {"error": isAnalysisError, "fixes": isListOf(isSourceChange)}));
/**
- * server.error params
+ * AnalysisErrorSeverity
*
- * {
- * "isFatal": bool
- * "message": String
- * "stackTrace": String
+ * enum {
+ * INFO
+ * WARNING
+ * ERROR
* }
*/
-final Matcher isServerErrorParams = new LazyMatcher(() => new MatchesJsonObject(
- "server.error params",
- {"isFatal": isBool, "message": isString, "stackTrace": isString}));
+final Matcher isAnalysisErrorSeverity =
+ new MatchesEnum("AnalysisErrorSeverity", ["INFO", "WARNING", "ERROR"]);
/**
- * server.status params
+ * AnalysisErrorType
*
- * {
- * "analysis": optional AnalysisStatus
- * "pub": optional PubStatus
+ * enum {
+ * CHECKED_MODE_COMPILE_TIME_ERROR
+ * COMPILE_TIME_ERROR
+ * HINT
+ * LINT
+ * STATIC_TYPE_WARNING
+ * STATIC_WARNING
+ * SYNTACTIC_ERROR
+ * TODO
* }
*/
-final Matcher isServerStatusParams = new LazyMatcher(() =>
- new MatchesJsonObject("server.status params", null,
- optionalFields: {"analysis": isAnalysisStatus, "pub": isPubStatus}));
+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.getErrors params
+ * AnalysisOptions
*
* {
- * "file": FilePath
+ * "enableAsync": optional bool
+ * "enableDeferredLoading": optional bool
+ * "enableEnums": optional bool
+ * "enableNullAwareOperators": optional bool
+ * "enableSuperMixins": optional bool
+ * "generateDart2jsHints": optional bool
+ * "generateHints": optional bool
+ * "generateLints": optional bool
* }
*/
-final Matcher isAnalysisGetErrorsParams = new LazyMatcher(() =>
- new MatchesJsonObject("analysis.getErrors params", {"file": isFilePath}));
+final Matcher isAnalysisOptions = new LazyMatcher(
+ () => new MatchesJsonObject("AnalysisOptions", null, optionalFields: {
+ "enableAsync": isBool,
+ "enableDeferredLoading": isBool,
+ "enableEnums": isBool,
+ "enableNullAwareOperators": isBool,
+ "enableSuperMixins": isBool,
+ "generateDart2jsHints": isBool,
+ "generateHints": isBool,
+ "generateLints": isBool
+ }));
/**
- * analysis.getErrors result
+ * AnalysisService
*
- * {
- * "errors": List<AnalysisError>
+ * enum {
+ * FOLDING
+ * HIGHLIGHTS
+ * IMPLEMENTED
+ * INVALIDATE
+ * NAVIGATION
+ * OCCURRENCES
+ * OUTLINE
+ * OVERRIDES
* }
*/
-final Matcher isAnalysisGetErrorsResult = new LazyMatcher(() =>
- new MatchesJsonObject(
- "analysis.getErrors result", {"errors": isListOf(isAnalysisError)}));
+final Matcher isAnalysisService = new MatchesEnum("AnalysisService", [
+ "FOLDING",
+ "HIGHLIGHTS",
+ "IMPLEMENTED",
+ "INVALIDATE",
+ "NAVIGATION",
+ "OCCURRENCES",
+ "OUTLINE",
+ "OVERRIDES"
+]);
/**
- * analysis.getHover params
+ * AnalysisStatus
*
* {
- * "file": FilePath
- * "offset": int
+ * "isAnalyzing": bool
+ * "analysisTarget": optional String
* }
*/
-final Matcher isAnalysisGetHoverParams = new LazyMatcher(() =>
- new MatchesJsonObject(
- "analysis.getHover params", {"file": isFilePath, "offset": isInt}));
+final Matcher isAnalysisStatus = new LazyMatcher(() => new MatchesJsonObject(
+ "AnalysisStatus", {"isAnalyzing": isBool},
+ optionalFields: {"analysisTarget": isString}));
/**
- * analysis.getHover result
+ * ChangeContentOverlay
*
* {
- * "hovers": List<HoverInformation>
+ * "type": "change"
+ * "edits": List<SourceEdit>
* }
*/
-final Matcher isAnalysisGetHoverResult = new LazyMatcher(() =>
- new MatchesJsonObject(
- "analysis.getHover result", {"hovers": isListOf(isHoverInformation)}));
+final Matcher isChangeContentOverlay = new LazyMatcher(() =>
+ new MatchesJsonObject("ChangeContentOverlay",
+ {"type": equals("change"), "edits": isListOf(isSourceEdit)}));
/**
- * analysis.getReachableSources params
+ * CompletionId
*
- * {
- * "file": FilePath
- * }
+ * String
*/
-final Matcher isAnalysisGetReachableSourcesParams = new LazyMatcher(() =>
- new MatchesJsonObject(
- "analysis.getReachableSources params", {"file": isFilePath}));
+final Matcher isCompletionId = isString;
/**
- * analysis.getReachableSources result
+ * CompletionSuggestion
*
* {
- * "sources": Map<String, List<String>>
+ * "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 isAnalysisGetReachableSourcesResult = new LazyMatcher(() =>
- new MatchesJsonObject("analysis.getReachableSources result",
- {"sources": isMapOf(isString, isListOf(isString))}));
-
-/**
- * analysis.getLibraryDependencies params
- */
-final Matcher isAnalysisGetLibraryDependenciesParams = isNull;
+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.getLibraryDependencies result
+ * CompletionSuggestionKind
*
- * {
- * "libraries": List<FilePath>
- * "packageMap": Map<String, Map<String, List<FilePath>>>
- * }
- */
-final Matcher isAnalysisGetLibraryDependenciesResult = new LazyMatcher(
- () => new MatchesJsonObject("analysis.getLibraryDependencies result", {
- "libraries": isListOf(isFilePath),
- "packageMap":
- isMapOf(isString, isMapOf(isString, isListOf(isFilePath)))
- }));
-
-/**
- * analysis.getNavigation params
- *
- * {
- * "file": FilePath
- * "offset": int
- * "length": int
+ * enum {
+ * ARGUMENT_LIST
+ * IMPORT
+ * IDENTIFIER
+ * INVOCATION
+ * KEYWORD
+ * NAMED_ARGUMENT
+ * OPTIONAL_ARGUMENT
+ * PARAMETER
* }
*/
-final Matcher isAnalysisGetNavigationParams = new LazyMatcher(() =>
- new MatchesJsonObject("analysis.getNavigation params",
- {"file": isFilePath, "offset": isInt, "length": isInt}));
+final Matcher isCompletionSuggestionKind =
+ new MatchesEnum("CompletionSuggestionKind", [
+ "ARGUMENT_LIST",
+ "IMPORT",
+ "IDENTIFIER",
+ "INVOCATION",
+ "KEYWORD",
+ "NAMED_ARGUMENT",
+ "OPTIONAL_ARGUMENT",
+ "PARAMETER"
+]);
/**
- * analysis.getNavigation result
+ * ContextData
*
* {
- * "files": List<FilePath>
- * "targets": List<NavigationTarget>
- * "regions": List<NavigationRegion>
+ * "name": String
+ * "explicitFileCount": int
+ * "implicitFileCount": int
+ * "workItemQueueLength": int
+ * "cacheEntryExceptions": List<String>
* }
*/
-final Matcher isAnalysisGetNavigationResult = new LazyMatcher(
- () => new MatchesJsonObject("analysis.getNavigation result", {
- "files": isListOf(isFilePath),
- "targets": isListOf(isNavigationTarget),
- "regions": isListOf(isNavigationRegion)
+final Matcher isContextData =
+ new LazyMatcher(() => new MatchesJsonObject("ContextData", {
+ "name": isString,
+ "explicitFileCount": isInt,
+ "implicitFileCount": isInt,
+ "workItemQueueLength": isInt,
+ "cacheEntryExceptions": isListOf(isString)
}));
/**
- * analysis.reanalyze params
+ * Element
*
* {
- * "roots": optional List<FilePath>
+ * "kind": ElementKind
+ * "name": String
+ * "location": optional Location
+ * "flags": int
+ * "parameters": optional String
+ * "returnType": optional String
+ * "typeParameters": optional String
* }
*/
-final Matcher isAnalysisReanalyzeParams = new LazyMatcher(() =>
- new MatchesJsonObject("analysis.reanalyze params", null,
- optionalFields: {"roots": 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.reanalyze result
+ * ElementKind
+ *
+ * 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 isAnalysisReanalyzeResult = isNull;
+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"
+]);
/**
- * analysis.setAnalysisRoots params
+ * ExecutableFile
*
* {
- * "included": List<FilePath>
- * "excluded": List<FilePath>
- * "packageRoots": optional Map<FilePath, FilePath>
+ * "file": FilePath
+ * "kind": ExecutableKind
* }
*/
-final Matcher isAnalysisSetAnalysisRootsParams = new LazyMatcher(() =>
- new MatchesJsonObject("analysis.setAnalysisRoots params",
- {"included": isListOf(isFilePath), "excluded": isListOf(isFilePath)},
- optionalFields: {"packageRoots": isMapOf(isFilePath, isFilePath)}));
-
-/**
- * analysis.setAnalysisRoots result
- */
-final Matcher isAnalysisSetAnalysisRootsResult = isNull;
+final Matcher isExecutableFile = new LazyMatcher(() => new MatchesJsonObject(
+ "ExecutableFile", {"file": isFilePath, "kind": isExecutableKind}));
/**
- * analysis.setGeneralSubscriptions params
+ * ExecutableKind
*
- * {
- * "subscriptions": List<GeneralAnalysisService>
+ * enum {
+ * CLIENT
+ * EITHER
+ * NOT_EXECUTABLE
+ * SERVER
* }
*/
-final Matcher isAnalysisSetGeneralSubscriptionsParams = new LazyMatcher(() =>
- new MatchesJsonObject("analysis.setGeneralSubscriptions params",
- {"subscriptions": isListOf(isGeneralAnalysisService)}));
+final Matcher isExecutableKind = new MatchesEnum(
+ "ExecutableKind", ["CLIENT", "EITHER", "NOT_EXECUTABLE", "SERVER"]);
/**
- * analysis.setGeneralSubscriptions result
+ * ExecutionContextId
+ *
+ * String
*/
-final Matcher isAnalysisSetGeneralSubscriptionsResult = isNull;
+final Matcher isExecutionContextId = isString;
/**
- * analysis.setPriorityFiles params
+ * ExecutionService
*
- * {
- * "files": List<FilePath>
+ * enum {
+ * LAUNCH_DATA
* }
*/
-final Matcher isAnalysisSetPriorityFilesParams = new LazyMatcher(() =>
- new MatchesJsonObject(
- "analysis.setPriorityFiles params", {"files": isListOf(isFilePath)}));
-
-/**
- * analysis.setPriorityFiles result
- */
-final Matcher isAnalysisSetPriorityFilesResult = isNull;
+final Matcher isExecutionService =
+ new MatchesEnum("ExecutionService", ["LAUNCH_DATA"]);
/**
- * analysis.setSubscriptions params
+ * FileKind
*
- * {
- * "subscriptions": Map<AnalysisService, List<FilePath>>
+ * enum {
+ * LIBRARY
+ * PART
* }
*/
-final Matcher isAnalysisSetSubscriptionsParams = new LazyMatcher(() =>
- new MatchesJsonObject("analysis.setSubscriptions params",
- {"subscriptions": isMapOf(isAnalysisService, isListOf(isFilePath))}));
+final Matcher isFileKind = new MatchesEnum("FileKind", ["LIBRARY", "PART"]);
/**
- * analysis.setSubscriptions result
+ * FilePath
+ *
+ * String
*/
-final Matcher isAnalysisSetSubscriptionsResult = isNull;
+final Matcher isFilePath = isString;
/**
- * analysis.updateContent params
+ * FoldingKind
*
- * {
- * "files": Map<FilePath, AddContentOverlay | ChangeContentOverlay | RemoveContentOverlay>
+ * enum {
+ * COMMENT
+ * CLASS_MEMBER
+ * DIRECTIVES
+ * DOCUMENTATION_COMMENT
+ * TOP_LEVEL_DECLARATION
* }
*/
-final Matcher isAnalysisUpdateContentParams = new LazyMatcher(
- () => new MatchesJsonObject("analysis.updateContent params", {
- "files": isMapOf(
- isFilePath,
- isOneOf([
- isAddContentOverlay,
- isChangeContentOverlay,
- isRemoveContentOverlay
- ]))
- }));
+final Matcher isFoldingKind = new MatchesEnum("FoldingKind", [
+ "COMMENT",
+ "CLASS_MEMBER",
+ "DIRECTIVES",
+ "DOCUMENTATION_COMMENT",
+ "TOP_LEVEL_DECLARATION"
+]);
/**
- * analysis.updateContent result
+ * FoldingRegion
*
* {
+ * "kind": FoldingKind
+ * "offset": int
+ * "length": int
* }
*/
-final Matcher isAnalysisUpdateContentResult = new LazyMatcher(
- () => new MatchesJsonObject("analysis.updateContent result", null));
+final Matcher isFoldingRegion = new LazyMatcher(() => new MatchesJsonObject(
+ "FoldingRegion",
+ {"kind": isFoldingKind, "offset": isInt, "length": isInt}));
/**
- * analysis.updateOptions params
+ * GeneralAnalysisService
*
- * {
- * "options": AnalysisOptions
+ * enum {
+ * ANALYZED_FILES
* }
*/
-final Matcher isAnalysisUpdateOptionsParams = new LazyMatcher(() =>
- new MatchesJsonObject(
- "analysis.updateOptions params", {"options": isAnalysisOptions}));
+final Matcher isGeneralAnalysisService =
+ new MatchesEnum("GeneralAnalysisService", ["ANALYZED_FILES"]);
/**
- * analysis.updateOptions result
- */
-final Matcher isAnalysisUpdateOptionsResult = isNull;
-
-/**
- * analysis.analyzedFiles params
+ * HighlightRegion
*
* {
- * "directories": List<FilePath>
+ * "type": HighlightRegionType
+ * "offset": int
+ * "length": int
* }
*/
-final Matcher isAnalysisAnalyzedFilesParams = new LazyMatcher(() =>
- new MatchesJsonObject("analysis.analyzedFiles params",
- {"directories": isListOf(isFilePath)}));
+final Matcher isHighlightRegion = new LazyMatcher(() => new MatchesJsonObject(
+ "HighlightRegion",
+ {"type": isHighlightRegionType, "offset": isInt, "length": isInt}));
/**
- * analysis.errors params
+ * HighlightRegionType
*
- * {
- * "file": FilePath
- * "errors": List<AnalysisError>
+ * 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 isAnalysisErrorsParams = new LazyMatcher(() =>
- new MatchesJsonObject("analysis.errors params",
- {"file": isFilePath, "errors": isListOf(isAnalysisError)}));
+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"
+]);
/**
- * analysis.flushResults params
+ * HoverInformation
*
* {
- * "files": List<FilePath>
+ * "offset": int
+ * "length": int
+ * "containingLibraryPath": optional String
+ * "containingLibraryName": optional String
+ * "containingClassDescription": optional String
+ * "dartdoc": optional String
+ * "elementDescription": optional String
+ * "elementKind": optional String
+ * "isDeprecated": optional bool
+ * "parameter": optional String
+ * "propagatedType": optional String
+ * "staticType": optional String
* }
*/
-final Matcher isAnalysisFlushResultsParams = new LazyMatcher(() =>
- new MatchesJsonObject(
- "analysis.flushResults params", {"files": isListOf(isFilePath)}));
+final Matcher isHoverInformation =
+ new LazyMatcher(() => new MatchesJsonObject("HoverInformation", {
+ "offset": isInt,
+ "length": isInt
+ }, optionalFields: {
+ "containingLibraryPath": isString,
+ "containingLibraryName": isString,
+ "containingClassDescription": isString,
+ "dartdoc": isString,
+ "elementDescription": isString,
+ "elementKind": isString,
+ "isDeprecated": isBool,
+ "parameter": isString,
+ "propagatedType": isString,
+ "staticType": isString
+ }));
/**
- * analysis.folding params
+ * ImplementedClass
*
* {
- * "file": FilePath
- * "regions": List<FoldingRegion>
+ * "offset": int
+ * "length": int
* }
*/
-final Matcher isAnalysisFoldingParams = new LazyMatcher(() =>
- new MatchesJsonObject("analysis.folding params",
- {"file": isFilePath, "regions": isListOf(isFoldingRegion)}));
+final Matcher isImplementedClass = new LazyMatcher(() => new MatchesJsonObject(
+ "ImplementedClass", {"offset": isInt, "length": isInt}));
/**
- * analysis.highlights params
+ * ImplementedMember
*
* {
- * "file": FilePath
- * "regions": List<HighlightRegion>
+ * "offset": int
+ * "length": int
* }
*/
-final Matcher isAnalysisHighlightsParams = new LazyMatcher(() =>
- new MatchesJsonObject("analysis.highlights params",
- {"file": isFilePath, "regions": isListOf(isHighlightRegion)}));
+final Matcher isImplementedMember = new LazyMatcher(() => new MatchesJsonObject(
+ "ImplementedMember", {"offset": isInt, "length": isInt}));
/**
- * analysis.implemented params
+ * LinkedEditGroup
*
* {
- * "file": FilePath
- * "classes": List<ImplementedClass>
- * "members": List<ImplementedMember>
+ * "positions": List<Position>
+ * "length": int
+ * "suggestions": List<LinkedEditSuggestion>
* }
*/
-final Matcher isAnalysisImplementedParams =
- new LazyMatcher(() => new MatchesJsonObject("analysis.implemented params", {
- "file": isFilePath,
- "classes": isListOf(isImplementedClass),
- "members": isListOf(isImplementedMember)
+final Matcher isLinkedEditGroup =
+ new LazyMatcher(() => new MatchesJsonObject("LinkedEditGroup", {
+ "positions": isListOf(isPosition),
+ "length": isInt,
+ "suggestions": isListOf(isLinkedEditSuggestion)
}));
/**
- * analysis.invalidate params
+ * LinkedEditSuggestion
*
* {
- * "file": FilePath
- * "offset": int
- * "length": int
- * "delta": int
+ * "value": String
+ * "kind": LinkedEditSuggestionKind
* }
*/
-final Matcher isAnalysisInvalidateParams = new LazyMatcher(() =>
- new MatchesJsonObject("analysis.invalidate params", {
- "file": isFilePath,
- "offset": isInt,
- "length": isInt,
- "delta": isInt
- }));
+final Matcher isLinkedEditSuggestion = new LazyMatcher(() =>
+ new MatchesJsonObject("LinkedEditSuggestion",
+ {"value": isString, "kind": isLinkedEditSuggestionKind}));
/**
- * analysis.navigation params
+ * LinkedEditSuggestionKind
+ *
+ * enum {
+ * METHOD
+ * PARAMETER
+ * TYPE
+ * VARIABLE
+ * }
+ */
+final Matcher isLinkedEditSuggestionKind = new MatchesEnum(
+ "LinkedEditSuggestionKind", ["METHOD", "PARAMETER", "TYPE", "VARIABLE"]);
+
+/**
+ * Location
*
* {
* "file": FilePath
- * "regions": List<NavigationRegion>
- * "targets": List<NavigationTarget>
- * "files": List<FilePath>
+ * "offset": int
+ * "length": int
+ * "startLine": int
+ * "startColumn": int
* }
*/
-final Matcher isAnalysisNavigationParams =
- new LazyMatcher(() => new MatchesJsonObject("analysis.navigation params", {
+final Matcher isLocation =
+ new LazyMatcher(() => new MatchesJsonObject("Location", {
"file": isFilePath,
- "regions": isListOf(isNavigationRegion),
- "targets": isListOf(isNavigationTarget),
- "files": isListOf(isFilePath)
+ "offset": isInt,
+ "length": isInt,
+ "startLine": isInt,
+ "startColumn": isInt
}));
/**
- * analysis.occurrences params
+ * NavigationRegion
*
* {
- * "file": FilePath
- * "occurrences": List<Occurrences>
+ * "offset": int
+ * "length": int
+ * "targets": List<int>
* }
*/
-final Matcher isAnalysisOccurrencesParams = new LazyMatcher(() =>
- new MatchesJsonObject("analysis.occurrences params",
- {"file": isFilePath, "occurrences": isListOf(isOccurrences)}));
+final Matcher isNavigationRegion = new LazyMatcher(() => new MatchesJsonObject(
+ "NavigationRegion",
+ {"offset": isInt, "length": isInt, "targets": isListOf(isInt)}));
/**
- * analysis.outline params
+ * NavigationTarget
*
* {
- * "file": FilePath
- * "kind": FileKind
- * "libraryName": optional String
- * "outline": Outline
+ * "kind": ElementKind
+ * "fileIndex": int
+ * "offset": int
+ * "length": int
+ * "startLine": int
+ * "startColumn": int
* }
*/
-final Matcher isAnalysisOutlineParams = new LazyMatcher(() =>
- new MatchesJsonObject("analysis.outline params",
- {"file": isFilePath, "kind": isFileKind, "outline": isOutline},
- optionalFields: {"libraryName": isString}));
+final Matcher isNavigationTarget =
+ new LazyMatcher(() => new MatchesJsonObject("NavigationTarget", {
+ "kind": isElementKind,
+ "fileIndex": isInt,
+ "offset": isInt,
+ "length": isInt,
+ "startLine": isInt,
+ "startColumn": isInt
+ }));
/**
- * analysis.overrides params
+ * Occurrences
*
* {
- * "file": FilePath
- * "overrides": List<Override>
+ * "element": Element
+ * "offsets": List<int>
+ * "length": int
* }
*/
-final Matcher isAnalysisOverridesParams = new LazyMatcher(() =>
- new MatchesJsonObject("analysis.overrides params",
- {"file": isFilePath, "overrides": isListOf(isOverride)}));
+final Matcher isOccurrences = new LazyMatcher(() => new MatchesJsonObject(
+ "Occurrences",
+ {"element": isElement, "offsets": isListOf(isInt), "length": isInt}));
/**
- * completion.getSuggestions params
+ * Outline
*
* {
- * "file": FilePath
+ * "element": Element
* "offset": int
+ * "length": int
+ * "children": optional List<Outline>
* }
*/
-final Matcher isCompletionGetSuggestionsParams = new LazyMatcher(() =>
- new MatchesJsonObject("completion.getSuggestions params",
- {"file": isFilePath, "offset": isInt}));
+final Matcher isOutline = new LazyMatcher(() => new MatchesJsonObject(
+ "Outline", {"element": isElement, "offset": isInt, "length": isInt},
+ optionalFields: {"children": isListOf(isOutline)}));
/**
- * completion.getSuggestions result
+ * OverriddenMember
*
* {
- * "id": CompletionId
+ * "element": Element
+ * "className": String
* }
*/
-final Matcher isCompletionGetSuggestionsResult = new LazyMatcher(() =>
- new MatchesJsonObject(
- "completion.getSuggestions result", {"id": isCompletionId}));
+final Matcher isOverriddenMember = new LazyMatcher(() => new MatchesJsonObject(
+ "OverriddenMember", {"element": isElement, "className": isString}));
/**
- * completion.results params
+ * Override
*
* {
- * "id": CompletionId
- * "replacementOffset": int
- * "replacementLength": int
- * "results": List<CompletionSuggestion>
- * "isLast": bool
+ * "offset": int
+ * "length": int
+ * "superclassMember": optional OverriddenMember
+ * "interfaceMembers": optional List<OverriddenMember>
* }
*/
-final Matcher isCompletionResultsParams =
- new LazyMatcher(() => new MatchesJsonObject("completion.results params", {
- "id": isCompletionId,
- "replacementOffset": isInt,
- "replacementLength": isInt,
- "results": isListOf(isCompletionSuggestion),
- "isLast": isBool
+final Matcher isOverride =
+ new LazyMatcher(() => new MatchesJsonObject("Override", {
+ "offset": isInt,
+ "length": isInt
+ }, optionalFields: {
+ "superclassMember": isOverriddenMember,
+ "interfaceMembers": isListOf(isOverriddenMember)
}));
/**
- * search.findElementReferences params
+ * Position
*
* {
* "file": FilePath
* "offset": int
- * "includePotential": bool
* }
*/
-final Matcher isSearchFindElementReferencesParams = new LazyMatcher(() =>
- new MatchesJsonObject("search.findElementReferences params",
- {"file": isFilePath, "offset": isInt, "includePotential": isBool}));
+final Matcher isPosition = new LazyMatcher(() =>
+ new MatchesJsonObject("Position", {"file": isFilePath, "offset": isInt}));
/**
- * search.findElementReferences result
+ * PubStatus
*
* {
- * "id": optional SearchId
- * "element": optional Element
+ * "isListingPackageDirs": bool
* }
*/
-final Matcher isSearchFindElementReferencesResult = new LazyMatcher(() =>
- new MatchesJsonObject("search.findElementReferences result", null,
- optionalFields: {"id": isSearchId, "element": isElement}));
+final Matcher isPubStatus = new LazyMatcher(
+ () => new MatchesJsonObject("PubStatus", {"isListingPackageDirs": isBool}));
/**
- * search.findMemberDeclarations params
+ * RefactoringFeedback
*
* {
- * "name": String
* }
*/
-final Matcher isSearchFindMemberDeclarationsParams = new LazyMatcher(() =>
- new MatchesJsonObject(
- "search.findMemberDeclarations params", {"name": isString}));
+final Matcher isRefactoringFeedback =
+ new LazyMatcher(() => new MatchesJsonObject("RefactoringFeedback", null));
/**
- * search.findMemberDeclarations result
+ * RefactoringKind
*
- * {
- * "id": SearchId
+ * enum {
+ * 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 isSearchFindMemberDeclarationsResult = new LazyMatcher(() =>
- new MatchesJsonObject(
- "search.findMemberDeclarations result", {"id": isSearchId}));
+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"
+]);
/**
- * search.findMemberReferences params
+ * RefactoringMethodParameter
*
* {
+ * "id": optional String
+ * "kind": RefactoringMethodParameterKind
+ * "type": String
* "name": String
+ * "parameters": optional String
* }
*/
-final Matcher isSearchFindMemberReferencesParams = new LazyMatcher(() =>
- new MatchesJsonObject(
- "search.findMemberReferences params", {"name": isString}));
+final Matcher isRefactoringMethodParameter = new LazyMatcher(() =>
+ new MatchesJsonObject("RefactoringMethodParameter", {
+ "kind": isRefactoringMethodParameterKind,
+ "type": isString,
+ "name": isString
+ }, optionalFields: {
+ "id": isString,
+ "parameters": isString
+ }));
/**
- * search.findMemberReferences result
+ * RefactoringMethodParameterKind
*
- * {
- * "id": SearchId
+ * enum {
+ * REQUIRED
+ * POSITIONAL
+ * NAMED
* }
*/
-final Matcher isSearchFindMemberReferencesResult = new LazyMatcher(() =>
- new MatchesJsonObject(
- "search.findMemberReferences result", {"id": isSearchId}));
+final Matcher isRefactoringMethodParameterKind = new MatchesEnum(
+ "RefactoringMethodParameterKind", ["REQUIRED", "POSITIONAL", "NAMED"]);
/**
- * search.findTopLevelDeclarations params
+ * RefactoringOptions
*
* {
- * "pattern": String
* }
*/
-final Matcher isSearchFindTopLevelDeclarationsParams = new LazyMatcher(() =>
- new MatchesJsonObject(
- "search.findTopLevelDeclarations params", {"pattern": isString}));
+final Matcher isRefactoringOptions =
+ new LazyMatcher(() => new MatchesJsonObject("RefactoringOptions", null));
/**
- * search.findTopLevelDeclarations result
+ * RefactoringProblem
*
* {
- * "id": SearchId
+ * "severity": RefactoringProblemSeverity
+ * "message": String
+ * "location": optional Location
* }
*/
-final Matcher isSearchFindTopLevelDeclarationsResult = new LazyMatcher(() =>
- new MatchesJsonObject(
- "search.findTopLevelDeclarations result", {"id": isSearchId}));
+final Matcher isRefactoringProblem = new LazyMatcher(() =>
+ new MatchesJsonObject("RefactoringProblem",
+ {"severity": isRefactoringProblemSeverity, "message": isString},
+ optionalFields: {"location": isLocation}));
/**
- * search.getTypeHierarchy params
+ * RefactoringProblemSeverity
*
- * {
- * "file": FilePath
- * "offset": int
- * "superOnly": optional bool
- * }
- */
-final Matcher isSearchGetTypeHierarchyParams = new LazyMatcher(() =>
- new MatchesJsonObject(
- "search.getTypeHierarchy params", {"file": isFilePath, "offset": isInt},
- optionalFields: {"superOnly": isBool}));
+ * enum {
+ * INFO
+ * WARNING
+ * ERROR
+ * FATAL
+ * }
+ */
+final Matcher isRefactoringProblemSeverity = new MatchesEnum(
+ "RefactoringProblemSeverity", ["INFO", "WARNING", "ERROR", "FATAL"]);
/**
- * search.getTypeHierarchy result
+ * RemoveContentOverlay
*
* {
- * "hierarchyItems": optional List<TypeHierarchyItem>
+ * "type": "remove"
* }
*/
-final Matcher isSearchGetTypeHierarchyResult = new LazyMatcher(() =>
- new MatchesJsonObject("search.getTypeHierarchy result", null,
- optionalFields: {"hierarchyItems": isListOf(isTypeHierarchyItem)}));
+final Matcher isRemoveContentOverlay = new LazyMatcher(() =>
+ new MatchesJsonObject("RemoveContentOverlay", {"type": equals("remove")}));
/**
- * search.results params
+ * RequestError
*
* {
- * "id": SearchId
- * "results": List<SearchResult>
- * "isLast": bool
+ * "code": RequestErrorCode
+ * "message": String
+ * "stackTrace": optional String
* }
*/
-final Matcher isSearchResultsParams = new LazyMatcher(() =>
- new MatchesJsonObject("search.results params", {
- "id": isSearchId,
- "results": isListOf(isSearchResult),
- "isLast": isBool
- }));
+final Matcher isRequestError = new LazyMatcher(() => new MatchesJsonObject(
+ "RequestError", {"code": isRequestErrorCode, "message": isString},
+ optionalFields: {"stackTrace": isString}));
/**
- * edit.format params
+ * RequestErrorCode
*
- * {
- * "file": FilePath
- * "selectionOffset": int
- * "selectionLength": int
- * "lineLength": optional int
+ * enum {
+ * CONTENT_MODIFIED
+ * DEBUG_PORT_COULD_NOT_BE_OPENED
+ * FILE_NOT_ANALYZED
+ * FORMAT_INVALID_FILE
+ * FORMAT_WITH_ERRORS
+ * GET_ERRORS_INVALID_FILE
+ * GET_NAVIGATION_INVALID_FILE
+ * GET_REACHABLE_SOURCES_INVALID_FILE
+ * INVALID_ANALYSIS_ROOT
+ * INVALID_EXECUTION_CONTEXT
+ * INVALID_FILE_PATH_FORMAT
+ * INVALID_OVERLAY_CHANGE
+ * INVALID_PARAMETER
+ * INVALID_REQUEST
+ * ORGANIZE_DIRECTIVES_ERROR
+ * REFACTORING_REQUEST_CANCELLED
+ * SERVER_ALREADY_STARTED
+ * SERVER_ERROR
+ * SORT_MEMBERS_INVALID_FILE
+ * SORT_MEMBERS_PARSE_ERRORS
+ * UNANALYZED_PRIORITY_FILES
+ * UNKNOWN_REQUEST
+ * UNKNOWN_SOURCE
+ * UNSUPPORTED_FEATURE
* }
*/
-final Matcher isEditFormatParams = new LazyMatcher(() => new MatchesJsonObject(
- "edit.format params",
- {"file": isFilePath, "selectionOffset": isInt, "selectionLength": isInt},
- optionalFields: {"lineLength": isInt}));
+final Matcher isRequestErrorCode = new MatchesEnum("RequestErrorCode", [
+ "CONTENT_MODIFIED",
+ "DEBUG_PORT_COULD_NOT_BE_OPENED",
+ "FILE_NOT_ANALYZED",
+ "FORMAT_INVALID_FILE",
+ "FORMAT_WITH_ERRORS",
+ "GET_ERRORS_INVALID_FILE",
+ "GET_NAVIGATION_INVALID_FILE",
+ "GET_REACHABLE_SOURCES_INVALID_FILE",
+ "INVALID_ANALYSIS_ROOT",
+ "INVALID_EXECUTION_CONTEXT",
+ "INVALID_FILE_PATH_FORMAT",
+ "INVALID_OVERLAY_CHANGE",
+ "INVALID_PARAMETER",
+ "INVALID_REQUEST",
+ "ORGANIZE_DIRECTIVES_ERROR",
+ "REFACTORING_REQUEST_CANCELLED",
+ "SERVER_ALREADY_STARTED",
+ "SERVER_ERROR",
+ "SORT_MEMBERS_INVALID_FILE",
+ "SORT_MEMBERS_PARSE_ERRORS",
+ "UNANALYZED_PRIORITY_FILES",
+ "UNKNOWN_REQUEST",
+ "UNKNOWN_SOURCE",
+ "UNSUPPORTED_FEATURE"
+]);
/**
- * edit.format result
+ * SearchId
*
- * {
- * "edits": List<SourceEdit>
- * "selectionOffset": int
- * "selectionLength": int
- * }
+ * String
*/
-final Matcher isEditFormatResult =
- new LazyMatcher(() => new MatchesJsonObject("edit.format result", {
- "edits": isListOf(isSourceEdit),
- "selectionOffset": isInt,
- "selectionLength": isInt
- }));
+final Matcher isSearchId = isString;
/**
- * edit.getAssists params
+ * SearchResult
*
* {
- * "file": FilePath
- * "offset": int
- * "length": int
+ * "location": Location
+ * "kind": SearchResultKind
+ * "isPotential": bool
+ * "path": List<Element>
* }
*/
-final Matcher isEditGetAssistsParams = new LazyMatcher(() =>
- new MatchesJsonObject("edit.getAssists params",
- {"file": isFilePath, "offset": isInt, "length": isInt}));
+final Matcher isSearchResult =
+ new LazyMatcher(() => new MatchesJsonObject("SearchResult", {
+ "location": isLocation,
+ "kind": isSearchResultKind,
+ "isPotential": isBool,
+ "path": isListOf(isElement)
+ }));
/**
- * edit.getAssists result
+ * SearchResultKind
*
- * {
- * "assists": List<SourceChange>
+ * enum {
+ * DECLARATION
+ * INVOCATION
+ * READ
+ * READ_WRITE
+ * REFERENCE
+ * UNKNOWN
+ * WRITE
* }
*/
-final Matcher isEditGetAssistsResult = new LazyMatcher(() =>
- new MatchesJsonObject(
- "edit.getAssists result", {"assists": isListOf(isSourceChange)}));
+final Matcher isSearchResultKind = new MatchesEnum("SearchResultKind", [
+ "DECLARATION",
+ "INVOCATION",
+ "READ",
+ "READ_WRITE",
+ "REFERENCE",
+ "UNKNOWN",
+ "WRITE"
+]);
/**
- * edit.getAvailableRefactorings params
+ * ServerService
*
- * {
- * "file": FilePath
- * "offset": int
- * "length": int
+ * enum {
+ * STATUS
* }
*/
-final Matcher isEditGetAvailableRefactoringsParams = new LazyMatcher(() =>
- new MatchesJsonObject("edit.getAvailableRefactorings params",
- {"file": isFilePath, "offset": isInt, "length": isInt}));
+final Matcher isServerService = new MatchesEnum("ServerService", ["STATUS"]);
/**
- * edit.getAvailableRefactorings result
+ * SourceChange
*
* {
- * "kinds": List<RefactoringKind>
+ * "message": String
+ * "edits": List<SourceFileEdit>
+ * "linkedEditGroups": List<LinkedEditGroup>
+ * "selection": optional Position
* }
*/
-final Matcher isEditGetAvailableRefactoringsResult = new LazyMatcher(() =>
- new MatchesJsonObject("edit.getAvailableRefactorings result",
- {"kinds": isListOf(isRefactoringKind)}));
+final Matcher isSourceChange =
+ new LazyMatcher(() => new MatchesJsonObject("SourceChange", {
+ "message": isString,
+ "edits": isListOf(isSourceFileEdit),
+ "linkedEditGroups": isListOf(isLinkedEditGroup)
+ }, optionalFields: {
+ "selection": isPosition
+ }));
/**
- * edit.getFixes params
+ * SourceEdit
*
* {
- * "file": FilePath
* "offset": int
+ * "length": int
+ * "replacement": String
+ * "id": optional String
* }
*/
-final Matcher isEditGetFixesParams = new LazyMatcher(() =>
- new MatchesJsonObject(
- "edit.getFixes params", {"file": isFilePath, "offset": isInt}));
+final Matcher isSourceEdit = new LazyMatcher(() => new MatchesJsonObject(
+ "SourceEdit", {"offset": isInt, "length": isInt, "replacement": isString},
+ optionalFields: {"id": isString}));
/**
- * edit.getFixes result
+ * SourceFileEdit
*
* {
- * "fixes": List<AnalysisErrorFixes>
+ * "file": FilePath
+ * "fileStamp": long
+ * "edits": List<SourceEdit>
* }
*/
-final Matcher isEditGetFixesResult = new LazyMatcher(() =>
- new MatchesJsonObject(
- "edit.getFixes result", {"fixes": isListOf(isAnalysisErrorFixes)}));
+final Matcher isSourceFileEdit = new LazyMatcher(() => new MatchesJsonObject(
+ "SourceFileEdit",
+ {"file": isFilePath, "fileStamp": isInt, "edits": isListOf(isSourceEdit)}));
/**
- * edit.getRefactoring params
+ * TypeHierarchyItem
*
* {
- * "kind": RefactoringKind
- * "file": FilePath
- * "offset": int
- * "length": int
- * "validateOnly": bool
- * "options": optional RefactoringOptions
+ * "classElement": Element
+ * "displayName": optional String
+ * "memberElement": optional Element
+ * "superclass": optional int
+ * "interfaces": List<int>
+ * "mixins": List<int>
+ * "subclasses": List<int>
* }
*/
-final Matcher isEditGetRefactoringParams =
- new LazyMatcher(() => new MatchesJsonObject("edit.getRefactoring params", {
- "kind": isRefactoringKind,
- "file": isFilePath,
- "offset": isInt,
- "length": isInt,
- "validateOnly": isBool
+final Matcher isTypeHierarchyItem =
+ new LazyMatcher(() => new MatchesJsonObject("TypeHierarchyItem", {
+ "classElement": isElement,
+ "interfaces": isListOf(isInt),
+ "mixins": isListOf(isInt),
+ "subclasses": isListOf(isInt)
}, optionalFields: {
- "options": isRefactoringOptions
+ "displayName": isString,
+ "memberElement": isElement,
+ "superclass": isInt
}));
/**
- * edit.getRefactoring result
+ * analysis.analyzedFiles params
*
* {
- * "initialProblems": List<RefactoringProblem>
- * "optionsProblems": List<RefactoringProblem>
- * "finalProblems": List<RefactoringProblem>
- * "feedback": optional RefactoringFeedback
- * "change": optional SourceChange
- * "potentialEdits": optional List<String>
+ * "directories": List<FilePath>
* }
*/
-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 isAnalysisAnalyzedFilesParams = new LazyMatcher(() =>
+ new MatchesJsonObject("analysis.analyzedFiles params",
+ {"directories": isListOf(isFilePath)}));
/**
- * edit.getStatementCompletion params
+ * analysis.errors params
*
* {
* "file": FilePath
- * "offset": int
+ * "errors": List<AnalysisError>
* }
*/
-final Matcher isEditGetStatementCompletionParams = new LazyMatcher(() =>
- new MatchesJsonObject("edit.getStatementCompletion params",
- {"file": isFilePath, "offset": isInt}));
+final Matcher isAnalysisErrorsParams = new LazyMatcher(() =>
+ new MatchesJsonObject("analysis.errors params",
+ {"file": isFilePath, "errors": isListOf(isAnalysisError)}));
/**
- * edit.getStatementCompletion result
+ * analysis.flushResults params
*
* {
- * "change": SourceChange
- * "whitespaceOnly": bool
+ * "files": List<FilePath>
* }
*/
-final Matcher isEditGetStatementCompletionResult = new LazyMatcher(() =>
- new MatchesJsonObject("edit.getStatementCompletion result",
- {"change": isSourceChange, "whitespaceOnly": isBool}));
+final Matcher isAnalysisFlushResultsParams = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "analysis.flushResults params", {"files": isListOf(isFilePath)}));
/**
- * edit.sortMembers params
+ * analysis.folding params
*
* {
* "file": FilePath
+ * "regions": List<FoldingRegion>
* }
*/
-final Matcher isEditSortMembersParams = new LazyMatcher(() =>
- new MatchesJsonObject("edit.sortMembers params", {"file": isFilePath}));
+final Matcher isAnalysisFoldingParams = new LazyMatcher(() =>
+ new MatchesJsonObject("analysis.folding params",
+ {"file": isFilePath, "regions": isListOf(isFoldingRegion)}));
/**
- * edit.sortMembers result
+ * analysis.getErrors params
*
* {
- * "edit": SourceFileEdit
+ * "file": FilePath
* }
*/
-final Matcher isEditSortMembersResult = new LazyMatcher(() =>
- new MatchesJsonObject(
- "edit.sortMembers result", {"edit": isSourceFileEdit}));
+final Matcher isAnalysisGetErrorsParams = new LazyMatcher(() =>
+ new MatchesJsonObject("analysis.getErrors params", {"file": isFilePath}));
/**
- * edit.organizeDirectives params
+ * analysis.getErrors result
*
* {
- * "file": FilePath
+ * "errors": List<AnalysisError>
* }
*/
-final Matcher isEditOrganizeDirectivesParams = new LazyMatcher(() =>
+final Matcher isAnalysisGetErrorsResult = new LazyMatcher(() =>
new MatchesJsonObject(
- "edit.organizeDirectives params", {"file": isFilePath}));
+ "analysis.getErrors result", {"errors": isListOf(isAnalysisError)}));
/**
- * edit.organizeDirectives result
+ * analysis.getHover params
*
* {
- * "edit": SourceFileEdit
+ * "file": FilePath
+ * "offset": int
* }
*/
-final Matcher isEditOrganizeDirectivesResult = new LazyMatcher(() =>
+final Matcher isAnalysisGetHoverParams = new LazyMatcher(() =>
new MatchesJsonObject(
- "edit.organizeDirectives result", {"edit": isSourceFileEdit}));
+ "analysis.getHover params", {"file": isFilePath, "offset": isInt}));
/**
- * execution.createContext params
+ * analysis.getHover result
*
* {
- * "contextRoot": FilePath
+ * "hovers": List<HoverInformation>
* }
*/
-final Matcher isExecutionCreateContextParams = new LazyMatcher(() =>
+final Matcher isAnalysisGetHoverResult = new LazyMatcher(() =>
new MatchesJsonObject(
- "execution.createContext params", {"contextRoot": isFilePath}));
+ "analysis.getHover result", {"hovers": isListOf(isHoverInformation)}));
/**
- * execution.createContext result
+ * analysis.getLibraryDependencies params
+ */
+final Matcher isAnalysisGetLibraryDependenciesParams = isNull;
+
+/**
+ * analysis.getLibraryDependencies result
*
* {
- * "id": ExecutionContextId
+ * "libraries": List<FilePath>
+ * "packageMap": Map<String, Map<String, List<FilePath>>>
* }
*/
-final Matcher isExecutionCreateContextResult = new LazyMatcher(() =>
- new MatchesJsonObject(
- "execution.createContext result", {"id": isExecutionContextId}));
+final Matcher isAnalysisGetLibraryDependenciesResult = new LazyMatcher(
+ () => new MatchesJsonObject("analysis.getLibraryDependencies result", {
+ "libraries": isListOf(isFilePath),
+ "packageMap":
+ isMapOf(isString, isMapOf(isString, isListOf(isFilePath)))
+ }));
/**
- * execution.deleteContext params
+ * analysis.getNavigation params
*
* {
- * "id": ExecutionContextId
+ * "file": FilePath
+ * "offset": int
+ * "length": int
* }
*/
-final Matcher isExecutionDeleteContextParams = new LazyMatcher(() =>
- new MatchesJsonObject(
- "execution.deleteContext params", {"id": isExecutionContextId}));
+final Matcher isAnalysisGetNavigationParams = new LazyMatcher(() =>
+ new MatchesJsonObject("analysis.getNavigation params",
+ {"file": isFilePath, "offset": isInt, "length": isInt}));
/**
- * execution.deleteContext result
+ * analysis.getNavigation result
+ *
+ * {
+ * "files": List<FilePath>
+ * "targets": List<NavigationTarget>
+ * "regions": List<NavigationRegion>
+ * }
*/
-final Matcher isExecutionDeleteContextResult = isNull;
+final Matcher isAnalysisGetNavigationResult = new LazyMatcher(
+ () => new MatchesJsonObject("analysis.getNavigation result", {
+ "files": isListOf(isFilePath),
+ "targets": isListOf(isNavigationTarget),
+ "regions": isListOf(isNavigationRegion)
+ }));
/**
- * execution.mapUri params
+ * analysis.getReachableSources params
*
* {
- * "id": ExecutionContextId
- * "file": optional FilePath
- * "uri": optional String
+ * "file": FilePath
* }
*/
-final Matcher isExecutionMapUriParams = new LazyMatcher(() =>
+final Matcher isAnalysisGetReachableSourcesParams = new LazyMatcher(() =>
new MatchesJsonObject(
- "execution.mapUri params", {"id": isExecutionContextId},
- optionalFields: {"file": isFilePath, "uri": isString}));
+ "analysis.getReachableSources params", {"file": isFilePath}));
/**
- * execution.mapUri result
+ * analysis.getReachableSources result
*
* {
- * "file": optional FilePath
- * "uri": optional String
+ * "sources": Map<String, List<String>>
* }
*/
-final Matcher isExecutionMapUriResult = new LazyMatcher(() =>
- new MatchesJsonObject("execution.mapUri result", null,
- optionalFields: {"file": isFilePath, "uri": isString}));
+final Matcher isAnalysisGetReachableSourcesResult = new LazyMatcher(() =>
+ new MatchesJsonObject("analysis.getReachableSources result",
+ {"sources": isMapOf(isString, isListOf(isString))}));
/**
- * execution.setSubscriptions params
+ * analysis.highlights params
*
* {
- * "subscriptions": List<ExecutionService>
+ * "file": FilePath
+ * "regions": List<HighlightRegion>
* }
*/
-final Matcher isExecutionSetSubscriptionsParams = new LazyMatcher(() =>
- new MatchesJsonObject("execution.setSubscriptions params",
- {"subscriptions": isListOf(isExecutionService)}));
+final Matcher isAnalysisHighlightsParams = new LazyMatcher(() =>
+ new MatchesJsonObject("analysis.highlights params",
+ {"file": isFilePath, "regions": isListOf(isHighlightRegion)}));
/**
- * execution.setSubscriptions result
+ * analysis.implemented params
+ *
+ * {
+ * "file": FilePath
+ * "classes": List<ImplementedClass>
+ * "members": List<ImplementedMember>
+ * }
*/
-final Matcher isExecutionSetSubscriptionsResult = isNull;
+final Matcher isAnalysisImplementedParams =
+ new LazyMatcher(() => new MatchesJsonObject("analysis.implemented params", {
+ "file": isFilePath,
+ "classes": isListOf(isImplementedClass),
+ "members": isListOf(isImplementedMember)
+ }));
/**
- * execution.launchData params
+ * analysis.invalidate params
*
* {
* "file": FilePath
- * "kind": optional ExecutableKind
- * "referencedFiles": optional List<FilePath>
+ * "offset": int
+ * "length": int
+ * "delta": int
* }
*/
-final Matcher isExecutionLaunchDataParams = new LazyMatcher(() =>
- new MatchesJsonObject("execution.launchData params", {
- "file": isFilePath
- }, optionalFields: {
- "kind": isExecutableKind,
- "referencedFiles": isListOf(isFilePath)
+final Matcher isAnalysisInvalidateParams = new LazyMatcher(() =>
+ new MatchesJsonObject("analysis.invalidate params", {
+ "file": isFilePath,
+ "offset": isInt,
+ "length": isInt,
+ "delta": isInt
}));
/**
- * diagnostic.getDiagnostics params
+ * analysis.navigation params
+ *
+ * {
+ * "file": FilePath
+ * "regions": List<NavigationRegion>
+ * "targets": List<NavigationTarget>
+ * "files": List<FilePath>
+ * }
*/
-final Matcher isDiagnosticGetDiagnosticsParams = isNull;
+final Matcher isAnalysisNavigationParams =
+ new LazyMatcher(() => new MatchesJsonObject("analysis.navigation params", {
+ "file": isFilePath,
+ "regions": isListOf(isNavigationRegion),
+ "targets": isListOf(isNavigationTarget),
+ "files": isListOf(isFilePath)
+ }));
/**
- * diagnostic.getDiagnostics result
+ * analysis.occurrences params
*
* {
- * "contexts": List<ContextData>
+ * "file": FilePath
+ * "occurrences": List<Occurrences>
* }
*/
-final Matcher isDiagnosticGetDiagnosticsResult = new LazyMatcher(() =>
- new MatchesJsonObject("diagnostic.getDiagnostics result",
- {"contexts": isListOf(isContextData)}));
+final Matcher isAnalysisOccurrencesParams = new LazyMatcher(() =>
+ new MatchesJsonObject("analysis.occurrences params",
+ {"file": isFilePath, "occurrences": isListOf(isOccurrences)}));
/**
- * diagnostic.getServerPort params
+ * analysis.outline params
+ *
+ * {
+ * "file": FilePath
+ * "kind": FileKind
+ * "libraryName": optional String
+ * "outline": Outline
+ * }
*/
-final Matcher isDiagnosticGetServerPortParams = isNull;
+final Matcher isAnalysisOutlineParams = new LazyMatcher(() =>
+ new MatchesJsonObject("analysis.outline params",
+ {"file": isFilePath, "kind": isFileKind, "outline": isOutline},
+ optionalFields: {"libraryName": isString}));
/**
- * diagnostic.getServerPort result
+ * analysis.overrides params
*
* {
- * "port": int
+ * "file": FilePath
+ * "overrides": List<Override>
* }
*/
-final Matcher isDiagnosticGetServerPortResult = new LazyMatcher(() =>
- new MatchesJsonObject("diagnostic.getServerPort result", {"port": isInt}));
+final Matcher isAnalysisOverridesParams = new LazyMatcher(() =>
+ new MatchesJsonObject("analysis.overrides params",
+ {"file": isFilePath, "overrides": isListOf(isOverride)}));
/**
- * AddContentOverlay
+ * analysis.reanalyze params
*
* {
- * "type": "add"
- * "content": String
+ * "roots": optional List<FilePath>
* }
*/
-final Matcher isAddContentOverlay = new LazyMatcher(() => new MatchesJsonObject(
- "AddContentOverlay", {"type": equals("add"), "content": isString}));
+final Matcher isAnalysisReanalyzeParams = new LazyMatcher(() =>
+ new MatchesJsonObject("analysis.reanalyze params", null,
+ optionalFields: {"roots": isListOf(isFilePath)}));
/**
- * AnalysisError
+ * analysis.reanalyze result
+ */
+final Matcher isAnalysisReanalyzeResult = isNull;
+
+/**
+ * analysis.setAnalysisRoots params
*
* {
- * "severity": AnalysisErrorSeverity
- * "type": AnalysisErrorType
- * "location": Location
- * "message": String
- * "correction": optional String
- * "code": String
- * "hasFix": optional bool
+ * "included": List<FilePath>
+ * "excluded": List<FilePath>
+ * "packageRoots": optional Map<FilePath, FilePath>
* }
*/
-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 isAnalysisSetAnalysisRootsParams = new LazyMatcher(() =>
+ new MatchesJsonObject("analysis.setAnalysisRoots params",
+ {"included": isListOf(isFilePath), "excluded": isListOf(isFilePath)},
+ optionalFields: {"packageRoots": isMapOf(isFilePath, isFilePath)}));
/**
- * AnalysisErrorFixes
- *
- * {
- * "error": AnalysisError
- * "fixes": List<SourceChange>
- * }
+ * analysis.setAnalysisRoots result
*/
-final Matcher isAnalysisErrorFixes = new LazyMatcher(() =>
- new MatchesJsonObject("AnalysisErrorFixes",
- {"error": isAnalysisError, "fixes": isListOf(isSourceChange)}));
+final Matcher isAnalysisSetAnalysisRootsResult = isNull;
/**
- * AnalysisErrorSeverity
+ * analysis.setGeneralSubscriptions params
*
- * enum {
- * INFO
- * WARNING
- * ERROR
+ * {
+ * "subscriptions": List<GeneralAnalysisService>
* }
*/
-final Matcher isAnalysisErrorSeverity =
- new MatchesEnum("AnalysisErrorSeverity", ["INFO", "WARNING", "ERROR"]);
+final Matcher isAnalysisSetGeneralSubscriptionsParams = new LazyMatcher(() =>
+ new MatchesJsonObject("analysis.setGeneralSubscriptions params",
+ {"subscriptions": isListOf(isGeneralAnalysisService)}));
/**
- * AnalysisErrorType
- *
- * enum {
- * CHECKED_MODE_COMPILE_TIME_ERROR
- * COMPILE_TIME_ERROR
- * HINT
- * LINT
- * STATIC_TYPE_WARNING
- * STATIC_WARNING
- * SYNTACTIC_ERROR
- * TODO
- * }
+ * analysis.setGeneralSubscriptions result
*/
-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 isAnalysisSetGeneralSubscriptionsResult = isNull;
/**
- * AnalysisOptions
+ * analysis.setPriorityFiles params
*
* {
- * "enableAsync": optional bool
- * "enableDeferredLoading": optional bool
- * "enableEnums": optional bool
- * "enableNullAwareOperators": optional bool
- * "enableSuperMixins": optional bool
- * "generateDart2jsHints": optional bool
- * "generateHints": optional bool
- * "generateLints": optional bool
- * }
- */
-final Matcher isAnalysisOptions = new LazyMatcher(
- () => new MatchesJsonObject("AnalysisOptions", null, optionalFields: {
- "enableAsync": isBool,
- "enableDeferredLoading": isBool,
- "enableEnums": isBool,
- "enableNullAwareOperators": isBool,
- "enableSuperMixins": isBool,
- "generateDart2jsHints": isBool,
- "generateHints": isBool,
- "generateLints": isBool
- }));
-
-/**
- * AnalysisService
- *
- * enum {
- * FOLDING
- * HIGHLIGHTS
- * IMPLEMENTED
- * INVALIDATE
- * NAVIGATION
- * OCCURRENCES
- * OUTLINE
- * OVERRIDES
+ * "files": List<FilePath>
* }
*/
-final Matcher isAnalysisService = new MatchesEnum("AnalysisService", [
- "FOLDING",
- "HIGHLIGHTS",
- "IMPLEMENTED",
- "INVALIDATE",
- "NAVIGATION",
- "OCCURRENCES",
- "OUTLINE",
- "OVERRIDES"
-]);
+final Matcher isAnalysisSetPriorityFilesParams = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "analysis.setPriorityFiles params", {"files": isListOf(isFilePath)}));
/**
- * AnalysisStatus
- *
- * {
- * "isAnalyzing": bool
- * "analysisTarget": optional String
- * }
+ * analysis.setPriorityFiles result
*/
-final Matcher isAnalysisStatus = new LazyMatcher(() => new MatchesJsonObject(
- "AnalysisStatus", {"isAnalyzing": isBool},
- optionalFields: {"analysisTarget": isString}));
+final Matcher isAnalysisSetPriorityFilesResult = isNull;
/**
- * ChangeContentOverlay
+ * analysis.setSubscriptions params
*
* {
- * "type": "change"
- * "edits": List<SourceEdit>
+ * "subscriptions": Map<AnalysisService, List<FilePath>>
* }
*/
-final Matcher isChangeContentOverlay = new LazyMatcher(() =>
- new MatchesJsonObject("ChangeContentOverlay",
- {"type": equals("change"), "edits": isListOf(isSourceEdit)}));
+final Matcher isAnalysisSetSubscriptionsParams = new LazyMatcher(() =>
+ new MatchesJsonObject("analysis.setSubscriptions params",
+ {"subscriptions": isMapOf(isAnalysisService, isListOf(isFilePath))}));
/**
- * CompletionId
- *
- * String
+ * analysis.setSubscriptions result
*/
-final Matcher isCompletionId = isString;
+final Matcher isAnalysisSetSubscriptionsResult = isNull;
/**
- * CompletionSuggestion
+ * analysis.updateContent params
*
* {
- * "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
+ * "files": Map<FilePath, AddContentOverlay | ChangeContentOverlay | RemoveContentOverlay>
* }
*/
-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 isAnalysisUpdateContentParams = new LazyMatcher(
+ () => new MatchesJsonObject("analysis.updateContent params", {
+ "files": isMapOf(
+ isFilePath,
+ isOneOf([
+ isAddContentOverlay,
+ isChangeContentOverlay,
+ isRemoveContentOverlay
+ ]))
}));
/**
- * CompletionSuggestionKind
+ * analysis.updateContent result
*
- * enum {
- * ARGUMENT_LIST
- * IMPORT
- * IDENTIFIER
- * INVOCATION
- * KEYWORD
- * NAMED_ARGUMENT
- * OPTIONAL_ARGUMENT
- * PARAMETER
+ * {
* }
*/
-final Matcher isCompletionSuggestionKind =
- new MatchesEnum("CompletionSuggestionKind", [
- "ARGUMENT_LIST",
- "IMPORT",
- "IDENTIFIER",
- "INVOCATION",
- "KEYWORD",
- "NAMED_ARGUMENT",
- "OPTIONAL_ARGUMENT",
- "PARAMETER"
-]);
+final Matcher isAnalysisUpdateContentResult = new LazyMatcher(
+ () => new MatchesJsonObject("analysis.updateContent result", null));
/**
- * ContextData
+ * analysis.updateOptions params
*
* {
- * "name": String
- * "explicitFileCount": int
- * "implicitFileCount": int
- * "workItemQueueLength": int
- * "cacheEntryExceptions": List<String>
+ * "options": AnalysisOptions
* }
*/
-final Matcher isContextData =
- new LazyMatcher(() => new MatchesJsonObject("ContextData", {
- "name": isString,
- "explicitFileCount": isInt,
- "implicitFileCount": isInt,
- "workItemQueueLength": isInt,
- "cacheEntryExceptions": isListOf(isString)
- }));
-
-/**
- * Element
- *
- * {
- * "kind": ElementKind
- * "name": 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
- }));
-
-/**
- * ElementKind
- *
- * 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 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"
-]);
-
-/**
- * ExecutableFile
- *
- * {
- * "file": FilePath
- * "kind": ExecutableKind
- * }
- */
-final Matcher isExecutableFile = new LazyMatcher(() => new MatchesJsonObject(
- "ExecutableFile", {"file": isFilePath, "kind": isExecutableKind}));
-
-/**
- * ExecutableKind
- *
- * enum {
- * CLIENT
- * EITHER
- * NOT_EXECUTABLE
- * SERVER
- * }
- */
-final Matcher isExecutableKind = new MatchesEnum(
- "ExecutableKind", ["CLIENT", "EITHER", "NOT_EXECUTABLE", "SERVER"]);
-
-/**
- * ExecutionContextId
- *
- * String
- */
-final Matcher isExecutionContextId = isString;
-
-/**
- * ExecutionService
- *
- * enum {
- * LAUNCH_DATA
- * }
- */
-final Matcher isExecutionService =
- new MatchesEnum("ExecutionService", ["LAUNCH_DATA"]);
-
-/**
- * FileKind
- *
- * enum {
- * LIBRARY
- * PART
- * }
- */
-final Matcher isFileKind = new MatchesEnum("FileKind", ["LIBRARY", "PART"]);
-
-/**
- * FilePath
- *
- * String
- */
-final Matcher isFilePath = isString;
-
-/**
- * FoldingKind
- *
- * enum {
- * COMMENT
- * CLASS_MEMBER
- * DIRECTIVES
- * DOCUMENTATION_COMMENT
- * TOP_LEVEL_DECLARATION
- * }
- */
-final Matcher isFoldingKind = new MatchesEnum("FoldingKind", [
- "COMMENT",
- "CLASS_MEMBER",
- "DIRECTIVES",
- "DOCUMENTATION_COMMENT",
- "TOP_LEVEL_DECLARATION"
-]);
-
-/**
- * FoldingRegion
- *
- * {
- * "kind": FoldingKind
- * "offset": int
- * "length": int
- * }
- */
-final Matcher isFoldingRegion = new LazyMatcher(() => new MatchesJsonObject(
- "FoldingRegion",
- {"kind": isFoldingKind, "offset": isInt, "length": isInt}));
-
-/**
- * GeneralAnalysisService
- *
- * enum {
- * ANALYZED_FILES
- * }
- */
-final Matcher isGeneralAnalysisService =
- new MatchesEnum("GeneralAnalysisService", ["ANALYZED_FILES"]);
-
-/**
- * HighlightRegion
- *
- * {
- * "type": HighlightRegionType
- * "offset": int
- * "length": int
- * }
- */
-final Matcher isHighlightRegion = new LazyMatcher(() => new MatchesJsonObject(
- "HighlightRegion",
- {"type": isHighlightRegionType, "offset": isInt, "length": isInt}));
-
-/**
- * HighlightRegionType
- *
- * 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"
-]);
-
-/**
- * HoverInformation
- *
- * {
- * "offset": int
- * "length": int
- * "containingLibraryPath": optional String
- * "containingLibraryName": optional String
- * "containingClassDescription": optional String
- * "dartdoc": optional String
- * "elementDescription": optional String
- * "elementKind": optional String
- * "isDeprecated": optional bool
- * "parameter": optional String
- * "propagatedType": optional String
- * "staticType": optional String
- * }
- */
-final Matcher isHoverInformation =
- new LazyMatcher(() => new MatchesJsonObject("HoverInformation", {
- "offset": isInt,
- "length": isInt
- }, optionalFields: {
- "containingLibraryPath": isString,
- "containingLibraryName": isString,
- "containingClassDescription": isString,
- "dartdoc": isString,
- "elementDescription": isString,
- "elementKind": isString,
- "isDeprecated": isBool,
- "parameter": isString,
- "propagatedType": isString,
- "staticType": isString
- }));
-
-/**
- * ImplementedClass
- *
- * {
- * "offset": int
- * "length": int
- * }
- */
-final Matcher isImplementedClass = new LazyMatcher(() => new MatchesJsonObject(
- "ImplementedClass", {"offset": isInt, "length": isInt}));
-
-/**
- * ImplementedMember
- *
- * {
- * "offset": int
- * "length": int
- * }
- */
-final Matcher isImplementedMember = new LazyMatcher(() => new MatchesJsonObject(
- "ImplementedMember", {"offset": isInt, "length": isInt}));
-
-/**
- * LinkedEditGroup
- *
- * {
- * "positions": List<Position>
- * "length": int
- * "suggestions": List<LinkedEditSuggestion>
- * }
- */
-final Matcher isLinkedEditGroup =
- new LazyMatcher(() => new MatchesJsonObject("LinkedEditGroup", {
- "positions": isListOf(isPosition),
- "length": isInt,
- "suggestions": isListOf(isLinkedEditSuggestion)
- }));
-
-/**
- * LinkedEditSuggestion
- *
- * {
- * "value": String
- * "kind": LinkedEditSuggestionKind
- * }
- */
-final Matcher isLinkedEditSuggestion = new LazyMatcher(() =>
- new MatchesJsonObject("LinkedEditSuggestion",
- {"value": isString, "kind": isLinkedEditSuggestionKind}));
+final Matcher isAnalysisUpdateOptionsParams = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "analysis.updateOptions params", {"options": isAnalysisOptions}));
/**
- * LinkedEditSuggestionKind
- *
- * enum {
- * METHOD
- * PARAMETER
- * TYPE
- * VARIABLE
- * }
+ * analysis.updateOptions result
*/
-final Matcher isLinkedEditSuggestionKind = new MatchesEnum(
- "LinkedEditSuggestionKind", ["METHOD", "PARAMETER", "TYPE", "VARIABLE"]);
+final Matcher isAnalysisUpdateOptionsResult = isNull;
/**
- * Location
+ * completion.getSuggestions params
*
* {
* "file": FilePath
* "offset": int
- * "length": int
- * "startLine": int
- * "startColumn": int
* }
*/
-final Matcher isLocation =
- new LazyMatcher(() => new MatchesJsonObject("Location", {
- "file": isFilePath,
- "offset": isInt,
- "length": isInt,
- "startLine": isInt,
- "startColumn": isInt
- }));
+final Matcher isCompletionGetSuggestionsParams = new LazyMatcher(() =>
+ new MatchesJsonObject("completion.getSuggestions params",
+ {"file": isFilePath, "offset": isInt}));
/**
- * NavigationRegion
+ * completion.getSuggestions result
*
* {
- * "offset": int
- * "length": int
- * "targets": List<int>
+ * "id": CompletionId
* }
*/
-final Matcher isNavigationRegion = new LazyMatcher(() => new MatchesJsonObject(
- "NavigationRegion",
- {"offset": isInt, "length": isInt, "targets": isListOf(isInt)}));
+final Matcher isCompletionGetSuggestionsResult = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "completion.getSuggestions result", {"id": isCompletionId}));
/**
- * NavigationTarget
+ * completion.results params
*
* {
- * "kind": ElementKind
- * "fileIndex": int
- * "offset": int
- * "length": int
- * "startLine": int
- * "startColumn": int
+ * "id": CompletionId
+ * "replacementOffset": int
+ * "replacementLength": int
+ * "results": List<CompletionSuggestion>
+ * "isLast": bool
* }
*/
-final Matcher isNavigationTarget =
- new LazyMatcher(() => new MatchesJsonObject("NavigationTarget", {
- "kind": isElementKind,
- "fileIndex": isInt,
- "offset": isInt,
- "length": isInt,
- "startLine": isInt,
- "startColumn": isInt
+final Matcher isCompletionResultsParams =
+ new LazyMatcher(() => new MatchesJsonObject("completion.results params", {
+ "id": isCompletionId,
+ "replacementOffset": isInt,
+ "replacementLength": isInt,
+ "results": isListOf(isCompletionSuggestion),
+ "isLast": isBool
}));
/**
- * Occurrences
+ * convertGetterToMethod feedback
+ */
+final Matcher isConvertGetterToMethodFeedback = isNull;
+
+/**
+ * convertGetterToMethod options
+ */
+final Matcher isConvertGetterToMethodOptions = isNull;
+
+/**
+ * convertMethodToGetter feedback
+ */
+final Matcher isConvertMethodToGetterFeedback = isNull;
+
+/**
+ * convertMethodToGetter options
+ */
+final Matcher isConvertMethodToGetterOptions = isNull;
+
+/**
+ * diagnostic.getDiagnostics params
+ */
+final Matcher isDiagnosticGetDiagnosticsParams = isNull;
+
+/**
+ * diagnostic.getDiagnostics result
*
* {
- * "element": Element
- * "offsets": List<int>
- * "length": int
+ * "contexts": List<ContextData>
* }
*/
-final Matcher isOccurrences = new LazyMatcher(() => new MatchesJsonObject(
- "Occurrences",
- {"element": isElement, "offsets": isListOf(isInt), "length": isInt}));
+final Matcher isDiagnosticGetDiagnosticsResult = new LazyMatcher(() =>
+ new MatchesJsonObject("diagnostic.getDiagnostics result",
+ {"contexts": isListOf(isContextData)}));
/**
- * Outline
+ * diagnostic.getServerPort params
+ */
+final Matcher isDiagnosticGetServerPortParams = isNull;
+
+/**
+ * diagnostic.getServerPort result
*
* {
- * "element": Element
- * "offset": int
- * "length": int
- * "children": optional List<Outline>
+ * "port": int
* }
*/
-final Matcher isOutline = new LazyMatcher(() => new MatchesJsonObject(
- "Outline", {"element": isElement, "offset": isInt, "length": isInt},
- optionalFields: {"children": isListOf(isOutline)}));
+final Matcher isDiagnosticGetServerPortResult = new LazyMatcher(() =>
+ new MatchesJsonObject("diagnostic.getServerPort result", {"port": isInt}));
/**
- * Override
+ * edit.format params
*
* {
- * "offset": int
- * "length": int
- * "superclassMember": optional OverriddenMember
- * "interfaceMembers": optional List<OverriddenMember>
+ * "file": FilePath
+ * "selectionOffset": int
+ * "selectionLength": int
+ * "lineLength": optional int
* }
*/
-final Matcher isOverride =
- new LazyMatcher(() => new MatchesJsonObject("Override", {
- "offset": isInt,
- "length": isInt
- }, optionalFields: {
- "superclassMember": isOverriddenMember,
- "interfaceMembers": isListOf(isOverriddenMember)
- }));
+final Matcher isEditFormatParams = new LazyMatcher(() => new MatchesJsonObject(
+ "edit.format params",
+ {"file": isFilePath, "selectionOffset": isInt, "selectionLength": isInt},
+ optionalFields: {"lineLength": isInt}));
/**
- * OverriddenMember
+ * edit.format result
*
* {
- * "element": Element
- * "className": String
+ * "edits": List<SourceEdit>
+ * "selectionOffset": int
+ * "selectionLength": int
* }
*/
-final Matcher isOverriddenMember = new LazyMatcher(() => new MatchesJsonObject(
- "OverriddenMember", {"element": isElement, "className": isString}));
+final Matcher isEditFormatResult =
+ new LazyMatcher(() => new MatchesJsonObject("edit.format result", {
+ "edits": isListOf(isSourceEdit),
+ "selectionOffset": isInt,
+ "selectionLength": isInt
+ }));
/**
- * Position
+ * edit.getAssists params
*
* {
* "file": FilePath
* "offset": int
+ * "length": int
* }
*/
-final Matcher isPosition = new LazyMatcher(() =>
- new MatchesJsonObject("Position", {"file": isFilePath, "offset": isInt}));
+final Matcher isEditGetAssistsParams = new LazyMatcher(() =>
+ new MatchesJsonObject("edit.getAssists params",
+ {"file": isFilePath, "offset": isInt, "length": isInt}));
/**
- * PubStatus
+ * edit.getAssists result
*
* {
- * "isListingPackageDirs": bool
+ * "assists": List<SourceChange>
* }
*/
-final Matcher isPubStatus = new LazyMatcher(
- () => new MatchesJsonObject("PubStatus", {"isListingPackageDirs": isBool}));
+final Matcher isEditGetAssistsResult = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "edit.getAssists result", {"assists": isListOf(isSourceChange)}));
/**
- * RefactoringKind
+ * edit.getAvailableRefactorings params
*
- * enum {
- * CONVERT_GETTER_TO_METHOD
- * CONVERT_METHOD_TO_GETTER
- * EXTRACT_LOCAL_VARIABLE
- * EXTRACT_METHOD
- * INLINE_LOCAL_VARIABLE
- * INLINE_METHOD
- * MOVE_FILE
- * RENAME
- * SORT_MEMBERS
+ * {
+ * "file": FilePath
+ * "offset": int
+ * "length": int
* }
*/
-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 isEditGetAvailableRefactoringsParams = new LazyMatcher(() =>
+ new MatchesJsonObject("edit.getAvailableRefactorings params",
+ {"file": isFilePath, "offset": isInt, "length": isInt}));
/**
- * RefactoringMethodParameter
+ * edit.getAvailableRefactorings result
*
* {
- * "id": optional String
- * "kind": RefactoringMethodParameterKind
- * "type": String
- * "name": String
- * "parameters": optional String
+ * "kinds": List<RefactoringKind>
* }
*/
-final Matcher isRefactoringMethodParameter = new LazyMatcher(() =>
- new MatchesJsonObject("RefactoringMethodParameter", {
- "kind": isRefactoringMethodParameterKind,
- "type": isString,
- "name": isString
- }, optionalFields: {
- "id": isString,
- "parameters": isString
- }));
+final Matcher isEditGetAvailableRefactoringsResult = new LazyMatcher(() =>
+ new MatchesJsonObject("edit.getAvailableRefactorings result",
+ {"kinds": isListOf(isRefactoringKind)}));
/**
- * RefactoringFeedback
+ * edit.getFixes params
*
* {
+ * "file": FilePath
+ * "offset": int
* }
*/
-final Matcher isRefactoringFeedback =
- new LazyMatcher(() => new MatchesJsonObject("RefactoringFeedback", null));
+final Matcher isEditGetFixesParams = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "edit.getFixes params", {"file": isFilePath, "offset": isInt}));
/**
- * RefactoringOptions
+ * edit.getFixes result
*
* {
+ * "fixes": List<AnalysisErrorFixes>
* }
*/
-final Matcher isRefactoringOptions =
- new LazyMatcher(() => new MatchesJsonObject("RefactoringOptions", null));
+final Matcher isEditGetFixesResult = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "edit.getFixes result", {"fixes": isListOf(isAnalysisErrorFixes)}));
/**
- * RefactoringMethodParameterKind
+ * edit.getRefactoring params
*
- * enum {
- * REQUIRED
- * POSITIONAL
- * NAMED
+ * {
+ * "kind": RefactoringKind
+ * "file": FilePath
+ * "offset": int
+ * "length": int
+ * "validateOnly": bool
+ * "options": optional RefactoringOptions
* }
*/
-final Matcher isRefactoringMethodParameterKind = new MatchesEnum(
- "RefactoringMethodParameterKind", ["REQUIRED", "POSITIONAL", "NAMED"]);
+final Matcher isEditGetRefactoringParams =
+ new LazyMatcher(() => new MatchesJsonObject("edit.getRefactoring params", {
+ "kind": isRefactoringKind,
+ "file": isFilePath,
+ "offset": isInt,
+ "length": isInt,
+ "validateOnly": isBool
+ }, optionalFields: {
+ "options": isRefactoringOptions
+ }));
/**
- * RefactoringProblem
+ * edit.getRefactoring result
*
* {
- * "severity": RefactoringProblemSeverity
- * "message": String
- * "location": optional Location
+ * "initialProblems": List<RefactoringProblem>
+ * "optionsProblems": List<RefactoringProblem>
+ * "finalProblems": List<RefactoringProblem>
+ * "feedback": optional RefactoringFeedback
+ * "change": optional SourceChange
+ * "potentialEdits": optional List<String>
* }
*/
-final Matcher isRefactoringProblem = new LazyMatcher(() =>
- new MatchesJsonObject("RefactoringProblem",
- {"severity": isRefactoringProblemSeverity, "message": isString},
- optionalFields: {"location": isLocation}));
+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)
+ }));
/**
- * RefactoringProblemSeverity
+ * edit.getStatementCompletion params
*
- * enum {
- * INFO
- * WARNING
- * ERROR
- * FATAL
+ * {
+ * "file": FilePath
+ * "offset": int
* }
*/
-final Matcher isRefactoringProblemSeverity = new MatchesEnum(
- "RefactoringProblemSeverity", ["INFO", "WARNING", "ERROR", "FATAL"]);
+final Matcher isEditGetStatementCompletionParams = new LazyMatcher(() =>
+ new MatchesJsonObject("edit.getStatementCompletion params",
+ {"file": isFilePath, "offset": isInt}));
/**
- * RemoveContentOverlay
+ * edit.getStatementCompletion result
*
* {
- * "type": "remove"
+ * "change": SourceChange
+ * "whitespaceOnly": bool
* }
*/
-final Matcher isRemoveContentOverlay = new LazyMatcher(() =>
- new MatchesJsonObject("RemoveContentOverlay", {"type": equals("remove")}));
+final Matcher isEditGetStatementCompletionResult = new LazyMatcher(() =>
+ new MatchesJsonObject("edit.getStatementCompletion result",
+ {"change": isSourceChange, "whitespaceOnly": isBool}));
/**
- * RequestError
+ * edit.organizeDirectives params
*
* {
- * "code": RequestErrorCode
- * "message": String
- * "stackTrace": optional String
+ * "file": FilePath
* }
*/
-final Matcher isRequestError = new LazyMatcher(() => new MatchesJsonObject(
- "RequestError", {"code": isRequestErrorCode, "message": isString},
- optionalFields: {"stackTrace": isString}));
+final Matcher isEditOrganizeDirectivesParams = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "edit.organizeDirectives params", {"file": isFilePath}));
/**
- * RequestErrorCode
+ * edit.organizeDirectives result
*
- * enum {
- * CONTENT_MODIFIED
- * DEBUG_PORT_COULD_NOT_BE_OPENED
- * FILE_NOT_ANALYZED
- * FORMAT_INVALID_FILE
- * FORMAT_WITH_ERRORS
- * GET_ERRORS_INVALID_FILE
- * GET_NAVIGATION_INVALID_FILE
- * GET_REACHABLE_SOURCES_INVALID_FILE
- * INVALID_ANALYSIS_ROOT
- * INVALID_EXECUTION_CONTEXT
- * INVALID_FILE_PATH_FORMAT
- * INVALID_OVERLAY_CHANGE
- * INVALID_PARAMETER
- * INVALID_REQUEST
- * ORGANIZE_DIRECTIVES_ERROR
- * REFACTORING_REQUEST_CANCELLED
- * SERVER_ALREADY_STARTED
- * SERVER_ERROR
- * SORT_MEMBERS_INVALID_FILE
- * SORT_MEMBERS_PARSE_ERRORS
- * UNANALYZED_PRIORITY_FILES
- * UNKNOWN_REQUEST
- * UNKNOWN_SOURCE
- * UNSUPPORTED_FEATURE
+ * {
+ * "edit": SourceFileEdit
* }
*/
-final Matcher isRequestErrorCode = new MatchesEnum("RequestErrorCode", [
- "CONTENT_MODIFIED",
- "DEBUG_PORT_COULD_NOT_BE_OPENED",
- "FILE_NOT_ANALYZED",
- "FORMAT_INVALID_FILE",
- "FORMAT_WITH_ERRORS",
- "GET_ERRORS_INVALID_FILE",
- "GET_NAVIGATION_INVALID_FILE",
- "GET_REACHABLE_SOURCES_INVALID_FILE",
- "INVALID_ANALYSIS_ROOT",
- "INVALID_EXECUTION_CONTEXT",
- "INVALID_FILE_PATH_FORMAT",
- "INVALID_OVERLAY_CHANGE",
- "INVALID_PARAMETER",
- "INVALID_REQUEST",
- "ORGANIZE_DIRECTIVES_ERROR",
- "REFACTORING_REQUEST_CANCELLED",
- "SERVER_ALREADY_STARTED",
- "SERVER_ERROR",
- "SORT_MEMBERS_INVALID_FILE",
- "SORT_MEMBERS_PARSE_ERRORS",
- "UNANALYZED_PRIORITY_FILES",
- "UNKNOWN_REQUEST",
- "UNKNOWN_SOURCE",
- "UNSUPPORTED_FEATURE"
-]);
-
-/**
- * SearchId
- *
- * String
- */
-final Matcher isSearchId = isString;
+final Matcher isEditOrganizeDirectivesResult = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "edit.organizeDirectives result", {"edit": isSourceFileEdit}));
/**
- * SearchResult
+ * edit.sortMembers params
*
* {
- * "location": Location
- * "kind": SearchResultKind
- * "isPotential": bool
- * "path": List<Element>
+ * "file": FilePath
* }
*/
-final Matcher isSearchResult =
- new LazyMatcher(() => new MatchesJsonObject("SearchResult", {
- "location": isLocation,
- "kind": isSearchResultKind,
- "isPotential": isBool,
- "path": isListOf(isElement)
- }));
+final Matcher isEditSortMembersParams = new LazyMatcher(() =>
+ new MatchesJsonObject("edit.sortMembers params", {"file": isFilePath}));
/**
- * SearchResultKind
+ * edit.sortMembers result
*
- * enum {
- * DECLARATION
- * INVOCATION
- * READ
- * READ_WRITE
- * REFERENCE
- * UNKNOWN
- * WRITE
+ * {
+ * "edit": SourceFileEdit
* }
*/
-final Matcher isSearchResultKind = new MatchesEnum("SearchResultKind", [
- "DECLARATION",
- "INVOCATION",
- "READ",
- "READ_WRITE",
- "REFERENCE",
- "UNKNOWN",
- "WRITE"
-]);
+final Matcher isEditSortMembersResult = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "edit.sortMembers result", {"edit": isSourceFileEdit}));
/**
- * ServerService
+ * execution.createContext params
*
- * enum {
- * STATUS
+ * {
+ * "contextRoot": FilePath
* }
*/
-final Matcher isServerService = new MatchesEnum("ServerService", ["STATUS"]);
+final Matcher isExecutionCreateContextParams = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "execution.createContext params", {"contextRoot": isFilePath}));
/**
- * SourceChange
+ * execution.createContext result
*
* {
- * "message": String
- * "edits": List<SourceFileEdit>
- * "linkedEditGroups": List<LinkedEditGroup>
- * "selection": optional Position
+ * "id": ExecutionContextId
* }
*/
-final Matcher isSourceChange =
- new LazyMatcher(() => new MatchesJsonObject("SourceChange", {
- "message": isString,
- "edits": isListOf(isSourceFileEdit),
- "linkedEditGroups": isListOf(isLinkedEditGroup)
- }, optionalFields: {
- "selection": isPosition
- }));
+final Matcher isExecutionCreateContextResult = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "execution.createContext result", {"id": isExecutionContextId}));
/**
- * SourceEdit
+ * execution.deleteContext params
*
* {
- * "offset": int
- * "length": int
- * "replacement": String
- * "id": optional String
+ * "id": ExecutionContextId
* }
*/
-final Matcher isSourceEdit = new LazyMatcher(() => new MatchesJsonObject(
- "SourceEdit", {"offset": isInt, "length": isInt, "replacement": isString},
- optionalFields: {"id": isString}));
+final Matcher isExecutionDeleteContextParams = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "execution.deleteContext params", {"id": isExecutionContextId}));
/**
- * SourceFileEdit
- *
- * {
- * "file": FilePath
- * "fileStamp": long
- * "edits": List<SourceEdit>
- * }
+ * execution.deleteContext result
*/
-final Matcher isSourceFileEdit = new LazyMatcher(() => new MatchesJsonObject(
- "SourceFileEdit",
- {"file": isFilePath, "fileStamp": isInt, "edits": isListOf(isSourceEdit)}));
+final Matcher isExecutionDeleteContextResult = isNull;
/**
- * TypeHierarchyItem
+ * execution.launchData params
*
* {
- * "classElement": Element
- * "displayName": optional String
- * "memberElement": optional Element
- * "superclass": optional int
- * "interfaces": List<int>
- * "mixins": List<int>
- * "subclasses": List<int>
+ * "file": FilePath
+ * "kind": optional ExecutableKind
+ * "referencedFiles": optional List<FilePath>
* }
*/
-final Matcher isTypeHierarchyItem =
- new LazyMatcher(() => new MatchesJsonObject("TypeHierarchyItem", {
- "classElement": isElement,
- "interfaces": isListOf(isInt),
- "mixins": isListOf(isInt),
- "subclasses": isListOf(isInt)
- }, optionalFields: {
- "displayName": isString,
- "memberElement": isElement,
- "superclass": isInt
- }));
+final Matcher isExecutionLaunchDataParams = new LazyMatcher(() =>
+ new MatchesJsonObject("execution.launchData params", {
+ "file": isFilePath
+ }, optionalFields: {
+ "kind": isExecutableKind,
+ "referencedFiles": isListOf(isFilePath)
+ }));
/**
- * convertGetterToMethod feedback
+ * execution.mapUri params
+ *
+ * {
+ * "id": ExecutionContextId
+ * "file": optional FilePath
+ * "uri": optional String
+ * }
*/
-final Matcher isConvertGetterToMethodFeedback = isNull;
+final Matcher isExecutionMapUriParams = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "execution.mapUri params", {"id": isExecutionContextId},
+ optionalFields: {"file": isFilePath, "uri": isString}));
/**
- * convertGetterToMethod options
+ * execution.mapUri result
+ *
+ * {
+ * "file": optional FilePath
+ * "uri": optional String
+ * }
*/
-final Matcher isConvertGetterToMethodOptions = isNull;
+final Matcher isExecutionMapUriResult = new LazyMatcher(() =>
+ new MatchesJsonObject("execution.mapUri result", null,
+ optionalFields: {"file": isFilePath, "uri": isString}));
/**
- * convertMethodToGetter feedback
+ * execution.setSubscriptions params
+ *
+ * {
+ * "subscriptions": List<ExecutionService>
+ * }
*/
-final Matcher isConvertMethodToGetterFeedback = isNull;
+final Matcher isExecutionSetSubscriptionsParams = new LazyMatcher(() =>
+ new MatchesJsonObject("execution.setSubscriptions params",
+ {"subscriptions": isListOf(isExecutionService)}));
/**
- * convertMethodToGetter options
+ * execution.setSubscriptions result
*/
-final Matcher isConvertMethodToGetterOptions = isNull;
+final Matcher isExecutionSetSubscriptionsResult = isNull;
/**
* extractLocalVariable feedback
@@ -2343,3 +2131,215 @@ final Matcher isRenameFeedback =
*/
final Matcher isRenameOptions = new LazyMatcher(
() => new MatchesJsonObject("rename options", {"newName": isString}));
+
+/**
+ * search.findElementReferences params
+ *
+ * {
+ * "file": FilePath
+ * "offset": int
+ * "includePotential": bool
+ * }
+ */
+final Matcher isSearchFindElementReferencesParams = new LazyMatcher(() =>
+ new MatchesJsonObject("search.findElementReferences params",
+ {"file": isFilePath, "offset": isInt, "includePotential": isBool}));
+
+/**
+ * search.findElementReferences result
+ *
+ * {
+ * "id": optional SearchId
+ * "element": optional Element
+ * }
+ */
+final Matcher isSearchFindElementReferencesResult = new LazyMatcher(() =>
+ new MatchesJsonObject("search.findElementReferences result", null,
+ optionalFields: {"id": isSearchId, "element": isElement}));
+
+/**
+ * search.findMemberDeclarations params
+ *
+ * {
+ * "name": String
+ * }
+ */
+final Matcher isSearchFindMemberDeclarationsParams = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "search.findMemberDeclarations params", {"name": isString}));
+
+/**
+ * search.findMemberDeclarations result
+ *
+ * {
+ * "id": SearchId
+ * }
+ */
+final Matcher isSearchFindMemberDeclarationsResult = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "search.findMemberDeclarations result", {"id": isSearchId}));
+
+/**
+ * search.findMemberReferences params
+ *
+ * {
+ * "name": String
+ * }
+ */
+final Matcher isSearchFindMemberReferencesParams = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "search.findMemberReferences params", {"name": isString}));
+
+/**
+ * search.findMemberReferences result
+ *
+ * {
+ * "id": SearchId
+ * }
+ */
+final Matcher isSearchFindMemberReferencesResult = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "search.findMemberReferences result", {"id": isSearchId}));
+
+/**
+ * search.findTopLevelDeclarations params
+ *
+ * {
+ * "pattern": String
+ * }
+ */
+final Matcher isSearchFindTopLevelDeclarationsParams = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "search.findTopLevelDeclarations params", {"pattern": isString}));
+
+/**
+ * search.findTopLevelDeclarations result
+ *
+ * {
+ * "id": SearchId
+ * }
+ */
+final Matcher isSearchFindTopLevelDeclarationsResult = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "search.findTopLevelDeclarations result", {"id": isSearchId}));
+
+/**
+ * search.getTypeHierarchy params
+ *
+ * {
+ * "file": FilePath
+ * "offset": int
+ * "superOnly": optional bool
+ * }
+ */
+final Matcher isSearchGetTypeHierarchyParams = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "search.getTypeHierarchy params", {"file": isFilePath, "offset": isInt},
+ optionalFields: {"superOnly": isBool}));
+
+/**
+ * search.getTypeHierarchy result
+ *
+ * {
+ * "hierarchyItems": optional List<TypeHierarchyItem>
+ * }
+ */
+final Matcher isSearchGetTypeHierarchyResult = new LazyMatcher(() =>
+ new MatchesJsonObject("search.getTypeHierarchy result", null,
+ optionalFields: {"hierarchyItems": isListOf(isTypeHierarchyItem)}));
+
+/**
+ * search.results params
+ *
+ * {
+ * "id": SearchId
+ * "results": List<SearchResult>
+ * "isLast": bool
+ * }
+ */
+final Matcher isSearchResultsParams = new LazyMatcher(() =>
+ new MatchesJsonObject("search.results params", {
+ "id": isSearchId,
+ "results": isListOf(isSearchResult),
+ "isLast": isBool
+ }));
+
+/**
+ * server.connected params
+ *
+ * {
+ * "version": String
+ * "pid": int
+ * "sessionId": optional String
+ * }
+ */
+final Matcher isServerConnectedParams = new LazyMatcher(() =>
+ new MatchesJsonObject(
+ "server.connected params", {"version": isString, "pid": isInt},
+ optionalFields: {"sessionId": isString}));
+
+/**
+ * server.error params
+ *
+ * {
+ * "isFatal": bool
+ * "message": String
+ * "stackTrace": String
+ * }
+ */
+final Matcher isServerErrorParams = new LazyMatcher(() => new MatchesJsonObject(
+ "server.error params",
+ {"isFatal": isBool, "message": isString, "stackTrace": isString}));
+
+/**
+ * server.getVersion params
+ */
+final Matcher isServerGetVersionParams = isNull;
+
+/**
+ * server.getVersion result
+ *
+ * {
+ * "version": String
+ * }
+ */
+final Matcher isServerGetVersionResult = new LazyMatcher(() =>
+ new MatchesJsonObject("server.getVersion result", {"version": isString}));
+
+/**
+ * server.setSubscriptions params
+ *
+ * {
+ * "subscriptions": List<ServerService>
+ * }
+ */
+final Matcher isServerSetSubscriptionsParams = new LazyMatcher(() =>
+ new MatchesJsonObject("server.setSubscriptions params",
+ {"subscriptions": isListOf(isServerService)}));
+
+/**
+ * server.setSubscriptions result
+ */
+final Matcher isServerSetSubscriptionsResult = isNull;
+
+/**
+ * server.shutdown params
+ */
+final Matcher isServerShutdownParams = isNull;
+
+/**
+ * server.shutdown result
+ */
+final Matcher isServerShutdownResult = isNull;
+
+/**
+ * server.status params
+ *
+ * {
+ * "analysis": optional AnalysisStatus
+ * "pub": optional PubStatus
+ * }
+ */
+final Matcher isServerStatusParams = new LazyMatcher(() =>
+ new MatchesJsonObject("server.status params", null,
+ optionalFields: {"analysis": isAnalysisStatus, "pub": isPubStatus}));
« no previous file with comments | « pkg/analysis_server/test/integration/support/integration_tests.dart ('k') | pkg/analysis_server/test/mocks.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698