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

Unified Diff: pkg/analysis_server/lib/src/generated_protocol.dart

Issue 479043002: Code generate Dart classes representing the analysis server API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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/lib/src/generated_protocol.dart
diff --git a/pkg/analysis_server/lib/src/generated_protocol.dart b/pkg/analysis_server/lib/src/generated_protocol.dart
new file mode 100644
index 0000000000000000000000000000000000000000..ba596312db8d6c14489921f92177e12ac9b0a7d1
--- /dev/null
+++ b/pkg/analysis_server/lib/src/generated_protocol.dart
@@ -0,0 +1,8817 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+//
+// This file has been automatically generated. Please do not edit it manually.
+// To regenerate the file, use the script
+// "pkg/analysis_server/spec/generate_files".
+
+part of protocol2;
+
+/**
+ * server.getVersion result
+ *
+ * {
+ * "version": String
+ * }
+ */
+class ServerGetVersionResult {
+ /**
+ * The version number of the analysis server.
+ */
+ final String version;
+
+ ServerGetVersionResult(this.version);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["version"] = version;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
Brian Wilkerson 2014/08/18 14:10:16 It would be nice to add @override annotations wher
Paul Berry 2014/08/18 21:58:02 Done.
+
+ bool operator==(other) {
+ if (other is ServerGetVersionResult) {
+ return version == other.version;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, version.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * server.setSubscriptions params
+ *
+ * {
+ * "subscriptions": List<ServerService>
+ * }
+ */
+class ServerSetSubscriptionsParams {
+ /**
+ * A list of the services being subscribed to.
+ */
+ final List<ServerService> subscriptions;
+
+ ServerSetSubscriptionsParams(this.subscriptions);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["subscriptions"] = subscriptions.map((ServerService value) => value.toJson());
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is ServerSetSubscriptionsParams) {
+ return subscriptions == other.subscriptions;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, subscriptions.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * server.error params
+ *
+ * {
+ * "fatal": bool
+ * "message": String
+ * "stackTrace": String
+ * }
+ */
+class ServerErrorParams {
+ /**
+ * True if the error is a fatal error, meaning that the server will shutdown
+ * automatically after sending this notification.
+ */
+ final bool fatal;
+
+ /**
+ * The error message indicating what kind of error was encountered.
+ */
+ final String message;
+
+ /**
+ * The stack trace associated with the generation of the error, used for
+ * debugging the server.
+ */
+ final String stackTrace;
+
+ ServerErrorParams(this.fatal, this.message, this.stackTrace);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["fatal"] = fatal;
+ result["message"] = message;
+ result["stackTrace"] = stackTrace;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is ServerErrorParams) {
+ return fatal == other.fatal &&
+ message == other.message &&
+ stackTrace == other.stackTrace;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, fatal.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, message.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, stackTrace.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * server.status params
+ *
+ * {
+ * "analysis": optional AnalysisStatus
+ * }
+ */
+class ServerStatusParams {
+ /**
+ * The current status of analysis, including whether analysis is being
+ * performed and if so what is being analyzed.
+ */
+ final AnalysisStatus analysis;
+
+ ServerStatusParams({this.analysis});
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ if (analysis != null) {
+ result["analysis"] = analysis.toJson();
+ }
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is ServerStatusParams) {
+ return analysis == other.analysis;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, analysis.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * analysis.getErrors params
+ *
+ * {
+ * "file": FilePath
+ * }
+ */
+class AnalysisGetErrorsParams {
+ /**
+ * The file for which errors are being requested.
+ */
+ final String file;
+
+ AnalysisGetErrorsParams(this.file);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["file"] = file;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is AnalysisGetErrorsParams) {
+ return file == other.file;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, file.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * analysis.getErrors result
+ *
+ * {
+ * "errors": List<AnalysisError>
+ * }
+ */
+class AnalysisGetErrorsResult {
+ /**
+ * The errors associated with the file.
+ */
+ final List<AnalysisError> errors;
+
+ AnalysisGetErrorsResult(this.errors);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["errors"] = errors.map((AnalysisError value) => value.toJson());
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is AnalysisGetErrorsResult) {
+ return errors == other.errors;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, errors.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * analysis.getHover params
+ *
+ * {
+ * "file": FilePath
+ * "offset": int
+ * }
+ */
+class AnalysisGetHoverParams {
+ /**
+ * The file in which hover information is being requested.
+ */
+ final String file;
+
+ /**
+ * The offset for which hover information is being requested.
+ */
+ final int offset;
+
+ AnalysisGetHoverParams(this.file, this.offset);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["file"] = file;
+ result["offset"] = offset;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is AnalysisGetHoverParams) {
+ return file == other.file &&
+ offset == other.offset;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, file.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * analysis.getHover result
+ *
+ * {
+ * "hovers": List<HoverInformation>
+ * }
+ */
+class AnalysisGetHoverResult {
+ /**
+ * The hover information associated with the location. The list will be empty
+ * if no information could be determined for the location. The list can
+ * contain multiple items if the file is being analyzed in multiple contexts
+ * in conflicting ways (such as a part that is included in multiple
+ * libraries).
+ */
+ final List<HoverInformation> hovers;
+
+ AnalysisGetHoverResult(this.hovers);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["hovers"] = hovers.map((HoverInformation value) => value.toJson());
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is AnalysisGetHoverResult) {
+ return hovers == other.hovers;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, hovers.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * analysis.setAnalysisRoots params
+ *
+ * {
+ * "included": List<FilePath>
+ * "excluded": List<FilePath>
+ * }
+ */
+class AnalysisSetAnalysisRootsParams {
+ /**
+ * A list of the files and directories that should be analyzed.
+ */
+ final List<String> included;
+
+ /**
+ * A list of the files and directories within the included directories that
+ * should not be analyzed.
+ */
+ final List<String> excluded;
+
+ AnalysisSetAnalysisRootsParams(this.included, this.excluded);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["included"] = included;
+ result["excluded"] = excluded;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is AnalysisSetAnalysisRootsParams) {
+ return included == other.included &&
+ excluded == other.excluded;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, included.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, excluded.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * analysis.setPriorityFiles params
+ *
+ * {
+ * "files": List<FilePath>
+ * }
+ */
+class AnalysisSetPriorityFilesParams {
+ /**
+ * The files that are to be a priority for analysis.
+ */
+ final List<String> files;
+
+ AnalysisSetPriorityFilesParams(this.files);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["files"] = files;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is AnalysisSetPriorityFilesParams) {
+ return files == other.files;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, files.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * analysis.setSubscriptions params
+ *
+ * {
+ * "subscriptions": Map<AnalysisService, List<FilePath>>
+ * }
+ */
+class AnalysisSetSubscriptionsParams {
+ /**
+ * A table mapping services to a list of the files being subscribed to the
+ * service.
+ */
+ final Map<AnalysisService, List<String>> subscriptions;
+
+ AnalysisSetSubscriptionsParams(this.subscriptions);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["subscriptions"] = _mapMap(subscriptions, keyCallback: (AnalysisService value) => value.toJson());
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is AnalysisSetSubscriptionsParams) {
+ return subscriptions == other.subscriptions;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, subscriptions.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * analysis.updateContent params
+ *
+ * {
+ * "files": Map<FilePath, AddContentOverlay | ChangeContentOverlay | RemoveContentOverlay>
+ * }
+ */
+class AnalysisUpdateContentParams {
+ /**
+ * A table mapping the files whose content has changed to a description of
+ * the content change.
+ */
+ final Map<String, dynamic> files;
+
+ AnalysisUpdateContentParams(this.files);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["files"] = _mapMap(files, valueCallback: (dynamic value) => value.toJson());
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is AnalysisUpdateContentParams) {
+ return files == other.files;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, files.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * analysis.updateOptions params
+ *
+ * {
+ * "options": AnalysisOptions
+ * }
+ */
+class AnalysisUpdateOptionsParams {
+ /**
+ * The options that are to be used to control analysis.
+ */
+ final AnalysisOptions options;
+
+ AnalysisUpdateOptionsParams(this.options);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["options"] = options.toJson();
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is AnalysisUpdateOptionsParams) {
+ return options == other.options;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, options.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * analysis.errors params
+ *
+ * {
+ * "file": FilePath
+ * "errors": List<AnalysisError>
+ * }
+ */
+class AnalysisErrorsParams {
+ /**
+ * The file containing the errors.
+ */
+ final String file;
+
+ /**
+ * The errors contained in the file.
+ */
+ final List<AnalysisError> errors;
+
+ AnalysisErrorsParams(this.file, this.errors);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["file"] = file;
+ result["errors"] = errors.map((AnalysisError value) => value.toJson());
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is AnalysisErrorsParams) {
+ return file == other.file &&
+ errors == other.errors;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, file.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, errors.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * analysis.flushResults params
+ *
+ * {
+ * "files": List<FilePath>
+ * }
+ */
+class AnalysisFlushResultsParams {
+ /**
+ * The files that are no longer being analyzed.
+ */
+ final List<String> files;
+
+ AnalysisFlushResultsParams(this.files);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["files"] = files;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is AnalysisFlushResultsParams) {
+ return files == other.files;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, files.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * analysis.folding params
+ *
+ * {
+ * "file": FilePath
+ * "regions": List<FoldingRegion>
+ * }
+ */
+class AnalysisFoldingParams {
+ /**
+ * The file containing the folding regions.
+ */
+ final String file;
+
+ /**
+ * The folding regions contained in the file.
+ */
+ final List<FoldingRegion> regions;
+
+ AnalysisFoldingParams(this.file, this.regions);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["file"] = file;
+ result["regions"] = regions.map((FoldingRegion value) => value.toJson());
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is AnalysisFoldingParams) {
+ return file == other.file &&
+ regions == other.regions;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, file.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, regions.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * analysis.highlights params
+ *
+ * {
+ * "file": FilePath
+ * "regions": List<HighlightRegion>
+ * }
+ */
+class AnalysisHighlightsParams {
+ /**
+ * The file containing the highlight regions.
+ */
+ final String file;
+
+ /**
+ * The highlight regions contained in the file. Each highlight region
+ * represents a particular syntactic or semantic meaning associated with some
+ * range. Note that the highlight regions that are returned can overlap other
+ * highlight regions if there is more than one meaning associated with a
+ * particular region.
+ */
+ final List<HighlightRegion> regions;
+
+ AnalysisHighlightsParams(this.file, this.regions);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["file"] = file;
+ result["regions"] = regions.map((HighlightRegion value) => value.toJson());
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is AnalysisHighlightsParams) {
+ return file == other.file &&
+ regions == other.regions;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, file.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, regions.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * analysis.navigation params
+ *
+ * {
+ * "file": FilePath
+ * "regions": List<NavigationRegion>
+ * }
+ */
+class AnalysisNavigationParams {
+ /**
+ * The file containing the navigation regions.
+ */
+ final String file;
+
+ /**
+ * The navigation regions contained in the file. Each navigation region
+ * represents a list of targets associated with some range. The lists will
+ * usually contain a single target, but can contain more in the case of a
+ * part that is included in multiple libraries or in Dart code that is
+ * compiled against multiple versions of a package. Note that the navigation
+ * regions that are returned do not overlap other navigation regions.
+ */
+ final List<NavigationRegion> regions;
+
+ AnalysisNavigationParams(this.file, this.regions);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["file"] = file;
+ result["regions"] = regions.map((NavigationRegion value) => value.toJson());
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is AnalysisNavigationParams) {
+ return file == other.file &&
+ regions == other.regions;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, file.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, regions.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * analysis.occurrences params
+ *
+ * {
+ * "file": FilePath
+ * "occurrences": List<Occurrences>
+ * }
+ */
+class AnalysisOccurrencesParams {
+ /**
+ * The file in which the references occur.
+ */
+ final String file;
+
+ /**
+ * The occurrences of references to elements within the file.
+ */
+ final List<Occurrences> occurrences;
+
+ AnalysisOccurrencesParams(this.file, this.occurrences);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["file"] = file;
+ result["occurrences"] = occurrences.map((Occurrences value) => value.toJson());
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is AnalysisOccurrencesParams) {
+ return file == other.file &&
+ occurrences == other.occurrences;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, file.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, occurrences.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * analysis.outline params
+ *
+ * {
+ * "file": FilePath
+ * "outline": Outline
+ * }
+ */
+class AnalysisOutlineParams {
+ /**
+ * The file with which the outline is associated.
+ */
+ final String file;
+
+ /**
+ * The outline associated with the file.
+ */
+ final Outline outline;
+
+ AnalysisOutlineParams(this.file, this.outline);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["file"] = file;
+ result["outline"] = outline.toJson();
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is AnalysisOutlineParams) {
+ return file == other.file &&
+ outline == other.outline;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, file.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, outline.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * analysis.overrides params
+ *
+ * {
+ * "file": FilePath
+ * "overrides": List<Override>
+ * }
+ */
+class AnalysisOverridesParams {
+ /**
+ * The file with which the overrides are associated.
+ */
+ final String file;
+
+ /**
+ * The overrides associated with the file.
+ */
+ final List<Override> overrides;
+
+ AnalysisOverridesParams(this.file, this.overrides);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["file"] = file;
+ result["overrides"] = overrides.map((Override value) => value.toJson());
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is AnalysisOverridesParams) {
+ return file == other.file &&
+ overrides == other.overrides;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, file.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, overrides.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * completion.getSuggestions params
+ *
+ * {
+ * "file": FilePath
+ * "offset": int
+ * }
+ */
+class CompletionGetSuggestionsParams {
+ /**
+ * The file containing the point at which suggestions are to be made.
+ */
+ final String file;
+
+ /**
+ * The offset within the file at which suggestions are to be made.
+ */
+ final int offset;
+
+ CompletionGetSuggestionsParams(this.file, this.offset);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["file"] = file;
+ result["offset"] = offset;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is CompletionGetSuggestionsParams) {
+ return file == other.file &&
+ offset == other.offset;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, file.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * completion.getSuggestions result
+ *
+ * {
+ * "id": CompletionId
+ * }
+ */
+class CompletionGetSuggestionsResult {
+ /**
+ * The identifier used to associate results with this completion request.
+ */
+ final String id;
+
+ CompletionGetSuggestionsResult(this.id);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["id"] = id;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is CompletionGetSuggestionsResult) {
+ return id == other.id;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, id.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * completion.results params
+ *
+ * {
+ * "id": CompletionId
+ * "replacementOffset": int
+ * "replacementLength": int
+ * "results": List<CompletionSuggestion>
+ * "last": bool
+ * }
+ */
+class CompletionResultsParams {
+ /**
+ * The id associated with the completion.
+ */
+ final String id;
+
+ /**
+ * The offset of the start of the text to be replaced. This will be different
+ * than the offset used to request the completion suggestions if there was a
+ * portion of an identifier before the original offset. In particular, the
+ * replacementOffset will be the offset of the beginning of said identifier.
+ */
+ final int replacementOffset;
+
+ /**
+ * The length of the text to be replaced if the remainder of the identifier
+ * containing the cursor is to be replaced when the suggestion is applied
+ * (that is, the number of characters in the existing identifier).
+ */
+ final int replacementLength;
+
+ /**
+ * The completion suggestions being reported. The notification contains all
+ * possible completions at the requested cursor position, even those that do
+ * not match the characters the user has already typed. This allows the
+ * client to respond to further keystrokes from the user without having to
+ * make additional requests.
+ */
+ final List<CompletionSuggestion> results;
+
+ /**
+ * True if this is that last set of results that will be returned for the
+ * indicated completion.
+ */
+ final bool last;
+
+ CompletionResultsParams(this.id, this.replacementOffset, this.replacementLength, this.results, this.last);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["id"] = id;
+ result["replacementOffset"] = replacementOffset;
+ result["replacementLength"] = replacementLength;
+ result["results"] = results.map((CompletionSuggestion value) => value.toJson());
+ result["last"] = last;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is CompletionResultsParams) {
+ return id == other.id &&
+ replacementOffset == other.replacementOffset &&
+ replacementLength == other.replacementLength &&
+ results == other.results &&
+ last == other.last;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, id.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, replacementOffset.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, replacementLength.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, results.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, last.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * search.findElementReferences params
+ *
+ * {
+ * "file": FilePath
+ * "offset": int
+ * "includePotential": bool
+ * }
+ */
+class SearchFindElementReferencesParams {
+ /**
+ * The file containing the declaration of or reference to the element used to
+ * define the search.
+ */
+ final String file;
+
+ /**
+ * The offset within the file of the declaration of or reference to the
+ * element.
+ */
+ final int offset;
+
+ /**
+ * True if potential matches are to be included in the results.
+ */
+ final bool includePotential;
+
+ SearchFindElementReferencesParams(this.file, this.offset, this.includePotential);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["file"] = file;
+ result["offset"] = offset;
+ result["includePotential"] = includePotential;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is SearchFindElementReferencesParams) {
+ return file == other.file &&
+ offset == other.offset &&
+ includePotential == other.includePotential;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, file.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, includePotential.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * search.findElementReferences result
+ *
+ * {
+ * "id": SearchId
+ * "element": Element
+ * }
+ */
+class SearchFindElementReferencesResult {
+ /**
+ * The identifier used to associate results with this search request.
+ */
+ final String id;
+
+ /**
+ * The element referenced or defined at the given offset and whose references
+ * will be returned in the search results.
+ */
+ final Element element;
+
+ SearchFindElementReferencesResult(this.id, this.element);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["id"] = id;
+ result["element"] = element.toJson();
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is SearchFindElementReferencesResult) {
+ return id == other.id &&
+ element == other.element;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, id.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, element.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * search.findMemberDeclarations params
+ *
+ * {
+ * "name": String
+ * }
+ */
+class SearchFindMemberDeclarationsParams {
+ /**
+ * The name of the declarations to be found.
+ */
+ final String name;
+
+ SearchFindMemberDeclarationsParams(this.name);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["name"] = name;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is SearchFindMemberDeclarationsParams) {
+ return name == other.name;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, name.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * search.findMemberDeclarations result
+ *
+ * {
+ * "id": SearchId
+ * }
+ */
+class SearchFindMemberDeclarationsResult {
+ /**
+ * The identifier used to associate results with this search request.
+ */
+ final String id;
+
+ SearchFindMemberDeclarationsResult(this.id);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["id"] = id;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is SearchFindMemberDeclarationsResult) {
+ return id == other.id;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, id.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * search.findMemberReferences params
+ *
+ * {
+ * "name": String
+ * }
+ */
+class SearchFindMemberReferencesParams {
+ /**
+ * The name of the references to be found.
+ */
+ final String name;
+
+ SearchFindMemberReferencesParams(this.name);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["name"] = name;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is SearchFindMemberReferencesParams) {
+ return name == other.name;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, name.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * search.findMemberReferences result
+ *
+ * {
+ * "id": SearchId
+ * }
+ */
+class SearchFindMemberReferencesResult {
+ /**
+ * The identifier used to associate results with this search request.
+ */
+ final String id;
+
+ SearchFindMemberReferencesResult(this.id);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["id"] = id;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is SearchFindMemberReferencesResult) {
+ return id == other.id;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, id.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * search.findTopLevelDeclarations params
+ *
+ * {
+ * "pattern": String
+ * }
+ */
+class SearchFindTopLevelDeclarationsParams {
+ /**
+ * The regular expression used to match the names of the declarations to be
+ * found.
+ */
+ final String pattern;
+
+ SearchFindTopLevelDeclarationsParams(this.pattern);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["pattern"] = pattern;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is SearchFindTopLevelDeclarationsParams) {
+ return pattern == other.pattern;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, pattern.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * search.findTopLevelDeclarations result
+ *
+ * {
+ * "id": SearchId
+ * }
+ */
+class SearchFindTopLevelDeclarationsResult {
+ /**
+ * The identifier used to associate results with this search request.
+ */
+ final String id;
+
+ SearchFindTopLevelDeclarationsResult(this.id);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["id"] = id;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is SearchFindTopLevelDeclarationsResult) {
+ return id == other.id;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, id.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * search.getTypeHierarchy params
+ *
+ * {
+ * "file": FilePath
+ * "offset": int
+ * }
+ */
+class SearchGetTypeHierarchyParams {
+ /**
+ * The file containing the declaration or reference to the type for which a
+ * hierarchy is being requested.
+ */
+ final String file;
+
+ /**
+ * The offset of the name of the type within the file.
+ */
+ final int offset;
+
+ SearchGetTypeHierarchyParams(this.file, this.offset);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["file"] = file;
+ result["offset"] = offset;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is SearchGetTypeHierarchyParams) {
+ return file == other.file &&
+ offset == other.offset;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, file.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * search.getTypeHierarchy result
+ *
+ * {
+ * "hierarchyItems": optional List<TypeHierarchyItem>
+ * }
+ */
+class SearchGetTypeHierarchyResult {
+ /**
+ * A list of the types in the requested hierarchy. The first element of the
+ * list is the item representing the type for which the hierarchy was
+ * requested. The index of other elements of the list is unspecified, but
+ * correspond to the integers used to reference supertype and subtype items
+ * within the items.
+ *
+ * This field will be absent if the code at the given file and offset does
+ * not represent a type, or if the file has not been sufficiently analyzed to
+ * allow a type hierarchy to be produced.
+ */
+ final List<TypeHierarchyItem> hierarchyItems;
+
+ SearchGetTypeHierarchyResult({this.hierarchyItems});
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ if (hierarchyItems != null) {
+ result["hierarchyItems"] = hierarchyItems.map((TypeHierarchyItem value) => value.toJson());
+ }
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is SearchGetTypeHierarchyResult) {
+ return hierarchyItems == other.hierarchyItems;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, hierarchyItems.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * search.results params
+ *
+ * {
+ * "id": SearchId
+ * "results": List<SearchResult>
+ * "last": bool
+ * }
+ */
+class SearchResultsParams {
+ /**
+ * The id associated with the search.
+ */
+ final String id;
+
+ /**
+ * The search results being reported.
+ */
+ final List<SearchResult> results;
+
+ /**
+ * True if this is that last set of results that will be returned for the
+ * indicated search.
+ */
+ final bool last;
+
+ SearchResultsParams(this.id, this.results, this.last);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["id"] = id;
+ result["results"] = results.map((SearchResult value) => value.toJson());
+ result["last"] = last;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is SearchResultsParams) {
+ return id == other.id &&
+ results == other.results &&
+ last == other.last;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, id.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, results.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, last.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * edit.getAssists params
+ *
+ * {
+ * "file": FilePath
+ * "offset": int
+ * "length": int
+ * }
+ */
+class EditGetAssistsParams {
+ /**
+ * The file containing the code for which assists are being requested.
+ */
+ final String file;
+
+ /**
+ * The offset of the code for which assists are being requested.
+ */
+ final int offset;
+
+ /**
+ * The length of the code for which assists are being requested.
+ */
+ final int length;
+
+ EditGetAssistsParams(this.file, this.offset, this.length);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["file"] = file;
+ result["offset"] = offset;
+ result["length"] = length;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is EditGetAssistsParams) {
+ return file == other.file &&
+ offset == other.offset &&
+ length == other.length;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, file.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, length.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * edit.getAssists result
+ *
+ * {
+ * "assists": List<SourceChange>
+ * }
+ */
+class EditGetAssistsResult {
+ /**
+ * The assists that are available at the given location.
+ */
+ final List<SourceChange> assists;
+
+ EditGetAssistsResult(this.assists);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["assists"] = assists.map((SourceChange value) => value.toJson());
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is EditGetAssistsResult) {
+ return assists == other.assists;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, assists.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * edit.getAvailableRefactorings params
+ *
+ * {
+ * "file": FilePath
+ * "offset": int
+ * "length": int
+ * }
+ */
+class EditGetAvailableRefactoringsParams {
+ /**
+ * The file containing the code on which the refactoring would be based.
+ */
+ final String file;
+
+ /**
+ * The offset of the code on which the refactoring would be based.
+ */
+ final int offset;
+
+ /**
+ * The length of the code on which the refactoring would be based.
+ */
+ final int length;
+
+ EditGetAvailableRefactoringsParams(this.file, this.offset, this.length);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["file"] = file;
+ result["offset"] = offset;
+ result["length"] = length;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is EditGetAvailableRefactoringsParams) {
+ return file == other.file &&
+ offset == other.offset &&
+ length == other.length;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, file.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, length.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * edit.getAvailableRefactorings result
+ *
+ * {
+ * "kinds": List<RefactoringKind>
+ * }
+ */
+class EditGetAvailableRefactoringsResult {
+ /**
+ * The kinds of refactorings that are valid for the given selection.
+ */
+ final List<RefactoringKind> kinds;
+
+ EditGetAvailableRefactoringsResult(this.kinds);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["kinds"] = kinds.map((RefactoringKind value) => value.toJson());
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is EditGetAvailableRefactoringsResult) {
+ return kinds == other.kinds;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, kinds.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * edit.getFixes params
+ *
+ * {
+ * "file": FilePath
+ * "offset": int
+ * }
+ */
+class EditGetFixesParams {
+ /**
+ * The file containing the errors for which fixes are being requested.
+ */
+ final String file;
+
+ /**
+ * The offset used to select the errors for which fixes will be returned.
+ */
+ final int offset;
+
+ EditGetFixesParams(this.file, this.offset);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["file"] = file;
+ result["offset"] = offset;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is EditGetFixesParams) {
+ return file == other.file &&
+ offset == other.offset;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, file.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * edit.getFixes result
+ *
+ * {
+ * "fixes": List<ErrorFixes>
+ * }
+ */
+class EditGetFixesResult {
+ /**
+ * The fixes that are available for each of the analysis errors. There is a
+ * one-to-one correspondence between the analysis errors in the request and
+ * the lists of changes in the response. In particular, it is always the case
+ * that errors.length == fixes.length and that fixes[i] is the list of fixes
+ * for the error in errors[i]. The list of changes corresponding to an error
+ * can be empty if there are no fixes available for that error.
+ */
+ final List<ErrorFixes> fixes;
+
+ EditGetFixesResult(this.fixes);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["fixes"] = fixes.map((ErrorFixes value) => value.toJson());
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is EditGetFixesResult) {
+ return fixes == other.fixes;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, fixes.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * edit.getRefactoring params
+ *
+ * {
+ * "kindId": RefactoringKind
+ * "file": FilePath
+ * "offset": int
+ * "length": int
+ * "validateOnly": bool
+ * "options": optional object
+ * }
+ */
+class EditGetRefactoringParams {
+ /**
+ * The identifier of the kind of refactoring to be performed.
+ */
+ final RefactoringKind kindId;
+
+ /**
+ * The file containing the code involved in the refactoring.
+ */
+ final String file;
+
+ /**
+ * The offset of the region involved in the refactoring.
+ */
+ final int offset;
+
+ /**
+ * The length of the region involved in the refactoring.
+ */
+ final int length;
+
+ /**
+ * True if the client is only requesting that the values of the options be
+ * validated and no change be generated.
+ */
+ final bool validateOnly;
+
+ /**
+ * Data used to provide values provided by the user. The structure of the
+ * data is dependent on the kind of refactoring being performed. The data
+ * that is expected is documented in the section titled Refactorings, labeled
+ * as “Options”. This field can be omitted if the refactoring does not
+ * require any options or if the values of those options are not known.
+ */
+ final Object options;
+
+ EditGetRefactoringParams(this.kindId, this.file, this.offset, this.length, this.validateOnly, {this.options});
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["kindId"] = kindId.toJson();
+ result["file"] = file;
+ result["offset"] = offset;
+ result["length"] = length;
+ result["validateOnly"] = validateOnly;
+ if (options != null) {
+ result["options"] = options;
+ }
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is EditGetRefactoringParams) {
+ return kindId == other.kindId &&
+ file == other.file &&
+ offset == other.offset &&
+ length == other.length &&
+ validateOnly == other.validateOnly &&
+ options == other.options;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, kindId.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, file.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, length.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, validateOnly.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, options.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * edit.getRefactoring result
+ *
+ * {
+ * "status": List<RefactoringProblem>
+ * "feedback": optional object
+ * "change": optional SourceChange
+ * "potentialEdits": optional List<String>
+ * }
+ */
+class EditGetRefactoringResult {
+ /**
+ * The status of the refactoring. The array will be empty if there are no
+ * known problems.
+ */
+ final List<RefactoringProblem> status;
+
+ /**
+ * Data used to provide feedback to the user. The structure of the data is
+ * dependent on the kind of refactoring being created. The data that is
+ * returned is documented in the section titled Refactorings, labeled as
+ * “Feedback”.
+ */
+ final Object feedback;
+
+ /**
+ * The changes that are to be applied to affect the refactoring. This field
+ * will be omitted if there are problems that prevent a set of changes from
+ * being computed, such as having no options specified for a refactoring that
+ * requires them, or if only validation was requested.
+ */
+ final SourceChange change;
+
+ /**
+ * The ids of source edits that are not known to be valid. An edit is not
+ * known to be valid if there was insufficient type information for the
+ * server to be able to determine whether or not the code needs to be
+ * modified, such as when a member is being renamed and there is a reference
+ * to a member from an unknown type. This field will be omitted if the change
+ * field is omitted or if there are no potential edits for the refactoring.
+ */
+ final List<String> potentialEdits;
+
+ EditGetRefactoringResult(this.status, {this.feedback, this.change, this.potentialEdits});
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["status"] = status.map((RefactoringProblem value) => value.toJson());
+ if (feedback != null) {
+ result["feedback"] = feedback;
+ }
+ if (change != null) {
+ result["change"] = change.toJson();
+ }
+ if (potentialEdits != null) {
+ result["potentialEdits"] = potentialEdits;
+ }
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is EditGetRefactoringResult) {
+ return status == other.status &&
+ feedback == other.feedback &&
+ change == other.change &&
+ potentialEdits == other.potentialEdits;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, status.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, feedback.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, change.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, potentialEdits.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * debug.createContext params
+ *
+ * {
+ * "contextRoot": FilePath
+ * }
+ */
+class DebugCreateContextParams {
+ /**
+ * The path of the Dart or HTML file that will be launched.
+ */
+ final String contextRoot;
+
+ DebugCreateContextParams(this.contextRoot);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["contextRoot"] = contextRoot;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is DebugCreateContextParams) {
+ return contextRoot == other.contextRoot;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, contextRoot.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * debug.createContext result
+ *
+ * {
+ * "id": DebugContextId
+ * }
+ */
+class DebugCreateContextResult {
+ /**
+ * The identifier used to refer to the debugging context that was created.
+ */
+ final String id;
+
+ DebugCreateContextResult(this.id);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["id"] = id;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is DebugCreateContextResult) {
+ return id == other.id;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, id.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * debug.deleteContext params
+ *
+ * {
+ * "id": DebugContextId
+ * }
+ */
+class DebugDeleteContextParams {
+ /**
+ * The identifier of the debugging context that is to be deleted.
+ */
+ final String id;
+
+ DebugDeleteContextParams(this.id);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["id"] = id;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is DebugDeleteContextParams) {
+ return id == other.id;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, id.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * debug.mapUri params
+ *
+ * {
+ * "id": DebugContextId
+ * "file": optional FilePath
+ * "uri": optional String
+ * }
+ */
+class DebugMapUriParams {
+ /**
+ * The identifier of the debugging context in which the URI is to be mapped.
+ */
+ final String id;
+
+ /**
+ * The path of the file to be mapped into a URI.
+ */
+ final String file;
+
+ /**
+ * The URI to be mapped into a file path.
+ */
+ final String uri;
+
+ DebugMapUriParams(this.id, {this.file, this.uri});
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["id"] = id;
+ if (file != null) {
+ result["file"] = file;
+ }
+ if (uri != null) {
+ result["uri"] = uri;
+ }
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is DebugMapUriParams) {
+ return id == other.id &&
+ file == other.file &&
+ uri == other.uri;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, id.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, file.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, uri.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * debug.mapUri result
+ *
+ * {
+ * "file": optional FilePath
+ * "uri": optional String
+ * }
+ */
+class DebugMapUriResult {
+ /**
+ * The file to which the URI was mapped. This field is omitted if the uri
+ * field was not given in the request.
+ */
+ final String file;
+
+ /**
+ * The URI to which the file path was mapped. This field is omitted if the
+ * file field was not given in the request.
+ */
+ final String uri;
+
+ DebugMapUriResult({this.file, this.uri});
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ if (file != null) {
+ result["file"] = file;
+ }
+ if (uri != null) {
+ result["uri"] = uri;
+ }
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is DebugMapUriResult) {
+ return file == other.file &&
+ uri == other.uri;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, file.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, uri.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * debug.setSubscriptions params
+ *
+ * {
+ * "subscriptions": List<DebugService>
+ * }
+ */
+class DebugSetSubscriptionsParams {
+ /**
+ * A list of the services being subscribed to.
+ */
+ final List<DebugService> subscriptions;
+
+ DebugSetSubscriptionsParams(this.subscriptions);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["subscriptions"] = subscriptions.map((DebugService value) => value.toJson());
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is DebugSetSubscriptionsParams) {
+ return subscriptions == other.subscriptions;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, subscriptions.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * debug.launchData params
+ *
+ * {
+ * "executables": List<ExecutableFile>
+ * "dartToHtml": Map<FilePath, List<FilePath>>
+ * "htmlToDart": Map<FilePath, List<FilePath>>
+ * }
+ */
+class DebugLaunchDataParams {
+ /**
+ * A list of the files that are executable in the given context. This list
+ * replaces any previous list provided for the given context.
+ */
+ final List<ExecutableFile> executables;
+
+ /**
+ * A mapping from the paths of Dart files that are referenced by HTML files
+ * to a list of the HTML files that reference the Dart files.
+ */
+ final Map<String, List<String>> dartToHtml;
+
+ /**
+ * A mapping from the paths of HTML files that reference Dart files to a list
+ * of the Dart files they reference.
+ */
+ final Map<String, List<String>> htmlToDart;
+
+ DebugLaunchDataParams(this.executables, this.dartToHtml, this.htmlToDart);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["executables"] = executables.map((ExecutableFile value) => value.toJson());
+ result["dartToHtml"] = dartToHtml;
+ result["htmlToDart"] = htmlToDart;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is DebugLaunchDataParams) {
+ return executables == other.executables &&
+ dartToHtml == other.dartToHtml &&
+ htmlToDart == other.htmlToDart;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, executables.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, dartToHtml.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, htmlToDart.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * AddContentOverlay
+ *
+ * {
+ * "type": "add"
+ * "content": String
+ * }
+ */
+class AddContentOverlay {
+ /**
+ * The new content of the file.
+ */
+ final String content;
+
+ AddContentOverlay(this.content);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["type"] = "add";
+ result["content"] = content;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is AddContentOverlay) {
+ return content == other.content;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, 704418402);
+ hash = _JenkinsSmiHash.combine(hash, content.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * AnalysisError
+ *
+ * {
+ * "severity": ErrorSeverity
+ * "type": ErrorType
+ * "location": Location
+ * "message": String
+ * "correction": optional String
+ * }
+ */
+class AnalysisError {
+ /**
+ * The severity of the error.
+ */
+ final ErrorSeverity severity;
+
+ /**
+ * The type of the error.
+ */
+ final ErrorType type;
+
+ /**
+ * The location associated with the error.
+ */
+ final Location location;
+
+ /**
+ * The message to be displayed for this error. The message should indicate
+ * what is wrong with the code and why it is wrong.
+ */
+ final String message;
+
+ /**
+ * The correction message to be displayed for this error. The correction
+ * message should indicate how the user can fix the error. The field is
+ * omitted if there is no correction message associated with the error code.
+ */
+ final String correction;
+
+ AnalysisError(this.severity, this.type, this.location, this.message, {this.correction});
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["severity"] = severity.toJson();
+ result["type"] = type.toJson();
+ result["location"] = location.toJson();
+ result["message"] = message;
+ if (correction != null) {
+ result["correction"] = correction;
+ }
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is AnalysisError) {
+ return severity == other.severity &&
+ type == other.type &&
+ location == other.location &&
+ message == other.message &&
+ correction == other.correction;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, severity.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, type.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, location.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, message.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, correction.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * AnalysisOptions
+ *
+ * {
+ * "enableAsync": optional bool
+ * "enableDeferredLoading": optional bool
+ * "enableEnums": optional bool
+ * "generateDart2jsHints": optional bool
+ * "generateHints": optional bool
+ * }
+ */
+class AnalysisOptions {
+ /**
+ * True if the client wants to enable support for the proposed async feature.
+ */
+ final bool enableAsync;
+
+ /**
+ * True if the client wants to enable support for the proposed deferred
+ * loading feature.
+ */
+ final bool enableDeferredLoading;
+
+ /**
+ * True if the client wants to enable support for the proposed enum feature.
+ */
+ final bool enableEnums;
+
+ /**
+ * True if hints that are specific to dart2js should be generated. This
+ * option is ignored if generateHints is false.
+ */
+ final bool generateDart2jsHints;
+
+ /**
+ * True is hints should be generated as part of generating errors and
+ * warnings.
+ */
+ final bool generateHints;
+
+ AnalysisOptions({this.enableAsync, this.enableDeferredLoading, this.enableEnums, this.generateDart2jsHints, this.generateHints});
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ if (enableAsync != null) {
+ result["enableAsync"] = enableAsync;
+ }
+ if (enableDeferredLoading != null) {
+ result["enableDeferredLoading"] = enableDeferredLoading;
+ }
+ if (enableEnums != null) {
+ result["enableEnums"] = enableEnums;
+ }
+ if (generateDart2jsHints != null) {
+ result["generateDart2jsHints"] = generateDart2jsHints;
+ }
+ if (generateHints != null) {
+ result["generateHints"] = generateHints;
+ }
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is AnalysisOptions) {
+ return enableAsync == other.enableAsync &&
+ enableDeferredLoading == other.enableDeferredLoading &&
+ enableEnums == other.enableEnums &&
+ generateDart2jsHints == other.generateDart2jsHints &&
+ generateHints == other.generateHints;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, enableAsync.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, enableDeferredLoading.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, enableEnums.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, generateDart2jsHints.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, generateHints.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * AnalysisService
+ *
+ * enum {
+ * FOLDING
+ * HIGHLIGHTS
+ * NAVIGATION
+ * OCCURRENCES
+ * OUTLINE
+ * OVERRIDES
+ * }
+ */
+class AnalysisService {
+ static const FOLDING = const AnalysisService._("FOLDING");
+
+ static const HIGHLIGHTS = const AnalysisService._("HIGHLIGHTS");
+
+ static const NAVIGATION = const AnalysisService._("NAVIGATION");
+
+ static const OCCURRENCES = const AnalysisService._("OCCURRENCES");
+
+ static const OUTLINE = const AnalysisService._("OUTLINE");
+
+ static const OVERRIDES = const AnalysisService._("OVERRIDES");
+
+ final String name;
+
+ const AnalysisService._(this.name);
+
+ factory AnalysisService(String name) {
+ switch (name) {
+ case "FOLDING":
+ return FOLDING;
+ case "HIGHLIGHTS":
+ return HIGHLIGHTS;
+ case "NAVIGATION":
+ return NAVIGATION;
+ case "OCCURRENCES":
+ return OCCURRENCES;
+ case "OUTLINE":
+ return OUTLINE;
+ case "OVERRIDES":
+ return OVERRIDES;
+ }
+ throw new Exception('Illegal enum value: $name');
+ }
+
+ String toString() => "AnalysisService.$name";
+
+ String toJson() => name;
+}
+
+/**
+ * AnalysisStatus
+ *
+ * {
+ * "analyzing": bool
+ * "analysisTarget": optional String
+ * }
+ */
+class AnalysisStatus {
+ /**
+ * True if analysis is currently being performed.
+ */
+ final bool analyzing;
+
+ /**
+ * The name of the current target of analysis. This field is omitted if
+ * analyzing is false.
+ */
+ final String analysisTarget;
+
+ AnalysisStatus(this.analyzing, {this.analysisTarget});
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["analyzing"] = analyzing;
+ if (analysisTarget != null) {
+ result["analysisTarget"] = analysisTarget;
+ }
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is AnalysisStatus) {
+ return analyzing == other.analyzing &&
+ analysisTarget == other.analysisTarget;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, analyzing.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, analysisTarget.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * ChangeContentOverlay
+ *
+ * {
+ * "type": "change"
+ * "edits": List<SourceEdit>
+ * }
+ */
+class ChangeContentOverlay {
+ /**
+ * The edits to be applied to the file.
+ */
+ final List<SourceEdit> edits;
+
+ ChangeContentOverlay(this.edits);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["type"] = "change";
+ result["edits"] = edits.map((SourceEdit value) => value.toJson());
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is ChangeContentOverlay) {
+ return edits == other.edits;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, 873118866);
+ hash = _JenkinsSmiHash.combine(hash, edits.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * CompletionRelevance
+ *
+ * enum {
+ * LOW
+ * DEFAULT
+ * HIGH
+ * }
+ */
+class CompletionRelevance {
+ static const LOW = const CompletionRelevance._("LOW");
+
+ static const DEFAULT = const CompletionRelevance._("DEFAULT");
+
+ static const HIGH = const CompletionRelevance._("HIGH");
+
+ final String name;
+
+ const CompletionRelevance._(this.name);
+
+ factory CompletionRelevance(String name) {
+ switch (name) {
+ case "LOW":
+ return LOW;
+ case "DEFAULT":
+ return DEFAULT;
+ case "HIGH":
+ return HIGH;
+ }
+ throw new Exception('Illegal enum value: $name');
+ }
+
+ String toString() => "CompletionRelevance.$name";
+
+ String toJson() => name;
+}
+
+/**
+ * CompletionSuggestion
+ *
+ * {
+ * "kind": CompletionSuggestionKind
+ * "relevance": CompletionRelevance
+ * "completion": String
+ * "selectionOffset": int
+ * "selectionLength": int
+ * "isDeprecated": bool
+ * "isPotential": bool
+ * "docSummary": optional String
+ * "docComplete": optional String
+ * "declaringType": optional String
+ * "returnType": optional String
+ * "parameterNames": optional List<String>
+ * "parameterTypes": optional List<String>
+ * "requiredParameterCount": optional int
+ * "positionalParameterCount": optional int
+ * "parameterName": optional String
+ * "parameterType": optional String
+ * }
+ */
+class CompletionSuggestion {
+ /**
+ * The kind of element being suggested.
+ */
+ final CompletionSuggestionKind kind;
+
+ /**
+ * The relevance of this completion suggestion.
+ */
+ final CompletionRelevance relevance;
+
+ /**
+ * The identifier to be inserted if the suggestion is selected. If the
+ * suggestion is for a method or function, the client might want to
+ * additionally insert a template for the parameters. The information
+ * required in order to do so is contained in other fields.
+ */
+ final String completion;
+
+ /**
+ * The offset, relative to the beginning of the completion, of where the
+ * selection should be placed after insertion.
+ */
+ final int selectionOffset;
+
+ /**
+ * The number of characters that should be selected after insertion.
+ */
+ final int selectionLength;
+
+ /**
+ * True if the suggested element is deprecated.
+ */
+ final bool isDeprecated;
+
+ /**
+ * True if the element is not known to be valid for the target. This happens
+ * if the type of the target is dynamic.
+ */
+ final bool isPotential;
+
+ /**
+ * An abbreviated version of the Dartdoc associated with the element being
+ * suggested, This field is omitted if there is no Dartdoc associated with
+ * the element.
+ */
+ final String docSummary;
+
+ /**
+ * The Dartdoc associated with the element being suggested, This field is
+ * omitted if there is no Dartdoc associated with the element.
+ */
+ final String docComplete;
+
+ /**
+ * The class that declares the element being suggested. This field is omitted
+ * if the suggested element is not a member of a class.
+ */
+ final String declaringType;
+
+ /**
+ * The return type of the getter, function or method being suggested. This
+ * field is omitted if the suggested element is not a getter, function or
+ * method.
+ */
+ final String returnType;
+
+ /**
+ * The names of the parameters of the function or method being suggested.
+ * This field is omitted if the suggested element is not a setter, function
+ * or method.
+ */
+ final List<String> parameterNames;
+
+ /**
+ * The types of the parameters of the function or method being suggested.
+ * This field is omitted if the parameterNames field is omitted.
+ */
+ final List<String> parameterTypes;
+
+ /**
+ * The number of required parameters for the function or method being
+ * suggested. This field is omitted if the parameterNames field is omitted.
+ */
+ final int requiredParameterCount;
+
+ /**
+ * The number of positional parameters for the function or method being
+ * suggested. This field is omitted if the parameterNames field is omitted.
+ */
+ final int positionalParameterCount;
+
+ /**
+ * The name of the optional parameter being suggested. This field is omitted
+ * if the suggestion is not the addition of an optional argument within an
+ * argument list.
+ */
+ final String parameterName;
+
+ /**
+ * The type of the options parameter being suggested. This field is omitted
+ * if the parameterName field is omitted.
+ */
+ final String parameterType;
+
+ CompletionSuggestion(this.kind, this.relevance, this.completion, this.selectionOffset, this.selectionLength, this.isDeprecated, this.isPotential, {this.docSummary, this.docComplete, this.declaringType, this.returnType, this.parameterNames, this.parameterTypes, this.requiredParameterCount, this.positionalParameterCount, this.parameterName, this.parameterType});
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["kind"] = kind.toJson();
+ result["relevance"] = relevance.toJson();
+ result["completion"] = completion;
+ result["selectionOffset"] = selectionOffset;
+ result["selectionLength"] = selectionLength;
+ result["isDeprecated"] = isDeprecated;
+ result["isPotential"] = isPotential;
+ if (docSummary != null) {
+ result["docSummary"] = docSummary;
+ }
+ if (docComplete != null) {
+ result["docComplete"] = docComplete;
+ }
+ if (declaringType != null) {
+ result["declaringType"] = declaringType;
+ }
+ if (returnType != null) {
+ result["returnType"] = returnType;
+ }
+ if (parameterNames != null) {
+ result["parameterNames"] = parameterNames;
+ }
+ if (parameterTypes != null) {
+ result["parameterTypes"] = parameterTypes;
+ }
+ if (requiredParameterCount != null) {
+ result["requiredParameterCount"] = requiredParameterCount;
+ }
+ if (positionalParameterCount != null) {
+ result["positionalParameterCount"] = positionalParameterCount;
+ }
+ if (parameterName != null) {
+ result["parameterName"] = parameterName;
+ }
+ if (parameterType != null) {
+ result["parameterType"] = parameterType;
+ }
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is CompletionSuggestion) {
+ return kind == other.kind &&
+ relevance == other.relevance &&
+ completion == other.completion &&
+ selectionOffset == other.selectionOffset &&
+ selectionLength == other.selectionLength &&
+ isDeprecated == other.isDeprecated &&
+ isPotential == other.isPotential &&
+ docSummary == other.docSummary &&
+ docComplete == other.docComplete &&
+ declaringType == other.declaringType &&
+ returnType == other.returnType &&
+ parameterNames == other.parameterNames &&
+ parameterTypes == other.parameterTypes &&
+ requiredParameterCount == other.requiredParameterCount &&
+ positionalParameterCount == other.positionalParameterCount &&
+ parameterName == other.parameterName &&
+ parameterType == other.parameterType;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, kind.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, relevance.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, completion.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, selectionOffset.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, selectionLength.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, isDeprecated.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, isPotential.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, docSummary.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, docComplete.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, declaringType.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, returnType.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, parameterNames.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, parameterTypes.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, requiredParameterCount.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, positionalParameterCount.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, parameterName.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, parameterType.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * CompletionSuggestionKind
+ *
+ * enum {
+ * ARGUMENT_LIST
+ * CLASS
+ * CLASS_ALIAS
+ * CONSTRUCTOR
+ * FIELD
+ * FUNCTION
+ * FUNCTION_TYPE_ALIAS
+ * GETTER
+ * IMPORT
+ * KEYWORD
+ * LIBRARY_PREFIX
+ * LOCAL_VARIABLE
+ * METHOD
+ * METHOD_NAME
+ * NAMED_ARGUMENT
+ * OPTIONAL_ARGUMENT
+ * PARAMETER
+ * SETTER
+ * TOP_LEVEL_VARIABLE
+ * TYPE_PARAMETER
+ * }
+ */
+class CompletionSuggestionKind {
+ static const ARGUMENT_LIST = const CompletionSuggestionKind._("ARGUMENT_LIST");
+
+ static const CLASS = const CompletionSuggestionKind._("CLASS");
+
+ static const CLASS_ALIAS = const CompletionSuggestionKind._("CLASS_ALIAS");
+
+ static const CONSTRUCTOR = const CompletionSuggestionKind._("CONSTRUCTOR");
+
+ static const FIELD = const CompletionSuggestionKind._("FIELD");
+
+ static const FUNCTION = const CompletionSuggestionKind._("FUNCTION");
+
+ static const FUNCTION_TYPE_ALIAS = const CompletionSuggestionKind._("FUNCTION_TYPE_ALIAS");
+
+ static const GETTER = const CompletionSuggestionKind._("GETTER");
+
+ static const IMPORT = const CompletionSuggestionKind._("IMPORT");
+
+ static const KEYWORD = const CompletionSuggestionKind._("KEYWORD");
+
+ static const LIBRARY_PREFIX = const CompletionSuggestionKind._("LIBRARY_PREFIX");
+
+ static const LOCAL_VARIABLE = const CompletionSuggestionKind._("LOCAL_VARIABLE");
+
+ static const METHOD = const CompletionSuggestionKind._("METHOD");
+
+ static const METHOD_NAME = const CompletionSuggestionKind._("METHOD_NAME");
+
+ static const NAMED_ARGUMENT = const CompletionSuggestionKind._("NAMED_ARGUMENT");
+
+ static const OPTIONAL_ARGUMENT = const CompletionSuggestionKind._("OPTIONAL_ARGUMENT");
+
+ static const PARAMETER = const CompletionSuggestionKind._("PARAMETER");
+
+ static const SETTER = const CompletionSuggestionKind._("SETTER");
+
+ static const TOP_LEVEL_VARIABLE = const CompletionSuggestionKind._("TOP_LEVEL_VARIABLE");
+
+ static const TYPE_PARAMETER = const CompletionSuggestionKind._("TYPE_PARAMETER");
+
+ final String name;
+
+ const CompletionSuggestionKind._(this.name);
+
+ factory CompletionSuggestionKind(String name) {
+ switch (name) {
+ case "ARGUMENT_LIST":
+ return ARGUMENT_LIST;
+ case "CLASS":
+ return CLASS;
+ case "CLASS_ALIAS":
+ return CLASS_ALIAS;
+ case "CONSTRUCTOR":
+ return CONSTRUCTOR;
+ case "FIELD":
+ return FIELD;
+ case "FUNCTION":
+ return FUNCTION;
+ case "FUNCTION_TYPE_ALIAS":
+ return FUNCTION_TYPE_ALIAS;
+ case "GETTER":
+ return GETTER;
+ case "IMPORT":
+ return IMPORT;
+ case "KEYWORD":
+ return KEYWORD;
+ case "LIBRARY_PREFIX":
+ return LIBRARY_PREFIX;
+ case "LOCAL_VARIABLE":
+ return LOCAL_VARIABLE;
+ case "METHOD":
+ return METHOD;
+ case "METHOD_NAME":
+ return METHOD_NAME;
+ case "NAMED_ARGUMENT":
+ return NAMED_ARGUMENT;
+ case "OPTIONAL_ARGUMENT":
+ return OPTIONAL_ARGUMENT;
+ case "PARAMETER":
+ return PARAMETER;
+ case "SETTER":
+ return SETTER;
+ case "TOP_LEVEL_VARIABLE":
+ return TOP_LEVEL_VARIABLE;
+ case "TYPE_PARAMETER":
+ return TYPE_PARAMETER;
+ }
+ throw new Exception('Illegal enum value: $name');
+ }
+
+ String toString() => "CompletionSuggestionKind.$name";
+
+ String toJson() => name;
+}
+
+/**
+ * DebugService
+ *
+ * enum {
+ * LAUNCH_DATA
+ * }
+ */
+class DebugService {
+ static const LAUNCH_DATA = const DebugService._("LAUNCH_DATA");
+
+ final String name;
+
+ const DebugService._(this.name);
+
+ factory DebugService(String name) {
+ switch (name) {
+ case "LAUNCH_DATA":
+ return LAUNCH_DATA;
+ }
+ throw new Exception('Illegal enum value: $name');
+ }
+
+ String toString() => "DebugService.$name";
+
+ String toJson() => name;
+}
+
+/**
+ * Element
+ *
+ * {
+ * "kind": ElementKind
+ * "name": String
+ * "location": optional Location
+ * "flags": int
+ * "parameters": optional String
+ * "returnType": optional String
+ * }
+ */
+class Element {
Brian Wilkerson 2014/08/18 14:10:16 The Java generator generates utility methods such
Paul Berry 2014/08/18 21:58:03 Acknowledged. I will address this in a future CL
+ /**
+ * The kind of the element.
+ */
+ final ElementKind kind;
+
+ /**
+ * The name of the element. This is typically used as the label in the
+ * outline.
+ */
+ final String name;
+
+ /**
+ * The location of the name in the declaration of the element.
+ */
+ final Location location;
+
+ /**
+ * A bit-map containing the following flags:
+ *
+ * - 0x01 - set if the element is explicitly or implicitly abstract
+ * - 0x02 - set if the element was declared to be ‘const’
+ * - 0x04 - set if the element was declared to be ‘final’
+ * - 0x08 - set if the element is a static member of a class or is a
+ * top-level function or field
+ * - 0x10 - set if the element is private
+ * - 0x20 - set if the element is deprecated
+ */
+ final int flags;
+
+ /**
+ * The parameter list for the element. If the element is not a method or
+ * function this field will not be defined. If the element has zero
+ * parameters, this field will have a value of "()".
+ */
+ final String parameters;
+
+ /**
+ * The return type of the element. If the element is not a method or function
+ * this field will not be defined. If the element does not have a declared
+ * return type, this field will contain an empty string.
+ */
+ final String returnType;
+
+ Element(this.kind, this.name, this.flags, {this.location, this.parameters, this.returnType});
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["kind"] = kind.toJson();
+ result["name"] = name;
+ if (location != null) {
+ result["location"] = location.toJson();
+ }
+ result["flags"] = flags;
+ if (parameters != null) {
+ result["parameters"] = parameters;
+ }
+ if (returnType != null) {
+ result["returnType"] = returnType;
+ }
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is Element) {
+ return kind == other.kind &&
+ name == other.name &&
+ location == other.location &&
+ flags == other.flags &&
+ parameters == other.parameters &&
+ returnType == other.returnType;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, kind.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, name.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, location.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, flags.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, parameters.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, returnType.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * ElementKind
+ *
+ * enum {
+ * CLASS
+ * CLASS_TYPE_ALIAS
+ * COMPILATION_UNIT
+ * CONSTRUCTOR
+ * FIELD
+ * FUNCTION
+ * FUNCTION_TYPE_ALIAS
+ * GETTER
+ * LIBRARY
+ * LOCAL_VARIABLE
+ * METHOD
+ * PARAMETER
+ * SETTER
+ * TOP_LEVEL_VARIABLE
+ * TYPE_PARAMETER
+ * UNIT_TEST_GROUP
+ * UNIT_TEST_TEST
+ * UNKNOWN
+ * }
+ */
+class ElementKind {
+ static const CLASS = const ElementKind._("CLASS");
+
+ static const CLASS_TYPE_ALIAS = const ElementKind._("CLASS_TYPE_ALIAS");
+
+ static const COMPILATION_UNIT = const ElementKind._("COMPILATION_UNIT");
+
+ static const CONSTRUCTOR = const ElementKind._("CONSTRUCTOR");
+
+ static const FIELD = const ElementKind._("FIELD");
+
+ static const FUNCTION = const ElementKind._("FUNCTION");
+
+ static const FUNCTION_TYPE_ALIAS = const ElementKind._("FUNCTION_TYPE_ALIAS");
+
+ static const GETTER = const ElementKind._("GETTER");
+
+ static const LIBRARY = const ElementKind._("LIBRARY");
+
+ static const LOCAL_VARIABLE = const ElementKind._("LOCAL_VARIABLE");
+
+ static const METHOD = const ElementKind._("METHOD");
+
+ static const PARAMETER = const ElementKind._("PARAMETER");
+
+ static const SETTER = const ElementKind._("SETTER");
+
+ static const TOP_LEVEL_VARIABLE = const ElementKind._("TOP_LEVEL_VARIABLE");
+
+ static const TYPE_PARAMETER = const ElementKind._("TYPE_PARAMETER");
+
+ static const UNIT_TEST_GROUP = const ElementKind._("UNIT_TEST_GROUP");
+
+ static const UNIT_TEST_TEST = const ElementKind._("UNIT_TEST_TEST");
+
+ static const UNKNOWN = const ElementKind._("UNKNOWN");
+
+ final String name;
+
+ const ElementKind._(this.name);
+
+ factory ElementKind(String name) {
+ switch (name) {
+ case "CLASS":
+ return CLASS;
+ case "CLASS_TYPE_ALIAS":
+ return CLASS_TYPE_ALIAS;
+ case "COMPILATION_UNIT":
+ return COMPILATION_UNIT;
+ case "CONSTRUCTOR":
+ return CONSTRUCTOR;
+ case "FIELD":
+ return FIELD;
+ case "FUNCTION":
+ return FUNCTION;
+ case "FUNCTION_TYPE_ALIAS":
+ return FUNCTION_TYPE_ALIAS;
+ case "GETTER":
+ return GETTER;
+ case "LIBRARY":
+ return LIBRARY;
+ case "LOCAL_VARIABLE":
+ return LOCAL_VARIABLE;
+ case "METHOD":
+ return METHOD;
+ case "PARAMETER":
+ return PARAMETER;
+ case "SETTER":
+ return SETTER;
+ case "TOP_LEVEL_VARIABLE":
+ return TOP_LEVEL_VARIABLE;
+ case "TYPE_PARAMETER":
+ return TYPE_PARAMETER;
+ case "UNIT_TEST_GROUP":
+ return UNIT_TEST_GROUP;
+ case "UNIT_TEST_TEST":
+ return UNIT_TEST_TEST;
+ case "UNKNOWN":
+ return UNKNOWN;
+ }
+ throw new Exception('Illegal enum value: $name');
+ }
+
+ String toString() => "ElementKind.$name";
+
+ String toJson() => name;
+}
+
+/**
+ * Error
+ *
+ * {
+ * "code": String
+ * "message": String
+ * "data": optional object
+ * }
+ */
+class Error {
+ /**
+ * A code that uniquely identifies the error that occurred.
+ */
+ final String code;
+
+ /**
+ * A short description of the error.
+ */
+ final String message;
+
+ /**
+ * Additional data related to the error. This field is omitted if there is no
+ * additional data available.
+ */
+ final Object data;
+
+ Error(this.code, this.message, {this.data});
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["code"] = code;
+ result["message"] = message;
+ if (data != null) {
+ result["data"] = data;
+ }
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is Error) {
+ return code == other.code &&
+ message == other.message &&
+ data == other.data;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, code.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, message.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, data.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * ErrorFixes
+ *
+ * {
+ * "error": AnalysisError
+ * "fixes": List<SourceChange>
+ * }
+ */
+class ErrorFixes {
+ /**
+ * The error with which the fixes are associated.
+ */
+ final AnalysisError error;
+
+ /**
+ * The fixes associated with the error.
+ */
+ final List<SourceChange> fixes;
+
+ ErrorFixes(this.error, this.fixes);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["error"] = error.toJson();
+ result["fixes"] = fixes.map((SourceChange value) => value.toJson());
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is ErrorFixes) {
+ return error == other.error &&
+ fixes == other.fixes;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, error.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, fixes.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * ErrorSeverity
+ *
+ * enum {
+ * INFO
+ * WARNING
+ * ERROR
+ * }
+ */
+class ErrorSeverity {
+ static const INFO = const ErrorSeverity._("INFO");
+
+ static const WARNING = const ErrorSeverity._("WARNING");
+
+ static const ERROR = const ErrorSeverity._("ERROR");
+
+ final String name;
+
+ const ErrorSeverity._(this.name);
+
+ factory ErrorSeverity(String name) {
+ switch (name) {
+ case "INFO":
+ return INFO;
+ case "WARNING":
+ return WARNING;
+ case "ERROR":
+ return ERROR;
+ }
+ throw new Exception('Illegal enum value: $name');
+ }
+
+ String toString() => "ErrorSeverity.$name";
+
+ String toJson() => name;
+}
+
+/**
+ * ErrorType
+ *
+ * enum {
+ * COMPILE_TIME_ERROR
+ * HINT
+ * STATIC_TYPE_WARNING
+ * STATIC_WARNING
+ * SYNTACTIC_ERROR
+ * TODO
+ * }
+ */
+class ErrorType {
+ static const COMPILE_TIME_ERROR = const ErrorType._("COMPILE_TIME_ERROR");
+
+ static const HINT = const ErrorType._("HINT");
+
+ static const STATIC_TYPE_WARNING = const ErrorType._("STATIC_TYPE_WARNING");
+
+ static const STATIC_WARNING = const ErrorType._("STATIC_WARNING");
+
+ static const SYNTACTIC_ERROR = const ErrorType._("SYNTACTIC_ERROR");
+
+ static const TODO = const ErrorType._("TODO");
+
+ final String name;
+
+ const ErrorType._(this.name);
+
+ factory ErrorType(String name) {
+ switch (name) {
+ case "COMPILE_TIME_ERROR":
+ return COMPILE_TIME_ERROR;
+ case "HINT":
+ return HINT;
+ case "STATIC_TYPE_WARNING":
+ return STATIC_TYPE_WARNING;
+ case "STATIC_WARNING":
+ return STATIC_WARNING;
+ case "SYNTACTIC_ERROR":
+ return SYNTACTIC_ERROR;
+ case "TODO":
+ return TODO;
+ }
+ throw new Exception('Illegal enum value: $name');
+ }
+
+ String toString() => "ErrorType.$name";
+
+ String toJson() => name;
+}
+
+/**
+ * ExecutableFile
+ *
+ * {
+ * "file": FilePath
+ * "offset": ExecutableKind
+ * }
+ */
+class ExecutableFile {
+ /**
+ * The path of the executable file.
+ */
+ final String file;
+
+ /**
+ * The offset of the region to be highlighted.
+ */
+ final ExecutableKind offset;
+
+ ExecutableFile(this.file, this.offset);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["file"] = file;
+ result["offset"] = offset.toJson();
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is ExecutableFile) {
+ return file == other.file &&
+ offset == other.offset;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, file.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * ExecutableKind
+ *
+ * enum {
+ * CLIENT
+ * EITHER
+ * SERVER
+ * }
+ */
+class ExecutableKind {
+ static const CLIENT = const ExecutableKind._("CLIENT");
+
+ static const EITHER = const ExecutableKind._("EITHER");
+
+ static const SERVER = const ExecutableKind._("SERVER");
+
+ final String name;
+
+ const ExecutableKind._(this.name);
+
+ factory ExecutableKind(String name) {
+ switch (name) {
+ case "CLIENT":
+ return CLIENT;
+ case "EITHER":
+ return EITHER;
+ case "SERVER":
+ return SERVER;
+ }
+ throw new Exception('Illegal enum value: $name');
+ }
+
+ String toString() => "ExecutableKind.$name";
+
+ String toJson() => name;
+}
+
+/**
+ * FoldingKind
+ *
+ * enum {
+ * COMMENT
+ * CLASS_MEMBER
+ * DIRECTIVES
+ * DOCUMENTATION_COMMENT
+ * TOP_LEVEL_DECLARATION
+ * }
+ */
+class FoldingKind {
+ static const COMMENT = const FoldingKind._("COMMENT");
+
+ static const CLASS_MEMBER = const FoldingKind._("CLASS_MEMBER");
+
+ static const DIRECTIVES = const FoldingKind._("DIRECTIVES");
+
+ static const DOCUMENTATION_COMMENT = const FoldingKind._("DOCUMENTATION_COMMENT");
+
+ static const TOP_LEVEL_DECLARATION = const FoldingKind._("TOP_LEVEL_DECLARATION");
+
+ final String name;
+
+ const FoldingKind._(this.name);
+
+ factory FoldingKind(String name) {
+ switch (name) {
+ case "COMMENT":
+ return COMMENT;
+ case "CLASS_MEMBER":
+ return CLASS_MEMBER;
+ case "DIRECTIVES":
+ return DIRECTIVES;
+ case "DOCUMENTATION_COMMENT":
+ return DOCUMENTATION_COMMENT;
+ case "TOP_LEVEL_DECLARATION":
+ return TOP_LEVEL_DECLARATION;
+ }
+ throw new Exception('Illegal enum value: $name');
+ }
+
+ String toString() => "FoldingKind.$name";
+
+ String toJson() => name;
+}
+
+/**
+ * FoldingRegion
+ *
+ * {
+ * "kind": FoldingKind
+ * "offset": int
+ * "length": int
+ * }
+ */
+class FoldingRegion {
+ /**
+ * The kind of the region.
+ */
+ final FoldingKind kind;
+
+ /**
+ * The offset of the region to be folded.
+ */
+ final int offset;
+
+ /**
+ * The length of the region to be folded.
+ */
+ final int length;
+
+ FoldingRegion(this.kind, this.offset, this.length);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["kind"] = kind.toJson();
+ result["offset"] = offset;
+ result["length"] = length;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is FoldingRegion) {
+ return kind == other.kind &&
+ offset == other.offset &&
+ length == other.length;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, kind.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, length.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * HighlightRegion
+ *
+ * {
+ * "type": HighlightRegionType
+ * "offset": int
+ * "length": int
+ * }
+ */
+class HighlightRegion {
+ /**
+ * The type of highlight associated with the region.
+ */
+ final HighlightRegionType type;
+
+ /**
+ * The offset of the region to be highlighted.
+ */
+ final int offset;
+
+ /**
+ * The length of the region to be highlighted.
+ */
+ final int length;
+
+ HighlightRegion(this.type, this.offset, this.length);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["type"] = type.toJson();
+ result["offset"] = offset;
+ result["length"] = length;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is HighlightRegion) {
+ return type == other.type &&
+ offset == other.offset &&
+ length == other.length;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, type.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, length.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * HighlightRegionType
+ *
+ * enum {
+ * ANNOTATION
+ * BUILT_IN
+ * CLASS
+ * COMMENT_BLOCK
+ * COMMENT_DOCUMENTATION
+ * COMMENT_END_OF_LINE
+ * CONSTRUCTOR
+ * DIRECTIVE
+ * DYNAMIC_TYPE
+ * FIELD
+ * FIELD_STATIC
+ * FUNCTION
+ * FUNCTION_DECLARATION
+ * FUNCTION_TYPE_ALIAS
+ * GETTER_DECLARATION
+ * IDENTIFIER_DEFAULT
+ * IMPORT_PREFIX
+ * KEYWORD
+ * LITERAL_BOOLEAN
+ * LITERAL_DOUBLE
+ * LITERAL_INTEGER
+ * LITERAL_LIST
+ * LITERAL_MAP
+ * LITERAL_STRING
+ * LOCAL_VARIABLE
+ * LOCAL_VARIABLE_DECLARATION
+ * METHOD
+ * METHOD_DECLARATION
+ * METHOD_DECLARATION_STATIC
+ * METHOD_STATIC
+ * PARAMETER
+ * SETTER_DECLARATION
+ * TOP_LEVEL_VARIABLE
+ * TYPE_NAME_DYNAMIC
+ * TYPE_PARAMETER
+ * }
+ */
+class HighlightRegionType {
+ static const ANNOTATION = const HighlightRegionType._("ANNOTATION");
+
+ static const BUILT_IN = const HighlightRegionType._("BUILT_IN");
+
+ static const CLASS = const HighlightRegionType._("CLASS");
+
+ static const COMMENT_BLOCK = const HighlightRegionType._("COMMENT_BLOCK");
+
+ static const COMMENT_DOCUMENTATION = const HighlightRegionType._("COMMENT_DOCUMENTATION");
+
+ static const COMMENT_END_OF_LINE = const HighlightRegionType._("COMMENT_END_OF_LINE");
+
+ static const CONSTRUCTOR = const HighlightRegionType._("CONSTRUCTOR");
+
+ static const DIRECTIVE = const HighlightRegionType._("DIRECTIVE");
+
+ static const DYNAMIC_TYPE = const HighlightRegionType._("DYNAMIC_TYPE");
+
+ static const FIELD = const HighlightRegionType._("FIELD");
+
+ static const FIELD_STATIC = const HighlightRegionType._("FIELD_STATIC");
+
+ static const FUNCTION = const HighlightRegionType._("FUNCTION");
+
+ static const FUNCTION_DECLARATION = const HighlightRegionType._("FUNCTION_DECLARATION");
+
+ static const FUNCTION_TYPE_ALIAS = const HighlightRegionType._("FUNCTION_TYPE_ALIAS");
+
+ static const GETTER_DECLARATION = const HighlightRegionType._("GETTER_DECLARATION");
+
+ static const IDENTIFIER_DEFAULT = const HighlightRegionType._("IDENTIFIER_DEFAULT");
+
+ static const IMPORT_PREFIX = const HighlightRegionType._("IMPORT_PREFIX");
+
+ static const KEYWORD = const HighlightRegionType._("KEYWORD");
+
+ static const LITERAL_BOOLEAN = const HighlightRegionType._("LITERAL_BOOLEAN");
+
+ static const LITERAL_DOUBLE = const HighlightRegionType._("LITERAL_DOUBLE");
+
+ static const LITERAL_INTEGER = const HighlightRegionType._("LITERAL_INTEGER");
+
+ static const LITERAL_LIST = const HighlightRegionType._("LITERAL_LIST");
+
+ static const LITERAL_MAP = const HighlightRegionType._("LITERAL_MAP");
+
+ static const LITERAL_STRING = const HighlightRegionType._("LITERAL_STRING");
+
+ static const LOCAL_VARIABLE = const HighlightRegionType._("LOCAL_VARIABLE");
+
+ static const LOCAL_VARIABLE_DECLARATION = const HighlightRegionType._("LOCAL_VARIABLE_DECLARATION");
+
+ static const METHOD = const HighlightRegionType._("METHOD");
+
+ static const METHOD_DECLARATION = const HighlightRegionType._("METHOD_DECLARATION");
+
+ static const METHOD_DECLARATION_STATIC = const HighlightRegionType._("METHOD_DECLARATION_STATIC");
+
+ static const METHOD_STATIC = const HighlightRegionType._("METHOD_STATIC");
+
+ static const PARAMETER = const HighlightRegionType._("PARAMETER");
+
+ static const SETTER_DECLARATION = const HighlightRegionType._("SETTER_DECLARATION");
+
+ static const TOP_LEVEL_VARIABLE = const HighlightRegionType._("TOP_LEVEL_VARIABLE");
+
+ static const TYPE_NAME_DYNAMIC = const HighlightRegionType._("TYPE_NAME_DYNAMIC");
+
+ static const TYPE_PARAMETER = const HighlightRegionType._("TYPE_PARAMETER");
+
+ final String name;
+
+ const HighlightRegionType._(this.name);
+
+ factory HighlightRegionType(String name) {
+ switch (name) {
+ case "ANNOTATION":
+ return ANNOTATION;
+ case "BUILT_IN":
+ return BUILT_IN;
+ case "CLASS":
+ return CLASS;
+ case "COMMENT_BLOCK":
+ return COMMENT_BLOCK;
+ case "COMMENT_DOCUMENTATION":
+ return COMMENT_DOCUMENTATION;
+ case "COMMENT_END_OF_LINE":
+ return COMMENT_END_OF_LINE;
+ case "CONSTRUCTOR":
+ return CONSTRUCTOR;
+ case "DIRECTIVE":
+ return DIRECTIVE;
+ case "DYNAMIC_TYPE":
+ return DYNAMIC_TYPE;
+ case "FIELD":
+ return FIELD;
+ case "FIELD_STATIC":
+ return FIELD_STATIC;
+ case "FUNCTION":
+ return FUNCTION;
+ case "FUNCTION_DECLARATION":
+ return FUNCTION_DECLARATION;
+ case "FUNCTION_TYPE_ALIAS":
+ return FUNCTION_TYPE_ALIAS;
+ case "GETTER_DECLARATION":
+ return GETTER_DECLARATION;
+ case "IDENTIFIER_DEFAULT":
+ return IDENTIFIER_DEFAULT;
+ case "IMPORT_PREFIX":
+ return IMPORT_PREFIX;
+ case "KEYWORD":
+ return KEYWORD;
+ case "LITERAL_BOOLEAN":
+ return LITERAL_BOOLEAN;
+ case "LITERAL_DOUBLE":
+ return LITERAL_DOUBLE;
+ case "LITERAL_INTEGER":
+ return LITERAL_INTEGER;
+ case "LITERAL_LIST":
+ return LITERAL_LIST;
+ case "LITERAL_MAP":
+ return LITERAL_MAP;
+ case "LITERAL_STRING":
+ return LITERAL_STRING;
+ case "LOCAL_VARIABLE":
+ return LOCAL_VARIABLE;
+ case "LOCAL_VARIABLE_DECLARATION":
+ return LOCAL_VARIABLE_DECLARATION;
+ case "METHOD":
+ return METHOD;
+ case "METHOD_DECLARATION":
+ return METHOD_DECLARATION;
+ case "METHOD_DECLARATION_STATIC":
+ return METHOD_DECLARATION_STATIC;
+ case "METHOD_STATIC":
+ return METHOD_STATIC;
+ case "PARAMETER":
+ return PARAMETER;
+ case "SETTER_DECLARATION":
+ return SETTER_DECLARATION;
+ case "TOP_LEVEL_VARIABLE":
+ return TOP_LEVEL_VARIABLE;
+ case "TYPE_NAME_DYNAMIC":
+ return TYPE_NAME_DYNAMIC;
+ case "TYPE_PARAMETER":
+ return TYPE_PARAMETER;
+ }
+ throw new Exception('Illegal enum value: $name');
+ }
+
+ String toString() => "HighlightRegionType.$name";
+
+ String toJson() => name;
+}
+
+/**
+ * HoverInformation
+ *
+ * {
+ * "offset": int
+ * "length": int
+ * "containingLibraryPath": optional String
+ * "containingLibraryName": optional String
+ * "dartdoc": optional String
+ * "elementDescription": optional String
+ * "elementKind": optional String
+ * "parameter": optional String
+ * "propagatedType": optional String
+ * "staticType": optional String
+ * }
+ */
+class HoverInformation {
+ /**
+ * The offset of the range of characters that encompases the cursor position
+ * and has the same hover information as the cursor position.
+ */
+ final int offset;
+
+ /**
+ * The length of the range of characters that encompases the cursor position
+ * and has the same hover information as the cursor position.
+ */
+ final int length;
+
+ /**
+ * The path to the defining compilation unit of the library in which the
+ * referenced element is declared. This data is omitted if there is no
+ * referenced element.
+ */
+ final String containingLibraryPath;
+
+ /**
+ * The name of the library in which the referenced element is declared. This
+ * data is omitted if there is no referenced element.
+ */
+ final String containingLibraryName;
+
+ /**
+ * The dartdoc associated with the referenced element. Other than the removal
+ * of the comment delimiters, including leading asterisks in the case of a
+ * block comment, the dartdoc is unprocessed markdown. This data is omitted
+ * if there is no referenced element.
+ */
+ final String dartdoc;
+
+ /**
+ * A human-readable description of the element being referenced. This data is
+ * omitted if there is no referenced element.
+ */
+ final String elementDescription;
+
+ /**
+ * A human-readable description of the kind of element being referenced (such
+ * as “class” or “function type alias”). This data is omitted if there is no
+ * referenced element.
+ */
+ final String elementKind;
+
+ /**
+ * A human-readable description of the parameter corresponding to the
+ * expression being hovered over. This data is omitted if the location is not
+ * in an argument to a function.
+ */
+ final String parameter;
+
+ /**
+ * The name of the propagated type of the expression. This data is omitted if
+ * the location does not correspond to an expression or if there is no
+ * propagated type information.
+ */
+ final String propagatedType;
+
+ /**
+ * The name of the static type of the expression. This data is omitted if the
+ * location does not correspond to an expression.
+ */
+ final String staticType;
+
+ HoverInformation(this.offset, this.length, {this.containingLibraryPath, this.containingLibraryName, this.dartdoc, this.elementDescription, this.elementKind, this.parameter, this.propagatedType, this.staticType});
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["offset"] = offset;
+ result["length"] = length;
+ if (containingLibraryPath != null) {
+ result["containingLibraryPath"] = containingLibraryPath;
+ }
+ if (containingLibraryName != null) {
+ result["containingLibraryName"] = containingLibraryName;
+ }
+ if (dartdoc != null) {
+ result["dartdoc"] = dartdoc;
+ }
+ if (elementDescription != null) {
+ result["elementDescription"] = elementDescription;
+ }
+ if (elementKind != null) {
+ result["elementKind"] = elementKind;
+ }
+ if (parameter != null) {
+ result["parameter"] = parameter;
+ }
+ if (propagatedType != null) {
+ result["propagatedType"] = propagatedType;
+ }
+ if (staticType != null) {
+ result["staticType"] = staticType;
+ }
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is HoverInformation) {
+ return offset == other.offset &&
+ length == other.length &&
+ containingLibraryPath == other.containingLibraryPath &&
+ containingLibraryName == other.containingLibraryName &&
+ dartdoc == other.dartdoc &&
+ elementDescription == other.elementDescription &&
+ elementKind == other.elementKind &&
+ parameter == other.parameter &&
+ propagatedType == other.propagatedType &&
+ staticType == other.staticType;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, length.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, containingLibraryPath.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, containingLibraryName.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, dartdoc.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, elementDescription.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, elementKind.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, parameter.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, propagatedType.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, staticType.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * LinkedEditGroup
+ *
+ * {
+ * "positions": List<Position>
+ * "length": int
+ * "suggestions": List<LinkedEditSuggestion>
+ * }
+ */
+class LinkedEditGroup {
+ /**
+ * The positions of the regions that should be edited simultaneously.
+ */
+ final List<Position> positions;
+
+ /**
+ * The length of the regions that should be edited simultaneously.
+ */
+ final int length;
+
+ /**
+ * Pre-computed suggestions for what every region might want to be changed
+ * to.
+ */
+ final List<LinkedEditSuggestion> suggestions;
+
+ LinkedEditGroup(this.positions, this.length, this.suggestions);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["positions"] = positions.map((Position value) => value.toJson());
+ result["length"] = length;
+ result["suggestions"] = suggestions.map((LinkedEditSuggestion value) => value.toJson());
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is LinkedEditGroup) {
+ return positions == other.positions &&
+ length == other.length &&
+ suggestions == other.suggestions;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, positions.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, length.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, suggestions.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * LinkedEditSuggestion
+ *
+ * {
+ * "value": String
+ * "kind": LinkedEditSuggestionKind
+ * }
+ */
+class LinkedEditSuggestion {
+ /**
+ * The value that could be used to replace all of the linked edit regions.
+ */
+ final String value;
+
+ /**
+ * The kind of value being proposed.
+ */
+ final LinkedEditSuggestionKind kind;
+
+ LinkedEditSuggestion(this.value, this.kind);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["value"] = value;
+ result["kind"] = kind.toJson();
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is LinkedEditSuggestion) {
+ return value == other.value &&
+ kind == other.kind;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, value.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, kind.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * LinkedEditSuggestionKind
+ *
+ * enum {
+ * METHOD
+ * PARAMETER
+ * TYPE
+ * VARIABLE
+ * }
+ */
+class LinkedEditSuggestionKind {
+ static const METHOD = const LinkedEditSuggestionKind._("METHOD");
+
+ static const PARAMETER = const LinkedEditSuggestionKind._("PARAMETER");
+
+ static const TYPE = const LinkedEditSuggestionKind._("TYPE");
+
+ static const VARIABLE = const LinkedEditSuggestionKind._("VARIABLE");
+
+ final String name;
+
+ const LinkedEditSuggestionKind._(this.name);
+
+ factory LinkedEditSuggestionKind(String name) {
+ switch (name) {
+ case "METHOD":
+ return METHOD;
+ case "PARAMETER":
+ return PARAMETER;
+ case "TYPE":
+ return TYPE;
+ case "VARIABLE":
+ return VARIABLE;
+ }
+ throw new Exception('Illegal enum value: $name');
+ }
+
+ String toString() => "LinkedEditSuggestionKind.$name";
+
+ String toJson() => name;
+}
+
+/**
+ * Location
+ *
+ * {
+ * "file": FilePath
+ * "offset": int
+ * "length": int
+ * "startLine": int
+ * "startColumn": int
+ * }
+ */
+class Location {
+ /**
+ * The file containing the range.
+ */
+ final String file;
+
+ /**
+ * The offset of the range.
+ */
+ final int offset;
+
+ /**
+ * The length of the range.
+ */
+ final int length;
+
+ /**
+ * The one-based index of the line containing the first character of the
+ * range.
+ */
+ final int startLine;
+
+ /**
+ * The one-based index of the column containing the first character of the
+ * range.
+ */
+ final int startColumn;
+
+ Location(this.file, this.offset, this.length, this.startLine, this.startColumn);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["file"] = file;
+ result["offset"] = offset;
+ result["length"] = length;
+ result["startLine"] = startLine;
+ result["startColumn"] = startColumn;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is Location) {
+ return file == other.file &&
+ offset == other.offset &&
+ length == other.length &&
+ startLine == other.startLine &&
+ startColumn == other.startColumn;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, file.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, length.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, startLine.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, startColumn.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * NavigationRegion
+ *
+ * {
+ * "offset": int
+ * "length": int
+ * "targets": List<Element>
+ * }
+ */
+class NavigationRegion {
+ /**
+ * The offset of the region from which the user can navigate.
+ */
+ final int offset;
+
+ /**
+ * The length of the region from which the user can navigate.
+ */
+ final int length;
+
+ /**
+ * The elements to which the given region is bound. By opening the
+ * declaration of the elements, clients can implement one form of navigation.
+ */
+ final List<Element> targets;
+
+ NavigationRegion(this.offset, this.length, this.targets);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["offset"] = offset;
+ result["length"] = length;
+ result["targets"] = targets.map((Element value) => value.toJson());
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is NavigationRegion) {
+ return offset == other.offset &&
+ length == other.length &&
+ targets == other.targets;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, length.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, targets.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * Occurrences
+ *
+ * {
+ * "element": Element
+ * "offsets": List<int>
+ * "length": int
+ * }
+ */
+class Occurrences {
+ /**
+ * The element that was referenced.
+ */
+ final Element element;
+
+ /**
+ * The offsets of the name of the referenced element within the file.
+ */
+ final List<int> offsets;
+
+ /**
+ * The length of the name of the referenced element.
+ */
+ final int length;
+
+ Occurrences(this.element, this.offsets, this.length);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["element"] = element.toJson();
+ result["offsets"] = offsets;
+ result["length"] = length;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is Occurrences) {
+ return element == other.element &&
+ offsets == other.offsets &&
scheglov 2014/08/17 19:21:06 This code prints "false". main() { var a = [1,
Paul Berry 2014/08/17 23:47:07 Whoops. Good catch. I'll remedy this tomorrow.
Paul Berry 2014/08/18 21:58:03 Fixed.
+ length == other.length;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, element.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, offsets.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, length.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * Outline
+ *
+ * {
+ * "element": Element
+ * "offset": int
+ * "length": int
+ * "children": optional List<Outline>
+ * }
+ */
+class Outline {
+ /**
+ * A description of the element represented by this node.
+ */
+ final Element element;
+
+ /**
+ * The offset of the first character of the element. This is different than
+ * the offset in the Element, which if the offset of the name of the element.
+ * It can be used, for example, to map locations in the file back to an
+ * outline.
+ */
+ final int offset;
+
+ /**
+ * The length of the element.
+ */
+ final int length;
+
+ /**
+ * The children of the node. The field will be omitted if the node has no
+ * children.
+ */
+ final List<Outline> children;
+
+ Outline(this.element, this.offset, this.length, {this.children});
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["element"] = element.toJson();
+ result["offset"] = offset;
+ result["length"] = length;
+ if (children != null) {
+ result["children"] = children.map((Outline value) => value.toJson());
+ }
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is Outline) {
+ return element == other.element &&
+ offset == other.offset &&
+ length == other.length &&
+ children == other.children;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, element.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, length.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, children.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * Override
+ *
+ * {
+ * "offset": int
+ * "length": int
+ * "superclassMember": optional OverriddenMember
+ * "interfaceMembers": optional List<OverriddenMember>
+ * }
+ */
+class Override {
+ /**
+ * The offset of the name of the overriding member.
+ */
+ final int offset;
+
+ /**
+ * The length of the name of the overriding member.
+ */
+ final int length;
+
+ /**
+ * The member inherited from a superclass that is overridden by the
+ * overriding member. The field is omitted if there is no superclass member,
+ * in which case there must be at least one interface member.
+ */
+ final OverriddenMember superclassMember;
+
+ /**
+ * The members inherited from interfaces that are overridden by the
+ * overriding member. The field is omitted if there are no interface members,
+ * in which case there must be a superclass member.
+ */
+ final List<OverriddenMember> interfaceMembers;
+
+ Override(this.offset, this.length, {this.superclassMember, this.interfaceMembers});
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["offset"] = offset;
+ result["length"] = length;
+ if (superclassMember != null) {
+ result["superclassMember"] = superclassMember.toJson();
+ }
+ if (interfaceMembers != null) {
+ result["interfaceMembers"] = interfaceMembers.map((OverriddenMember value) => value.toJson());
+ }
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is Override) {
+ return offset == other.offset &&
+ length == other.length &&
+ superclassMember == other.superclassMember &&
+ interfaceMembers == other.interfaceMembers;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, length.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, superclassMember.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, interfaceMembers.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * OverriddenMember
+ *
+ * {
+ * "element": Element
+ * "className": String
+ * }
+ */
+class OverriddenMember {
+ /**
+ * The element that is being overridden.
+ */
+ final Element element;
+
+ /**
+ * The name of the class in which the member is defined.
+ */
+ final String className;
+
+ OverriddenMember(this.element, this.className);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["element"] = element.toJson();
+ result["className"] = className;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is OverriddenMember) {
+ return element == other.element &&
+ className == other.className;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, element.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, className.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * Position
+ *
+ * {
+ * "file": FilePath
+ * "offset": int
+ * }
+ */
+class Position {
+ /**
+ * The file containing the position.
+ */
+ final String file;
+
+ /**
+ * The offset of the position.
+ */
+ final int offset;
+
+ Position(this.file, this.offset);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["file"] = file;
+ result["offset"] = offset;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is Position) {
+ return file == other.file &&
+ offset == other.offset;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, file.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * RefactoringKind
+ *
+ * enum {
+ * CONVERT_GETTER_TO_METHOD
+ * CONVERT_METHOD_TO_GETTER
+ * EXTRACT_LOCAL_VARIABLE
+ * EXTRACT_METHOD
+ * INLINE_LOCAL_VARIABLE
+ * INLINE_METHOD
+ * RENAME
+ * }
+ */
+class RefactoringKind {
+ static const CONVERT_GETTER_TO_METHOD = const RefactoringKind._("CONVERT_GETTER_TO_METHOD");
+
+ static const CONVERT_METHOD_TO_GETTER = const RefactoringKind._("CONVERT_METHOD_TO_GETTER");
+
+ static const EXTRACT_LOCAL_VARIABLE = const RefactoringKind._("EXTRACT_LOCAL_VARIABLE");
+
+ static const EXTRACT_METHOD = const RefactoringKind._("EXTRACT_METHOD");
+
+ static const INLINE_LOCAL_VARIABLE = const RefactoringKind._("INLINE_LOCAL_VARIABLE");
+
+ static const INLINE_METHOD = const RefactoringKind._("INLINE_METHOD");
+
+ static const RENAME = const RefactoringKind._("RENAME");
+
+ final String name;
+
+ const RefactoringKind._(this.name);
+
+ factory RefactoringKind(String name) {
+ switch (name) {
+ case "CONVERT_GETTER_TO_METHOD":
+ return CONVERT_GETTER_TO_METHOD;
+ case "CONVERT_METHOD_TO_GETTER":
+ return CONVERT_METHOD_TO_GETTER;
+ case "EXTRACT_LOCAL_VARIABLE":
+ return EXTRACT_LOCAL_VARIABLE;
+ case "EXTRACT_METHOD":
+ return EXTRACT_METHOD;
+ case "INLINE_LOCAL_VARIABLE":
+ return INLINE_LOCAL_VARIABLE;
+ case "INLINE_METHOD":
+ return INLINE_METHOD;
+ case "RENAME":
+ return RENAME;
+ }
+ throw new Exception('Illegal enum value: $name');
+ }
+
+ String toString() => "RefactoringKind.$name";
+
+ String toJson() => name;
+}
+
+/**
+ * RefactoringMethodParameter
+ *
+ * {
+ * "id": optional String
+ * "kind": RefactoringMethodParameterKind
+ * "type": String
+ * "name": String
+ * "parameters": optional String
+ * }
+ */
+class RefactoringMethodParameter {
+ /**
+ * The unique identifier of the parameter. Clients may omit this field for
+ * the parameters they want to add.
+ */
+ final String id;
+
+ /**
+ * The kind of the parameter.
+ */
+ final RefactoringMethodParameterKind kind;
+
+ /**
+ * The type that should be given to the parameter, or the return type of the
+ * parameter's function type.
+ */
+ final String type;
+
+ /**
+ * The name that should be given to the parameter.
+ */
+ final String name;
+
+ /**
+ * The parameter list of the parameter's function type. If the parameter is
+ * not of a function type, this field will not be defined. If the function
+ * type has zero parameters, this field will have a value of "()".
+ */
+ final String parameters;
+
+ RefactoringMethodParameter(this.kind, this.type, this.name, {this.id, this.parameters});
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ if (id != null) {
+ result["id"] = id;
+ }
+ result["kind"] = kind.toJson();
+ result["type"] = type;
+ result["name"] = name;
+ if (parameters != null) {
+ result["parameters"] = parameters;
+ }
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is RefactoringMethodParameter) {
+ return id == other.id &&
+ kind == other.kind &&
+ type == other.type &&
+ name == other.name &&
+ parameters == other.parameters;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, id.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, kind.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, type.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, name.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, parameters.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * RefactoringMethodParameterKind
+ *
+ * enum {
+ * REQUIRED
+ * POSITIONAL
+ * NAMED
+ * }
+ */
+class RefactoringMethodParameterKind {
+ static const REQUIRED = const RefactoringMethodParameterKind._("REQUIRED");
+
+ static const POSITIONAL = const RefactoringMethodParameterKind._("POSITIONAL");
+
+ static const NAMED = const RefactoringMethodParameterKind._("NAMED");
+
+ final String name;
+
+ const RefactoringMethodParameterKind._(this.name);
+
+ factory RefactoringMethodParameterKind(String name) {
+ switch (name) {
+ case "REQUIRED":
+ return REQUIRED;
+ case "POSITIONAL":
+ return POSITIONAL;
+ case "NAMED":
+ return NAMED;
+ }
+ throw new Exception('Illegal enum value: $name');
+ }
+
+ String toString() => "RefactoringMethodParameterKind.$name";
+
+ String toJson() => name;
+}
+
+/**
+ * RefactoringProblem
+ *
+ * {
+ * "severity": RefactoringProblemSeverity
+ * "message": String
+ * "location": Location
+ * }
+ */
+class RefactoringProblem {
+ /**
+ * The severity of the problem being represented.
+ */
+ final RefactoringProblemSeverity severity;
+
+ /**
+ * A human-readable description of the problem being represented.
+ */
+ final String message;
+
+ /**
+ * The location of the problem being represented.
+ */
+ final Location location;
+
+ RefactoringProblem(this.severity, this.message, this.location);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["severity"] = severity.toJson();
+ result["message"] = message;
+ result["location"] = location.toJson();
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is RefactoringProblem) {
+ return severity == other.severity &&
+ message == other.message &&
+ location == other.location;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, severity.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, message.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, location.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * RefactoringProblemSeverity
+ *
+ * enum {
+ * INFO
+ * WARNING
+ * ERROR
+ * FATAL
+ * }
+ */
+class RefactoringProblemSeverity {
+ static const INFO = const RefactoringProblemSeverity._("INFO");
+
+ static const WARNING = const RefactoringProblemSeverity._("WARNING");
+
+ static const ERROR = const RefactoringProblemSeverity._("ERROR");
+
+ static const FATAL = const RefactoringProblemSeverity._("FATAL");
+
+ final String name;
+
+ const RefactoringProblemSeverity._(this.name);
+
+ factory RefactoringProblemSeverity(String name) {
+ switch (name) {
+ case "INFO":
+ return INFO;
+ case "WARNING":
+ return WARNING;
+ case "ERROR":
+ return ERROR;
+ case "FATAL":
+ return FATAL;
+ }
+ throw new Exception('Illegal enum value: $name');
+ }
+
+ String toString() => "RefactoringProblemSeverity.$name";
+
+ String toJson() => name;
+}
+
+/**
+ * RemoveContentOverlay
+ *
+ * {
+ * "type": "remove"
+ * }
+ */
+class RemoveContentOverlay {
+ RemoveContentOverlay();
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["type"] = "remove";
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is RemoveContentOverlay) {
+ return true;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, 114870849);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * SearchResult
+ *
+ * {
+ * "location": Location
+ * "kind": SearchResultKind
+ * "isPotential": bool
+ * "path": List<Element>
+ * }
+ */
+class SearchResult {
+ /**
+ * The location of the code that matched the search criteria.
+ */
+ final Location location;
+
+ /**
+ * The kind of element that was found or the kind of reference that was
+ * found.
+ */
+ final SearchResultKind kind;
+
+ /**
+ * True if the result is a potential match but cannot be confirmed to be a
+ * match. For example, if all references to a method m defined in some class
+ * were requested, and a reference to a method m from an unknown class were
+ * found, it would be marked as being a potential match.
+ */
+ final bool isPotential;
+
+ /**
+ * The elements that contain the result, starting with the most immediately
+ * enclosing ancestor and ending with the library.
+ */
+ final List<Element> path;
+
+ SearchResult(this.location, this.kind, this.isPotential, this.path);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["location"] = location.toJson();
+ result["kind"] = kind.toJson();
+ result["isPotential"] = isPotential;
+ result["path"] = path.map((Element value) => value.toJson());
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is SearchResult) {
+ return location == other.location &&
+ kind == other.kind &&
+ isPotential == other.isPotential &&
+ path == other.path;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, location.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, kind.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, isPotential.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, path.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * SearchResultKind
+ *
+ * enum {
+ * DECLARATION
+ * INVOCATION
+ * READ
+ * READ_WRITE
+ * REFERENCE
+ * WRITE
+ * }
+ */
+class SearchResultKind {
+ /**
+ * The declaration of an element.
+ */
+ static const DECLARATION = const SearchResultKind._("DECLARATION");
+
+ /**
+ * The invocation of a function or method.
+ */
+ static const INVOCATION = const SearchResultKind._("INVOCATION");
+
+ /**
+ * A reference to a field, parameter or variable where it is being read.
+ */
+ static const READ = const SearchResultKind._("READ");
+
+ /**
+ * A reference to a field, parameter or variable where it is being read and
+ * written.
+ */
+ static const READ_WRITE = const SearchResultKind._("READ_WRITE");
+
+ /**
+ * A reference to an element.
+ */
+ static const REFERENCE = const SearchResultKind._("REFERENCE");
+
+ /**
+ * A reference to a field, parameter or variable where it is being written.
+ */
+ static const WRITE = const SearchResultKind._("WRITE");
+
+ final String name;
+
+ const SearchResultKind._(this.name);
+
+ factory SearchResultKind(String name) {
+ switch (name) {
+ case "DECLARATION":
+ return DECLARATION;
+ case "INVOCATION":
+ return INVOCATION;
+ case "READ":
+ return READ;
+ case "READ_WRITE":
+ return READ_WRITE;
+ case "REFERENCE":
+ return REFERENCE;
+ case "WRITE":
+ return WRITE;
+ }
+ throw new Exception('Illegal enum value: $name');
+ }
+
+ String toString() => "SearchResultKind.$name";
+
+ String toJson() => name;
+}
+
+/**
+ * ServerService
+ *
+ * enum {
+ * STATUS
+ * }
+ */
+class ServerService {
+ static const STATUS = const ServerService._("STATUS");
+
+ final String name;
+
+ const ServerService._(this.name);
+
+ factory ServerService(String name) {
+ switch (name) {
+ case "STATUS":
+ return STATUS;
+ }
+ throw new Exception('Illegal enum value: $name');
+ }
+
+ String toString() => "ServerService.$name";
+
+ String toJson() => name;
+}
+
+/**
+ * SourceChange
+ *
+ * {
+ * "message": String
+ * "edits": List<SourceFileEdit>
+ * "linkedEditGroups": List<LinkedEditGroup>
+ * "selection": optional Position
+ * }
+ */
+class SourceChange {
+ /**
+ * A human-readable description of the change to be applied.
+ */
+ final String message;
+
+ /**
+ * A list of the edits used to effect the change, grouped by file.
+ */
+ final List<SourceFileEdit> edits;
+
+ /**
+ * A list of the linked editing groups used to customize the changes that
+ * were made.
+ */
+ final List<LinkedEditGroup> linkedEditGroups;
+
+ /**
+ * The position that should be selected after the edits have been applied.
+ */
+ final Position selection;
+
+ SourceChange(this.message, this.edits, this.linkedEditGroups, {this.selection});
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["message"] = message;
+ result["edits"] = edits.map((SourceFileEdit value) => value.toJson());
+ result["linkedEditGroups"] = linkedEditGroups.map((LinkedEditGroup value) => value.toJson());
+ if (selection != null) {
+ result["selection"] = selection.toJson();
+ }
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is SourceChange) {
+ return message == other.message &&
+ edits == other.edits &&
+ linkedEditGroups == other.linkedEditGroups &&
+ selection == other.selection;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, message.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, edits.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, linkedEditGroups.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, selection.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * SourceEdit
+ *
+ * {
+ * "offset": int
+ * "length": int
+ * "replacement": String
+ * "id": optional String
+ * }
+ */
+class SourceEdit {
+ /**
+ * The offset of the region to be modified.
+ */
+ final int offset;
+
+ /**
+ * The length of the region to be modified.
+ */
+ final int length;
+
+ /**
+ * The code that is to replace the specified region in the original code.
+ */
+ final String replacement;
+
+ /**
+ * An identifier that uniquely identifies this source edit from other edits
+ * in the same response. This field is omitted unless a containing structure
+ * needs to be able to identify the edit for some reason.
+ *
+ * For example, some refactoring operations can produce edits that might not
+ * be appropriate (referred to as potential edits). Such edits will have an
+ * id so that they can be referenced. Edits in the same response that do not
+ * need to be referenced will not have an id.
+ */
+ final String id;
+
+ SourceEdit(this.offset, this.length, this.replacement, {this.id});
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["offset"] = offset;
+ result["length"] = length;
+ result["replacement"] = replacement;
+ if (id != null) {
+ result["id"] = id;
+ }
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is SourceEdit) {
+ return offset == other.offset &&
+ length == other.length &&
+ replacement == other.replacement &&
+ id == other.id;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, length.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, replacement.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, id.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * SourceFileEdit
+ *
+ * {
+ * "file": FilePath
+ * "edits": List<SourceEdit>
+ * }
+ */
+class SourceFileEdit {
+ /**
+ * The file containing the code to be modified.
+ */
+ final String file;
+
+ /**
+ * A list of the edits used to effect the change.
+ */
+ final List<SourceEdit> edits;
+
+ SourceFileEdit(this.file, this.edits);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["file"] = file;
+ result["edits"] = edits.map((SourceEdit value) => value.toJson());
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is SourceFileEdit) {
+ return file == other.file &&
+ edits == other.edits;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, file.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, edits.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * TypeHierarchyItem
+ *
+ * {
+ * "classElement": Element
+ * "displayName": optional String
+ * "memberElement": optional Element
+ * "superclass": optional int
+ * "interfaces": List<int>
+ * "mixins": List<int>
+ * "subclasses": List<int>
+ * }
+ */
+class TypeHierarchyItem {
+ /**
+ * The class element represented by this item.
+ */
+ final Element classElement;
+
+ /**
+ * The name to be displayed for the class. This field will be omitted if the
+ * display name is the same as the name of the element. The display name is
+ * different if there is additional type information to be displayed, such as
+ * type arguments.
+ */
+ final String displayName;
+
+ /**
+ * The member in the class corresponding to the member on which the hierarchy
+ * was requested. This field will be omitted if the hierarchy was not
+ * requested for a member or if the class does not have a corresponding
+ * member.
+ */
+ final Element memberElement;
+
+ /**
+ * The index of the item representing the superclass of this class. This
+ * field will be omitted if this item represents the class Object.
+ */
+ final int superclass;
+
+ /**
+ * The indexes of the items representing the interfaces implemented by this
+ * class. The list will be empty if there are no implemented interfaces.
+ */
+ final List<int> interfaces;
+
+ /**
+ * The indexes of the items representing the mixins referenced by this class.
+ * The list will be empty if there are no classes mixed in to this class.
+ */
+ final List<int> mixins;
+
+ /**
+ * The indexes of the items representing the subtypes of this class. The list
+ * will be empty if there are no subtypes or if this item represents a
+ * supertype of the pivot type.
+ */
+ final List<int> subclasses;
+
+ TypeHierarchyItem(this.classElement, this.interfaces, this.mixins, this.subclasses, {this.displayName, this.memberElement, this.superclass});
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["classElement"] = classElement.toJson();
+ if (displayName != null) {
+ result["displayName"] = displayName;
+ }
+ if (memberElement != null) {
+ result["memberElement"] = memberElement.toJson();
+ }
+ if (superclass != null) {
+ result["superclass"] = superclass;
+ }
+ result["interfaces"] = interfaces;
+ result["mixins"] = mixins;
+ result["subclasses"] = subclasses;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is TypeHierarchyItem) {
+ return classElement == other.classElement &&
+ displayName == other.displayName &&
+ memberElement == other.memberElement &&
+ superclass == other.superclass &&
+ interfaces == other.interfaces &&
+ mixins == other.mixins &&
+ subclasses == other.subclasses;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, classElement.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, displayName.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, memberElement.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, superclass.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, interfaces.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, mixins.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, subclasses.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * extractLocalVariable feedback
+ *
+ * {
+ * "names": List<String>
+ * "offsets": List<int>
+ * "lengths": List<int>
+ * }
+ */
+class ExtractLocalVariableFeedback {
+ /**
+ * The proposed names for the local variable.
+ */
+ final List<String> names;
+
+ /**
+ * The offsets of the expressions that would be replaced by a reference to
+ * the variable.
+ */
+ final List<int> offsets;
+
+ /**
+ * The lengths of the expressions that would be replaced by a reference to
+ * the variable. The lengths correspond to the offsets. In other words, for a
+ * given expression, if the offset of that expression is offsets[i], then the
+ * length of that expression is lengths[i].
+ */
+ final List<int> lengths;
+
+ ExtractLocalVariableFeedback(this.names, this.offsets, this.lengths);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["names"] = names;
+ result["offsets"] = offsets;
+ result["lengths"] = lengths;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is ExtractLocalVariableFeedback) {
+ return names == other.names &&
+ offsets == other.offsets &&
+ lengths == other.lengths;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, names.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, offsets.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, lengths.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * extractLocalVariable options
+ *
+ * {
+ * "name": String
+ * "extractAll": bool
+ * }
+ */
+class ExtractLocalVariableOptions {
+ /**
+ * The name that the local variable should be given.
+ */
+ final String name;
+
+ /**
+ * True if all occurrences of the expression within the scope in which the
+ * variable will be defined should be replaced by a reference to the local
+ * variable. The expression used to initiate the refactoring will always be
+ * replaced.
+ */
+ final bool extractAll;
+
+ ExtractLocalVariableOptions(this.name, this.extractAll);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["name"] = name;
+ result["extractAll"] = extractAll;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is ExtractLocalVariableOptions) {
+ return name == other.name &&
+ extractAll == other.extractAll;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, name.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, extractAll.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * extractMethod feedback
+ *
+ * {
+ * "offset": int
+ * "length": int
+ * "returnType": String
+ * "names": List<String>
+ * "canCreateGetter": bool
+ * "parameters": List<RefactoringMethodParameter>
+ * "occurrences": int
+ * "offsets": List<int>
+ * "lengths": List<int>
+ * }
+ */
+class ExtractMethodFeedback {
+ /**
+ * The offset to the beginning of the expression or statements that will be
+ * extracted.
+ */
+ final int offset;
+
+ /**
+ * The length of the expression or statements that will be extracted.
+ */
+ final int length;
+
+ /**
+ * The proposed return type for the method.
+ */
+ final String returnType;
+
+ /**
+ * The proposed names for the method.
+ */
+ final List<String> names;
+
+ /**
+ * True if a getter could be created rather than a method.
+ */
+ final bool canCreateGetter;
+
+ /**
+ * The proposed parameters for the method.
+ */
+ final List<RefactoringMethodParameter> parameters;
+
+ /**
+ * The number of times the expression or statements occurs.
+ */
+ final int occurrences;
+
+ /**
+ * The offsets of the expressions or statements that would be replaced by an
+ * invocation of the method.
+ */
+ final List<int> offsets;
+
+ /**
+ * The lengths of the expressions or statements that would be replaced by an
+ * invocation of the method. The lengths correspond to the offsets. In other
+ * words, for a given expression (or block of statements), if the offset of
+ * that expression is offsets[i], then the length of that expression is
+ * lengths[i].
+ */
+ final List<int> lengths;
+
+ ExtractMethodFeedback(this.offset, this.length, this.returnType, this.names, this.canCreateGetter, this.parameters, this.occurrences, this.offsets, this.lengths);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["offset"] = offset;
+ result["length"] = length;
+ result["returnType"] = returnType;
+ result["names"] = names;
+ result["canCreateGetter"] = canCreateGetter;
+ result["parameters"] = parameters.map((RefactoringMethodParameter value) => value.toJson());
+ result["occurrences"] = occurrences;
+ result["offsets"] = offsets;
+ result["lengths"] = lengths;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is ExtractMethodFeedback) {
+ return offset == other.offset &&
+ length == other.length &&
+ returnType == other.returnType &&
+ names == other.names &&
+ canCreateGetter == other.canCreateGetter &&
+ parameters == other.parameters &&
+ occurrences == other.occurrences &&
+ offsets == other.offsets &&
+ lengths == other.lengths;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, length.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, returnType.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, names.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, canCreateGetter.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, parameters.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, occurrences.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, offsets.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, lengths.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * extractMethod options
+ *
+ * {
+ * "returnType": String
+ * "createGetter": bool
+ * "name": String
+ * "parameters": List<RefactoringMethodParameter>
+ * "extractAll": bool
+ * }
+ */
+class ExtractMethodOptions {
+ /**
+ * The return type that should be defined for the method.
+ */
+ final String returnType;
+
+ /**
+ * True if a getter should be created rather than a method. It is an error if
+ * this field is true and the list of parameters is non-empty.
+ */
+ final bool createGetter;
+
+ /**
+ * The name that the method should be given.
+ */
+ final String name;
+
+ /**
+ * The parameters that should be defined for the method.
+ *
+ * It is an error if a REQUIRED or NAMED parameter follows a POSITIONAL
+ * parameter. It is an error if a REQUIRED or POSITIONAL parameter follows a
+ * NAMED parameter.
+ *
+ * - To change the order and/or update proposed paramerers, add parameters
+ * with the same identifiers as proposed.
+ * - To add new parameters, omit their identifier.
+ * - To remove some parameters, omit them in this list.
+ */
+ final List<RefactoringMethodParameter> parameters;
+
+ /**
+ * True if all occurrences of the expression or statements should be replaced
+ * by an invocation of the method. The expression or statements used to
+ * initiate the refactoring will always be replaced.
+ */
+ final bool extractAll;
+
+ ExtractMethodOptions(this.returnType, this.createGetter, this.name, this.parameters, this.extractAll);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["returnType"] = returnType;
+ result["createGetter"] = createGetter;
+ result["name"] = name;
+ result["parameters"] = parameters.map((RefactoringMethodParameter value) => value.toJson());
+ result["extractAll"] = extractAll;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is ExtractMethodOptions) {
+ return returnType == other.returnType &&
+ createGetter == other.createGetter &&
+ name == other.name &&
+ parameters == other.parameters &&
+ extractAll == other.extractAll;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, returnType.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, createGetter.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, name.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, parameters.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, extractAll.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * inlineMethod options
+ *
+ * {
+ * "deleteSource": bool
+ * "inlineAll": bool
+ * }
+ */
+class InlineMethodOptions {
+ /**
+ * True if the method being inlined should be removed. It is an error if this
+ * field is true and inlineAll is false.
+ */
+ final bool deleteSource;
+
+ /**
+ * True if all invocations of the method should be inlined, or false if only
+ * the invocation site used to create this refactoring should be inlined.
+ */
+ final bool inlineAll;
+
+ InlineMethodOptions(this.deleteSource, this.inlineAll);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["deleteSource"] = deleteSource;
+ result["inlineAll"] = inlineAll;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is InlineMethodOptions) {
+ return deleteSource == other.deleteSource &&
+ inlineAll == other.inlineAll;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, deleteSource.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, inlineAll.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * rename feedback
+ *
+ * {
+ * "offset": int
+ * "length": int
+ * }
+ */
+class RenameFeedback {
+ /**
+ * The offset to the beginning of the name selected to be renamed.
+ */
+ final int offset;
+
+ /**
+ * The length of the name selected to be renamed.
+ */
+ final int length;
+
+ RenameFeedback(this.offset, this.length);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["offset"] = offset;
+ result["length"] = length;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is RenameFeedback) {
+ return offset == other.offset &&
+ length == other.length;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
+ hash = _JenkinsSmiHash.combine(hash, length.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+/**
+ * rename options
+ *
+ * {
+ * "newName": String
+ * }
+ */
+class RenameOptions {
+ /**
+ * The name that the element should have after the refactoring.
+ */
+ final String newName;
+
+ RenameOptions(this.newName);
+
+ Map<String, dynamic> toJson() {
+ Map<String, dynamic> result = {};
+ result["newName"] = newName;
+ return result;
+ }
+
+ String toString() => JSON.encode(toJson());
+
+ bool operator==(other) {
+ if (other is RenameOptions) {
+ return newName == other.newName;
+ }
+ return false;
+ }
+
+ int get hashCode {
+ int hash = 0;
+ hash = _JenkinsSmiHash.combine(hash, newName.hashCode);
+ return _JenkinsSmiHash.finish(hash);
+ }
+}
+
+abstract class JsonDecoder extends JsonDecoderBase {
+
+ ServerGetVersionResult decodeServerGetVersionResult(String jsonPath, Object json) {
Brian Wilkerson 2014/08/18 14:10:16 Consider converting these methods to named constru
Paul Berry 2014/08/18 21:58:03 Done.
+ if (json is Map) {
+ String version;
+ if (json.containsKey("version")) {
+ version = _decodeString(jsonPath + ".version", json["version"]);
+ } else {
+ throw missingKey(jsonPath, "version");
+ }
+ return new ServerGetVersionResult(version);
+ } else {
+ throw mismatch(jsonPath, "server.getVersion result");
+ }
+ }
+
+ ServerSetSubscriptionsParams decodeServerSetSubscriptionsParams(String jsonPath, Object json) {
+ if (json is Map) {
+ List<ServerService> subscriptions;
+ if (json.containsKey("subscriptions")) {
+ subscriptions = _decodeList(jsonPath + ".subscriptions", json["subscriptions"], decodeServerService);
+ } else {
+ throw missingKey(jsonPath, "subscriptions");
+ }
+ return new ServerSetSubscriptionsParams(subscriptions);
+ } else {
+ throw mismatch(jsonPath, "server.setSubscriptions params");
+ }
+ }
+
+ ServerErrorParams decodeServerErrorParams(String jsonPath, Object json) {
+ if (json is Map) {
+ bool fatal;
+ if (json.containsKey("fatal")) {
+ fatal = _decodeBool(jsonPath + ".fatal", json["fatal"]);
+ } else {
+ throw missingKey(jsonPath, "fatal");
+ }
+ String message;
+ if (json.containsKey("message")) {
+ message = _decodeString(jsonPath + ".message", json["message"]);
+ } else {
+ throw missingKey(jsonPath, "message");
+ }
+ String stackTrace;
+ if (json.containsKey("stackTrace")) {
+ stackTrace = _decodeString(jsonPath + ".stackTrace", json["stackTrace"]);
+ } else {
+ throw missingKey(jsonPath, "stackTrace");
+ }
+ return new ServerErrorParams(fatal, message, stackTrace);
+ } else {
+ throw mismatch(jsonPath, "server.error params");
+ }
+ }
+
+ ServerStatusParams decodeServerStatusParams(String jsonPath, Object json) {
+ if (json is Map) {
+ AnalysisStatus analysis;
+ if (json.containsKey("analysis")) {
+ analysis = decodeAnalysisStatus(jsonPath + ".analysis", json["analysis"]);
+ }
+ return new ServerStatusParams(analysis: analysis);
+ } else {
+ throw mismatch(jsonPath, "server.status params");
+ }
+ }
+
+ AnalysisGetErrorsParams decodeAnalysisGetErrorsParams(String jsonPath, Object json) {
+ if (json is Map) {
+ String file;
+ if (json.containsKey("file")) {
+ file = _decodeString(jsonPath + ".file", json["file"]);
+ } else {
+ throw missingKey(jsonPath, "file");
+ }
+ return new AnalysisGetErrorsParams(file);
+ } else {
+ throw mismatch(jsonPath, "analysis.getErrors params");
+ }
+ }
+
+ AnalysisGetErrorsResult decodeAnalysisGetErrorsResult(String jsonPath, Object json) {
+ if (json is Map) {
+ List<AnalysisError> errors;
+ if (json.containsKey("errors")) {
+ errors = _decodeList(jsonPath + ".errors", json["errors"], decodeAnalysisError);
+ } else {
+ throw missingKey(jsonPath, "errors");
+ }
+ return new AnalysisGetErrorsResult(errors);
+ } else {
+ throw mismatch(jsonPath, "analysis.getErrors result");
+ }
+ }
+
+ AnalysisGetHoverParams decodeAnalysisGetHoverParams(String jsonPath, Object json) {
+ if (json is Map) {
+ String file;
+ if (json.containsKey("file")) {
+ file = _decodeString(jsonPath + ".file", json["file"]);
+ } else {
+ throw missingKey(jsonPath, "file");
+ }
+ int offset;
+ if (json.containsKey("offset")) {
+ offset = _decodeInt(jsonPath + ".offset", json["offset"]);
+ } else {
+ throw missingKey(jsonPath, "offset");
+ }
+ return new AnalysisGetHoverParams(file, offset);
+ } else {
+ throw mismatch(jsonPath, "analysis.getHover params");
+ }
+ }
+
+ AnalysisGetHoverResult decodeAnalysisGetHoverResult(String jsonPath, Object json) {
+ if (json is Map) {
+ List<HoverInformation> hovers;
+ if (json.containsKey("hovers")) {
+ hovers = _decodeList(jsonPath + ".hovers", json["hovers"], decodeHoverInformation);
+ } else {
+ throw missingKey(jsonPath, "hovers");
+ }
+ return new AnalysisGetHoverResult(hovers);
+ } else {
+ throw mismatch(jsonPath, "analysis.getHover result");
+ }
+ }
+
+ AnalysisSetAnalysisRootsParams decodeAnalysisSetAnalysisRootsParams(String jsonPath, Object json) {
+ if (json is Map) {
+ List<String> included;
+ if (json.containsKey("included")) {
+ included = _decodeList(jsonPath + ".included", json["included"], _decodeString);
+ } else {
+ throw missingKey(jsonPath, "included");
+ }
+ List<String> excluded;
+ if (json.containsKey("excluded")) {
+ excluded = _decodeList(jsonPath + ".excluded", json["excluded"], _decodeString);
+ } else {
+ throw missingKey(jsonPath, "excluded");
+ }
+ return new AnalysisSetAnalysisRootsParams(included, excluded);
+ } else {
+ throw mismatch(jsonPath, "analysis.setAnalysisRoots params");
+ }
+ }
+
+ AnalysisSetPriorityFilesParams decodeAnalysisSetPriorityFilesParams(String jsonPath, Object json) {
+ if (json is Map) {
+ List<String> files;
+ if (json.containsKey("files")) {
+ files = _decodeList(jsonPath + ".files", json["files"], _decodeString);
+ } else {
+ throw missingKey(jsonPath, "files");
+ }
+ return new AnalysisSetPriorityFilesParams(files);
+ } else {
+ throw mismatch(jsonPath, "analysis.setPriorityFiles params");
+ }
+ }
+
+ AnalysisSetSubscriptionsParams decodeAnalysisSetSubscriptionsParams(String jsonPath, Object json) {
+ if (json is Map) {
+ Map<AnalysisService, List<String>> subscriptions;
+ if (json.containsKey("subscriptions")) {
+ subscriptions = _decodeMap(jsonPath + ".subscriptions", json["subscriptions"], keyDecoder: decodeAnalysisService, valueDecoder: (String jsonPath, Object json) => _decodeList(jsonPath, json, _decodeString));
+ } else {
+ throw missingKey(jsonPath, "subscriptions");
+ }
+ return new AnalysisSetSubscriptionsParams(subscriptions);
+ } else {
+ throw mismatch(jsonPath, "analysis.setSubscriptions params");
+ }
+ }
+
+ AnalysisUpdateContentParams decodeAnalysisUpdateContentParams(String jsonPath, Object json) {
+ if (json is Map) {
+ Map<String, dynamic> files;
+ if (json.containsKey("files")) {
+ files = _decodeMap(jsonPath + ".files", json["files"], valueDecoder: (String jsonPath, Object json) => _decodeUnion(jsonPath, json, "type", {"add": decodeAddContentOverlay, "change": decodeChangeContentOverlay, "remove": decodeRemoveContentOverlay}));
+ } else {
+ throw missingKey(jsonPath, "files");
+ }
+ return new AnalysisUpdateContentParams(files);
+ } else {
+ throw mismatch(jsonPath, "analysis.updateContent params");
+ }
+ }
+
+ AnalysisUpdateOptionsParams decodeAnalysisUpdateOptionsParams(String jsonPath, Object json) {
+ if (json is Map) {
+ AnalysisOptions options;
+ if (json.containsKey("options")) {
+ options = decodeAnalysisOptions(jsonPath + ".options", json["options"]);
+ } else {
+ throw missingKey(jsonPath, "options");
+ }
+ return new AnalysisUpdateOptionsParams(options);
+ } else {
+ throw mismatch(jsonPath, "analysis.updateOptions params");
+ }
+ }
+
+ AnalysisErrorsParams decodeAnalysisErrorsParams(String jsonPath, Object json) {
+ if (json is Map) {
+ String file;
+ if (json.containsKey("file")) {
+ file = _decodeString(jsonPath + ".file", json["file"]);
+ } else {
+ throw missingKey(jsonPath, "file");
+ }
+ List<AnalysisError> errors;
+ if (json.containsKey("errors")) {
+ errors = _decodeList(jsonPath + ".errors", json["errors"], decodeAnalysisError);
+ } else {
+ throw missingKey(jsonPath, "errors");
+ }
+ return new AnalysisErrorsParams(file, errors);
+ } else {
+ throw mismatch(jsonPath, "analysis.errors params");
+ }
+ }
+
+ AnalysisFlushResultsParams decodeAnalysisFlushResultsParams(String jsonPath, Object json) {
+ if (json is Map) {
+ List<String> files;
+ if (json.containsKey("files")) {
+ files = _decodeList(jsonPath + ".files", json["files"], _decodeString);
+ } else {
+ throw missingKey(jsonPath, "files");
+ }
+ return new AnalysisFlushResultsParams(files);
+ } else {
+ throw mismatch(jsonPath, "analysis.flushResults params");
+ }
+ }
+
+ AnalysisFoldingParams decodeAnalysisFoldingParams(String jsonPath, Object json) {
+ if (json is Map) {
+ String file;
+ if (json.containsKey("file")) {
+ file = _decodeString(jsonPath + ".file", json["file"]);
+ } else {
+ throw missingKey(jsonPath, "file");
+ }
+ List<FoldingRegion> regions;
+ if (json.containsKey("regions")) {
+ regions = _decodeList(jsonPath + ".regions", json["regions"], decodeFoldingRegion);
+ } else {
+ throw missingKey(jsonPath, "regions");
+ }
+ return new AnalysisFoldingParams(file, regions);
+ } else {
+ throw mismatch(jsonPath, "analysis.folding params");
+ }
+ }
+
+ AnalysisHighlightsParams decodeAnalysisHighlightsParams(String jsonPath, Object json) {
+ if (json is Map) {
+ String file;
+ if (json.containsKey("file")) {
+ file = _decodeString(jsonPath + ".file", json["file"]);
+ } else {
+ throw missingKey(jsonPath, "file");
+ }
+ List<HighlightRegion> regions;
+ if (json.containsKey("regions")) {
+ regions = _decodeList(jsonPath + ".regions", json["regions"], decodeHighlightRegion);
+ } else {
+ throw missingKey(jsonPath, "regions");
+ }
+ return new AnalysisHighlightsParams(file, regions);
+ } else {
+ throw mismatch(jsonPath, "analysis.highlights params");
+ }
+ }
+
+ AnalysisNavigationParams decodeAnalysisNavigationParams(String jsonPath, Object json) {
+ if (json is Map) {
+ String file;
+ if (json.containsKey("file")) {
+ file = _decodeString(jsonPath + ".file", json["file"]);
+ } else {
+ throw missingKey(jsonPath, "file");
+ }
+ List<NavigationRegion> regions;
+ if (json.containsKey("regions")) {
+ regions = _decodeList(jsonPath + ".regions", json["regions"], decodeNavigationRegion);
+ } else {
+ throw missingKey(jsonPath, "regions");
+ }
+ return new AnalysisNavigationParams(file, regions);
+ } else {
+ throw mismatch(jsonPath, "analysis.navigation params");
+ }
+ }
+
+ AnalysisOccurrencesParams decodeAnalysisOccurrencesParams(String jsonPath, Object json) {
+ if (json is Map) {
+ String file;
+ if (json.containsKey("file")) {
+ file = _decodeString(jsonPath + ".file", json["file"]);
+ } else {
+ throw missingKey(jsonPath, "file");
+ }
+ List<Occurrences> occurrences;
+ if (json.containsKey("occurrences")) {
+ occurrences = _decodeList(jsonPath + ".occurrences", json["occurrences"], decodeOccurrences);
+ } else {
+ throw missingKey(jsonPath, "occurrences");
+ }
+ return new AnalysisOccurrencesParams(file, occurrences);
+ } else {
+ throw mismatch(jsonPath, "analysis.occurrences params");
+ }
+ }
+
+ AnalysisOutlineParams decodeAnalysisOutlineParams(String jsonPath, Object json) {
+ if (json is Map) {
+ String file;
+ if (json.containsKey("file")) {
+ file = _decodeString(jsonPath + ".file", json["file"]);
+ } else {
+ throw missingKey(jsonPath, "file");
+ }
+ Outline outline;
+ if (json.containsKey("outline")) {
+ outline = decodeOutline(jsonPath + ".outline", json["outline"]);
+ } else {
+ throw missingKey(jsonPath, "outline");
+ }
+ return new AnalysisOutlineParams(file, outline);
+ } else {
+ throw mismatch(jsonPath, "analysis.outline params");
+ }
+ }
+
+ AnalysisOverridesParams decodeAnalysisOverridesParams(String jsonPath, Object json) {
+ if (json is Map) {
+ String file;
+ if (json.containsKey("file")) {
+ file = _decodeString(jsonPath + ".file", json["file"]);
+ } else {
+ throw missingKey(jsonPath, "file");
+ }
+ List<Override> overrides;
+ if (json.containsKey("overrides")) {
+ overrides = _decodeList(jsonPath + ".overrides", json["overrides"], decodeOverride);
+ } else {
+ throw missingKey(jsonPath, "overrides");
+ }
+ return new AnalysisOverridesParams(file, overrides);
+ } else {
+ throw mismatch(jsonPath, "analysis.overrides params");
+ }
+ }
+
+ CompletionGetSuggestionsParams decodeCompletionGetSuggestionsParams(String jsonPath, Object json) {
+ if (json is Map) {
+ String file;
+ if (json.containsKey("file")) {
+ file = _decodeString(jsonPath + ".file", json["file"]);
+ } else {
+ throw missingKey(jsonPath, "file");
+ }
+ int offset;
+ if (json.containsKey("offset")) {
+ offset = _decodeInt(jsonPath + ".offset", json["offset"]);
+ } else {
+ throw missingKey(jsonPath, "offset");
+ }
+ return new CompletionGetSuggestionsParams(file, offset);
+ } else {
+ throw mismatch(jsonPath, "completion.getSuggestions params");
+ }
+ }
+
+ CompletionGetSuggestionsResult decodeCompletionGetSuggestionsResult(String jsonPath, Object json) {
+ if (json is Map) {
+ String id;
+ if (json.containsKey("id")) {
+ id = _decodeString(jsonPath + ".id", json["id"]);
+ } else {
+ throw missingKey(jsonPath, "id");
+ }
+ return new CompletionGetSuggestionsResult(id);
+ } else {
+ throw mismatch(jsonPath, "completion.getSuggestions result");
+ }
+ }
+
+ CompletionResultsParams decodeCompletionResultsParams(String jsonPath, Object json) {
+ if (json is Map) {
+ String id;
+ if (json.containsKey("id")) {
+ id = _decodeString(jsonPath + ".id", json["id"]);
+ } else {
+ throw missingKey(jsonPath, "id");
+ }
+ int replacementOffset;
+ if (json.containsKey("replacementOffset")) {
+ replacementOffset = _decodeInt(jsonPath + ".replacementOffset", json["replacementOffset"]);
+ } else {
+ throw missingKey(jsonPath, "replacementOffset");
+ }
+ int replacementLength;
+ if (json.containsKey("replacementLength")) {
+ replacementLength = _decodeInt(jsonPath + ".replacementLength", json["replacementLength"]);
+ } else {
+ throw missingKey(jsonPath, "replacementLength");
+ }
+ List<CompletionSuggestion> results;
+ if (json.containsKey("results")) {
+ results = _decodeList(jsonPath + ".results", json["results"], decodeCompletionSuggestion);
+ } else {
+ throw missingKey(jsonPath, "results");
+ }
+ bool last;
+ if (json.containsKey("last")) {
+ last = _decodeBool(jsonPath + ".last", json["last"]);
+ } else {
+ throw missingKey(jsonPath, "last");
+ }
+ return new CompletionResultsParams(id, replacementOffset, replacementLength, results, last);
+ } else {
+ throw mismatch(jsonPath, "completion.results params");
+ }
+ }
+
+ SearchFindElementReferencesParams decodeSearchFindElementReferencesParams(String jsonPath, Object json) {
+ if (json is Map) {
+ String file;
+ if (json.containsKey("file")) {
+ file = _decodeString(jsonPath + ".file", json["file"]);
+ } else {
+ throw missingKey(jsonPath, "file");
+ }
+ int offset;
+ if (json.containsKey("offset")) {
+ offset = _decodeInt(jsonPath + ".offset", json["offset"]);
+ } else {
+ throw missingKey(jsonPath, "offset");
+ }
+ bool includePotential;
+ if (json.containsKey("includePotential")) {
+ includePotential = _decodeBool(jsonPath + ".includePotential", json["includePotential"]);
+ } else {
+ throw missingKey(jsonPath, "includePotential");
+ }
+ return new SearchFindElementReferencesParams(file, offset, includePotential);
+ } else {
+ throw mismatch(jsonPath, "search.findElementReferences params");
+ }
+ }
+
+ SearchFindElementReferencesResult decodeSearchFindElementReferencesResult(String jsonPath, Object json) {
+ if (json is Map) {
+ String id;
+ if (json.containsKey("id")) {
+ id = _decodeString(jsonPath + ".id", json["id"]);
+ } else {
+ throw missingKey(jsonPath, "id");
+ }
+ Element element;
+ if (json.containsKey("element")) {
+ element = decodeElement(jsonPath + ".element", json["element"]);
+ } else {
+ throw missingKey(jsonPath, "element");
+ }
+ return new SearchFindElementReferencesResult(id, element);
+ } else {
+ throw mismatch(jsonPath, "search.findElementReferences result");
+ }
+ }
+
+ SearchFindMemberDeclarationsParams decodeSearchFindMemberDeclarationsParams(String jsonPath, Object json) {
+ if (json is Map) {
+ String name;
+ if (json.containsKey("name")) {
+ name = _decodeString(jsonPath + ".name", json["name"]);
+ } else {
+ throw missingKey(jsonPath, "name");
+ }
+ return new SearchFindMemberDeclarationsParams(name);
+ } else {
+ throw mismatch(jsonPath, "search.findMemberDeclarations params");
+ }
+ }
+
+ SearchFindMemberDeclarationsResult decodeSearchFindMemberDeclarationsResult(String jsonPath, Object json) {
+ if (json is Map) {
+ String id;
+ if (json.containsKey("id")) {
+ id = _decodeString(jsonPath + ".id", json["id"]);
+ } else {
+ throw missingKey(jsonPath, "id");
+ }
+ return new SearchFindMemberDeclarationsResult(id);
+ } else {
+ throw mismatch(jsonPath, "search.findMemberDeclarations result");
+ }
+ }
+
+ SearchFindMemberReferencesParams decodeSearchFindMemberReferencesParams(String jsonPath, Object json) {
+ if (json is Map) {
+ String name;
+ if (json.containsKey("name")) {
+ name = _decodeString(jsonPath + ".name", json["name"]);
+ } else {
+ throw missingKey(jsonPath, "name");
+ }
+ return new SearchFindMemberReferencesParams(name);
+ } else {
+ throw mismatch(jsonPath, "search.findMemberReferences params");
+ }
+ }
+
+ SearchFindMemberReferencesResult decodeSearchFindMemberReferencesResult(String jsonPath, Object json) {
+ if (json is Map) {
+ String id;
+ if (json.containsKey("id")) {
+ id = _decodeString(jsonPath + ".id", json["id"]);
+ } else {
+ throw missingKey(jsonPath, "id");
+ }
+ return new SearchFindMemberReferencesResult(id);
+ } else {
+ throw mismatch(jsonPath, "search.findMemberReferences result");
+ }
+ }
+
+ SearchFindTopLevelDeclarationsParams decodeSearchFindTopLevelDeclarationsParams(String jsonPath, Object json) {
+ if (json is Map) {
+ String pattern;
+ if (json.containsKey("pattern")) {
+ pattern = _decodeString(jsonPath + ".pattern", json["pattern"]);
+ } else {
+ throw missingKey(jsonPath, "pattern");
+ }
+ return new SearchFindTopLevelDeclarationsParams(pattern);
+ } else {
+ throw mismatch(jsonPath, "search.findTopLevelDeclarations params");
+ }
+ }
+
+ SearchFindTopLevelDeclarationsResult decodeSearchFindTopLevelDeclarationsResult(String jsonPath, Object json) {
+ if (json is Map) {
+ String id;
+ if (json.containsKey("id")) {
+ id = _decodeString(jsonPath + ".id", json["id"]);
+ } else {
+ throw missingKey(jsonPath, "id");
+ }
+ return new SearchFindTopLevelDeclarationsResult(id);
+ } else {
+ throw mismatch(jsonPath, "search.findTopLevelDeclarations result");
+ }
+ }
+
+ SearchGetTypeHierarchyParams decodeSearchGetTypeHierarchyParams(String jsonPath, Object json) {
+ if (json is Map) {
+ String file;
+ if (json.containsKey("file")) {
+ file = _decodeString(jsonPath + ".file", json["file"]);
+ } else {
+ throw missingKey(jsonPath, "file");
+ }
+ int offset;
+ if (json.containsKey("offset")) {
+ offset = _decodeInt(jsonPath + ".offset", json["offset"]);
+ } else {
+ throw missingKey(jsonPath, "offset");
+ }
+ return new SearchGetTypeHierarchyParams(file, offset);
+ } else {
+ throw mismatch(jsonPath, "search.getTypeHierarchy params");
+ }
+ }
+
+ SearchGetTypeHierarchyResult decodeSearchGetTypeHierarchyResult(String jsonPath, Object json) {
+ if (json is Map) {
+ List<TypeHierarchyItem> hierarchyItems;
+ if (json.containsKey("hierarchyItems")) {
+ hierarchyItems = _decodeList(jsonPath + ".hierarchyItems", json["hierarchyItems"], decodeTypeHierarchyItem);
+ }
+ return new SearchGetTypeHierarchyResult(hierarchyItems: hierarchyItems);
+ } else {
+ throw mismatch(jsonPath, "search.getTypeHierarchy result");
+ }
+ }
+
+ SearchResultsParams decodeSearchResultsParams(String jsonPath, Object json) {
+ if (json is Map) {
+ String id;
+ if (json.containsKey("id")) {
+ id = _decodeString(jsonPath + ".id", json["id"]);
+ } else {
+ throw missingKey(jsonPath, "id");
+ }
+ List<SearchResult> results;
+ if (json.containsKey("results")) {
+ results = _decodeList(jsonPath + ".results", json["results"], decodeSearchResult);
+ } else {
+ throw missingKey(jsonPath, "results");
+ }
+ bool last;
+ if (json.containsKey("last")) {
+ last = _decodeBool(jsonPath + ".last", json["last"]);
+ } else {
+ throw missingKey(jsonPath, "last");
+ }
+ return new SearchResultsParams(id, results, last);
+ } else {
+ throw mismatch(jsonPath, "search.results params");
+ }
+ }
+
+ EditGetAssistsParams decodeEditGetAssistsParams(String jsonPath, Object json) {
+ if (json is Map) {
+ String file;
+ if (json.containsKey("file")) {
+ file = _decodeString(jsonPath + ".file", json["file"]);
+ } else {
+ throw missingKey(jsonPath, "file");
+ }
+ int offset;
+ if (json.containsKey("offset")) {
+ offset = _decodeInt(jsonPath + ".offset", json["offset"]);
+ } else {
+ throw missingKey(jsonPath, "offset");
+ }
+ int length;
+ if (json.containsKey("length")) {
+ length = _decodeInt(jsonPath + ".length", json["length"]);
+ } else {
+ throw missingKey(jsonPath, "length");
+ }
+ return new EditGetAssistsParams(file, offset, length);
+ } else {
+ throw mismatch(jsonPath, "edit.getAssists params");
+ }
+ }
+
+ EditGetAssistsResult decodeEditGetAssistsResult(String jsonPath, Object json) {
+ if (json is Map) {
+ List<SourceChange> assists;
+ if (json.containsKey("assists")) {
+ assists = _decodeList(jsonPath + ".assists", json["assists"], decodeSourceChange);
+ } else {
+ throw missingKey(jsonPath, "assists");
+ }
+ return new EditGetAssistsResult(assists);
+ } else {
+ throw mismatch(jsonPath, "edit.getAssists result");
+ }
+ }
+
+ EditGetAvailableRefactoringsParams decodeEditGetAvailableRefactoringsParams(String jsonPath, Object json) {
+ if (json is Map) {
+ String file;
+ if (json.containsKey("file")) {
+ file = _decodeString(jsonPath + ".file", json["file"]);
+ } else {
+ throw missingKey(jsonPath, "file");
+ }
+ int offset;
+ if (json.containsKey("offset")) {
+ offset = _decodeInt(jsonPath + ".offset", json["offset"]);
+ } else {
+ throw missingKey(jsonPath, "offset");
+ }
+ int length;
+ if (json.containsKey("length")) {
+ length = _decodeInt(jsonPath + ".length", json["length"]);
+ } else {
+ throw missingKey(jsonPath, "length");
+ }
+ return new EditGetAvailableRefactoringsParams(file, offset, length);
+ } else {
+ throw mismatch(jsonPath, "edit.getAvailableRefactorings params");
+ }
+ }
+
+ EditGetAvailableRefactoringsResult decodeEditGetAvailableRefactoringsResult(String jsonPath, Object json) {
+ if (json is Map) {
+ List<RefactoringKind> kinds;
+ if (json.containsKey("kinds")) {
+ kinds = _decodeList(jsonPath + ".kinds", json["kinds"], decodeRefactoringKind);
+ } else {
+ throw missingKey(jsonPath, "kinds");
+ }
+ return new EditGetAvailableRefactoringsResult(kinds);
+ } else {
+ throw mismatch(jsonPath, "edit.getAvailableRefactorings result");
+ }
+ }
+
+ EditGetFixesParams decodeEditGetFixesParams(String jsonPath, Object json) {
+ if (json is Map) {
+ String file;
+ if (json.containsKey("file")) {
+ file = _decodeString(jsonPath + ".file", json["file"]);
+ } else {
+ throw missingKey(jsonPath, "file");
+ }
+ int offset;
+ if (json.containsKey("offset")) {
+ offset = _decodeInt(jsonPath + ".offset", json["offset"]);
+ } else {
+ throw missingKey(jsonPath, "offset");
+ }
+ return new EditGetFixesParams(file, offset);
+ } else {
+ throw mismatch(jsonPath, "edit.getFixes params");
+ }
+ }
+
+ EditGetFixesResult decodeEditGetFixesResult(String jsonPath, Object json) {
+ if (json is Map) {
+ List<ErrorFixes> fixes;
+ if (json.containsKey("fixes")) {
+ fixes = _decodeList(jsonPath + ".fixes", json["fixes"], decodeErrorFixes);
+ } else {
+ throw missingKey(jsonPath, "fixes");
+ }
+ return new EditGetFixesResult(fixes);
+ } else {
+ throw mismatch(jsonPath, "edit.getFixes result");
+ }
+ }
+
+ EditGetRefactoringParams decodeEditGetRefactoringParams(String jsonPath, Object json) {
+ if (json is Map) {
+ RefactoringKind kindId;
+ if (json.containsKey("kindId")) {
+ kindId = decodeRefactoringKind(jsonPath + ".kindId", json["kindId"]);
+ } else {
+ throw missingKey(jsonPath, "kindId");
+ }
+ String file;
+ if (json.containsKey("file")) {
+ file = _decodeString(jsonPath + ".file", json["file"]);
+ } else {
+ throw missingKey(jsonPath, "file");
+ }
+ int offset;
+ if (json.containsKey("offset")) {
+ offset = _decodeInt(jsonPath + ".offset", json["offset"]);
+ } else {
+ throw missingKey(jsonPath, "offset");
+ }
+ int length;
+ if (json.containsKey("length")) {
+ length = _decodeInt(jsonPath + ".length", json["length"]);
+ } else {
+ throw missingKey(jsonPath, "length");
+ }
+ bool validateOnly;
+ if (json.containsKey("validateOnly")) {
+ validateOnly = _decodeBool(jsonPath + ".validateOnly", json["validateOnly"]);
+ } else {
+ throw missingKey(jsonPath, "validateOnly");
+ }
+ Object options;
+ if (json.containsKey("options")) {
+ options = json["options"];
+ }
+ return new EditGetRefactoringParams(kindId, file, offset, length, validateOnly, options: options);
+ } else {
+ throw mismatch(jsonPath, "edit.getRefactoring params");
+ }
+ }
+
+ EditGetRefactoringResult decodeEditGetRefactoringResult(String jsonPath, Object json) {
+ if (json is Map) {
+ List<RefactoringProblem> status;
+ if (json.containsKey("status")) {
+ status = _decodeList(jsonPath + ".status", json["status"], decodeRefactoringProblem);
+ } else {
+ throw missingKey(jsonPath, "status");
+ }
+ Object feedback;
+ if (json.containsKey("feedback")) {
+ feedback = json["feedback"];
+ }
+ SourceChange change;
+ if (json.containsKey("change")) {
+ change = decodeSourceChange(jsonPath + ".change", json["change"]);
+ }
+ List<String> potentialEdits;
+ if (json.containsKey("potentialEdits")) {
+ potentialEdits = _decodeList(jsonPath + ".potentialEdits", json["potentialEdits"], _decodeString);
+ }
+ return new EditGetRefactoringResult(status, feedback: feedback, change: change, potentialEdits: potentialEdits);
+ } else {
+ throw mismatch(jsonPath, "edit.getRefactoring result");
+ }
+ }
+
+ DebugCreateContextParams decodeDebugCreateContextParams(String jsonPath, Object json) {
+ if (json is Map) {
+ String contextRoot;
+ if (json.containsKey("contextRoot")) {
+ contextRoot = _decodeString(jsonPath + ".contextRoot", json["contextRoot"]);
+ } else {
+ throw missingKey(jsonPath, "contextRoot");
+ }
+ return new DebugCreateContextParams(contextRoot);
+ } else {
+ throw mismatch(jsonPath, "debug.createContext params");
+ }
+ }
+
+ DebugCreateContextResult decodeDebugCreateContextResult(String jsonPath, Object json) {
+ if (json is Map) {
+ String id;
+ if (json.containsKey("id")) {
+ id = _decodeString(jsonPath + ".id", json["id"]);
+ } else {
+ throw missingKey(jsonPath, "id");
+ }
+ return new DebugCreateContextResult(id);
+ } else {
+ throw mismatch(jsonPath, "debug.createContext result");
+ }
+ }
+
+ DebugDeleteContextParams decodeDebugDeleteContextParams(String jsonPath, Object json) {
+ if (json is Map) {
+ String id;
+ if (json.containsKey("id")) {
+ id = _decodeString(jsonPath + ".id", json["id"]);
+ } else {
+ throw missingKey(jsonPath, "id");
+ }
+ return new DebugDeleteContextParams(id);
+ } else {
+ throw mismatch(jsonPath, "debug.deleteContext params");
+ }
+ }
+
+ DebugMapUriParams decodeDebugMapUriParams(String jsonPath, Object json) {
+ if (json is Map) {
+ String id;
+ if (json.containsKey("id")) {
+ id = _decodeString(jsonPath + ".id", json["id"]);
+ } else {
+ throw missingKey(jsonPath, "id");
+ }
+ String file;
+ if (json.containsKey("file")) {
+ file = _decodeString(jsonPath + ".file", json["file"]);
+ }
+ String uri;
+ if (json.containsKey("uri")) {
+ uri = _decodeString(jsonPath + ".uri", json["uri"]);
+ }
+ return new DebugMapUriParams(id, file: file, uri: uri);
+ } else {
+ throw mismatch(jsonPath, "debug.mapUri params");
+ }
+ }
+
+ DebugMapUriResult decodeDebugMapUriResult(String jsonPath, Object json) {
+ if (json is Map) {
+ String file;
+ if (json.containsKey("file")) {
+ file = _decodeString(jsonPath + ".file", json["file"]);
+ }
+ String uri;
+ if (json.containsKey("uri")) {
+ uri = _decodeString(jsonPath + ".uri", json["uri"]);
+ }
+ return new DebugMapUriResult(file: file, uri: uri);
+ } else {
+ throw mismatch(jsonPath, "debug.mapUri result");
+ }
+ }
+
+ DebugSetSubscriptionsParams decodeDebugSetSubscriptionsParams(String jsonPath, Object json) {
+ if (json is Map) {
+ List<DebugService> subscriptions;
+ if (json.containsKey("subscriptions")) {
+ subscriptions = _decodeList(jsonPath + ".subscriptions", json["subscriptions"], decodeDebugService);
+ } else {
+ throw missingKey(jsonPath, "subscriptions");
+ }
+ return new DebugSetSubscriptionsParams(subscriptions);
+ } else {
+ throw mismatch(jsonPath, "debug.setSubscriptions params");
+ }
+ }
+
+ DebugLaunchDataParams decodeDebugLaunchDataParams(String jsonPath, Object json) {
+ if (json is Map) {
+ List<ExecutableFile> executables;
+ if (json.containsKey("executables")) {
+ executables = _decodeList(jsonPath + ".executables", json["executables"], decodeExecutableFile);
+ } else {
+ throw missingKey(jsonPath, "executables");
+ }
+ Map<String, List<String>> dartToHtml;
+ if (json.containsKey("dartToHtml")) {
+ dartToHtml = _decodeMap(jsonPath + ".dartToHtml", json["dartToHtml"], valueDecoder: (String jsonPath, Object json) => _decodeList(jsonPath, json, _decodeString));
+ } else {
+ throw missingKey(jsonPath, "dartToHtml");
+ }
+ Map<String, List<String>> htmlToDart;
+ if (json.containsKey("htmlToDart")) {
+ htmlToDart = _decodeMap(jsonPath + ".htmlToDart", json["htmlToDart"], valueDecoder: (String jsonPath, Object json) => _decodeList(jsonPath, json, _decodeString));
+ } else {
+ throw missingKey(jsonPath, "htmlToDart");
+ }
+ return new DebugLaunchDataParams(executables, dartToHtml, htmlToDart);
+ } else {
+ throw mismatch(jsonPath, "debug.launchData params");
+ }
+ }
+
+ AddContentOverlay decodeAddContentOverlay(String jsonPath, Object json) {
+ if (json is Map) {
+ if (json["type"] != "add") {
+ throw mismatch(jsonPath, "equal " + "add");
+ }
+ String content;
+ if (json.containsKey("content")) {
+ content = _decodeString(jsonPath + ".content", json["content"]);
+ } else {
+ throw missingKey(jsonPath, "content");
+ }
+ return new AddContentOverlay(content);
+ } else {
+ throw mismatch(jsonPath, "AddContentOverlay");
+ }
+ }
+
+ AnalysisError decodeAnalysisError(String jsonPath, Object json) {
+ if (json is Map) {
+ ErrorSeverity severity;
+ if (json.containsKey("severity")) {
+ severity = decodeErrorSeverity(jsonPath + ".severity", json["severity"]);
+ } else {
+ throw missingKey(jsonPath, "severity");
+ }
+ ErrorType type;
+ if (json.containsKey("type")) {
+ type = decodeErrorType(jsonPath + ".type", json["type"]);
+ } else {
+ throw missingKey(jsonPath, "type");
+ }
+ Location location;
+ if (json.containsKey("location")) {
+ location = decodeLocation(jsonPath + ".location", json["location"]);
+ } else {
+ throw missingKey(jsonPath, "location");
+ }
+ String message;
+ if (json.containsKey("message")) {
+ message = _decodeString(jsonPath + ".message", json["message"]);
+ } else {
+ throw missingKey(jsonPath, "message");
+ }
+ String correction;
+ if (json.containsKey("correction")) {
+ correction = _decodeString(jsonPath + ".correction", json["correction"]);
+ }
+ return new AnalysisError(severity, type, location, message, correction: correction);
+ } else {
+ throw mismatch(jsonPath, "AnalysisError");
+ }
+ }
+
+ AnalysisOptions decodeAnalysisOptions(String jsonPath, Object json) {
+ if (json is Map) {
+ bool enableAsync;
+ if (json.containsKey("enableAsync")) {
danrubel 2014/08/17 17:10:20 Is the containsKey check needed here? Will the map
Paul Berry 2014/08/18 21:58:03 That suggestion would create a semantic difference
+ enableAsync = _decodeBool(jsonPath + ".enableAsync", json["enableAsync"]);
+ }
+ bool enableDeferredLoading;
+ if (json.containsKey("enableDeferredLoading")) {
+ enableDeferredLoading = _decodeBool(jsonPath + ".enableDeferredLoading", json["enableDeferredLoading"]);
+ }
+ bool enableEnums;
+ if (json.containsKey("enableEnums")) {
+ enableEnums = _decodeBool(jsonPath + ".enableEnums", json["enableEnums"]);
+ }
+ bool generateDart2jsHints;
+ if (json.containsKey("generateDart2jsHints")) {
+ generateDart2jsHints = _decodeBool(jsonPath + ".generateDart2jsHints", json["generateDart2jsHints"]);
+ }
+ bool generateHints;
+ if (json.containsKey("generateHints")) {
+ generateHints = _decodeBool(jsonPath + ".generateHints", json["generateHints"]);
+ }
+ return new AnalysisOptions(enableAsync: enableAsync, enableDeferredLoading: enableDeferredLoading, enableEnums: enableEnums, generateDart2jsHints: generateDart2jsHints, generateHints: generateHints);
+ } else {
+ throw mismatch(jsonPath, "AnalysisOptions");
+ }
+ }
+
+ AnalysisService decodeAnalysisService(String jsonPath, Object json) {
+ if (json is String) {
+ try {
+ return new AnalysisService(json);
+ } catch(_) {
+ // Fall through
+ }
+ }
+ throw mismatch(jsonPath, "AnalysisService");
+ }
+
+ AnalysisStatus decodeAnalysisStatus(String jsonPath, Object json) {
+ if (json is Map) {
+ bool analyzing;
+ if (json.containsKey("analyzing")) {
+ analyzing = _decodeBool(jsonPath + ".analyzing", json["analyzing"]);
+ } else {
+ throw missingKey(jsonPath, "analyzing");
+ }
+ String analysisTarget;
+ if (json.containsKey("analysisTarget")) {
+ analysisTarget = _decodeString(jsonPath + ".analysisTarget", json["analysisTarget"]);
+ }
+ return new AnalysisStatus(analyzing, analysisTarget: analysisTarget);
+ } else {
+ throw mismatch(jsonPath, "AnalysisStatus");
+ }
+ }
+
+ ChangeContentOverlay decodeChangeContentOverlay(String jsonPath, Object json) {
+ if (json is Map) {
+ if (json["type"] != "change") {
+ throw mismatch(jsonPath, "equal " + "change");
+ }
+ List<SourceEdit> edits;
+ if (json.containsKey("edits")) {
+ edits = _decodeList(jsonPath + ".edits", json["edits"], decodeSourceEdit);
+ } else {
+ throw missingKey(jsonPath, "edits");
+ }
+ return new ChangeContentOverlay(edits);
+ } else {
+ throw mismatch(jsonPath, "ChangeContentOverlay");
+ }
+ }
+
+ CompletionRelevance decodeCompletionRelevance(String jsonPath, Object json) {
+ if (json is String) {
+ try {
+ return new CompletionRelevance(json);
+ } catch(_) {
+ // Fall through
+ }
+ }
+ throw mismatch(jsonPath, "CompletionRelevance");
+ }
+
+ CompletionSuggestion decodeCompletionSuggestion(String jsonPath, Object json) {
+ if (json is Map) {
+ CompletionSuggestionKind kind;
+ if (json.containsKey("kind")) {
+ kind = decodeCompletionSuggestionKind(jsonPath + ".kind", json["kind"]);
+ } else {
+ throw missingKey(jsonPath, "kind");
+ }
+ CompletionRelevance relevance;
+ if (json.containsKey("relevance")) {
+ relevance = decodeCompletionRelevance(jsonPath + ".relevance", json["relevance"]);
+ } else {
+ throw missingKey(jsonPath, "relevance");
+ }
+ String completion;
+ if (json.containsKey("completion")) {
+ completion = _decodeString(jsonPath + ".completion", json["completion"]);
+ } else {
+ throw missingKey(jsonPath, "completion");
+ }
+ int selectionOffset;
+ if (json.containsKey("selectionOffset")) {
+ selectionOffset = _decodeInt(jsonPath + ".selectionOffset", json["selectionOffset"]);
+ } else {
+ throw missingKey(jsonPath, "selectionOffset");
+ }
+ int selectionLength;
+ if (json.containsKey("selectionLength")) {
+ selectionLength = _decodeInt(jsonPath + ".selectionLength", json["selectionLength"]);
+ } else {
+ throw missingKey(jsonPath, "selectionLength");
+ }
+ bool isDeprecated;
+ if (json.containsKey("isDeprecated")) {
+ isDeprecated = _decodeBool(jsonPath + ".isDeprecated", json["isDeprecated"]);
+ } else {
+ throw missingKey(jsonPath, "isDeprecated");
+ }
+ bool isPotential;
+ if (json.containsKey("isPotential")) {
+ isPotential = _decodeBool(jsonPath + ".isPotential", json["isPotential"]);
+ } else {
+ throw missingKey(jsonPath, "isPotential");
+ }
+ String docSummary;
+ if (json.containsKey("docSummary")) {
+ docSummary = _decodeString(jsonPath + ".docSummary", json["docSummary"]);
+ }
+ String docComplete;
+ if (json.containsKey("docComplete")) {
+ docComplete = _decodeString(jsonPath + ".docComplete", json["docComplete"]);
+ }
+ String declaringType;
+ if (json.containsKey("declaringType")) {
+ declaringType = _decodeString(jsonPath + ".declaringType", json["declaringType"]);
+ }
+ String returnType;
+ if (json.containsKey("returnType")) {
+ returnType = _decodeString(jsonPath + ".returnType", json["returnType"]);
+ }
+ List<String> parameterNames;
+ if (json.containsKey("parameterNames")) {
+ parameterNames = _decodeList(jsonPath + ".parameterNames", json["parameterNames"], _decodeString);
+ }
+ List<String> parameterTypes;
+ if (json.containsKey("parameterTypes")) {
+ parameterTypes = _decodeList(jsonPath + ".parameterTypes", json["parameterTypes"], _decodeString);
+ }
+ int requiredParameterCount;
+ if (json.containsKey("requiredParameterCount")) {
+ requiredParameterCount = _decodeInt(jsonPath + ".requiredParameterCount", json["requiredParameterCount"]);
+ }
+ int positionalParameterCount;
+ if (json.containsKey("positionalParameterCount")) {
+ positionalParameterCount = _decodeInt(jsonPath + ".positionalParameterCount", json["positionalParameterCount"]);
+ }
+ String parameterName;
+ if (json.containsKey("parameterName")) {
+ parameterName = _decodeString(jsonPath + ".parameterName", json["parameterName"]);
+ }
+ String parameterType;
+ if (json.containsKey("parameterType")) {
+ parameterType = _decodeString(jsonPath + ".parameterType", json["parameterType"]);
+ }
+ return new CompletionSuggestion(kind, relevance, completion, selectionOffset, selectionLength, isDeprecated, isPotential, docSummary: docSummary, docComplete: docComplete, declaringType: declaringType, returnType: returnType, parameterNames: parameterNames, parameterTypes: parameterTypes, requiredParameterCount: requiredParameterCount, positionalParameterCount: positionalParameterCount, parameterName: parameterName, parameterType: parameterType);
+ } else {
+ throw mismatch(jsonPath, "CompletionSuggestion");
+ }
+ }
+
+ CompletionSuggestionKind decodeCompletionSuggestionKind(String jsonPath, Object json) {
+ if (json is String) {
+ try {
+ return new CompletionSuggestionKind(json);
+ } catch(_) {
+ // Fall through
+ }
+ }
+ throw mismatch(jsonPath, "CompletionSuggestionKind");
+ }
+
+ DebugService decodeDebugService(String jsonPath, Object json) {
+ if (json is String) {
+ try {
+ return new DebugService(json);
+ } catch(_) {
+ // Fall through
+ }
+ }
+ throw mismatch(jsonPath, "DebugService");
+ }
+
+ Element decodeElement(String jsonPath, Object json) {
+ if (json is Map) {
+ ElementKind kind;
+ if (json.containsKey("kind")) {
+ kind = decodeElementKind(jsonPath + ".kind", json["kind"]);
+ } else {
+ throw missingKey(jsonPath, "kind");
+ }
+ String name;
+ if (json.containsKey("name")) {
+ name = _decodeString(jsonPath + ".name", json["name"]);
+ } else {
+ throw missingKey(jsonPath, "name");
+ }
+ Location location;
+ if (json.containsKey("location")) {
+ location = decodeLocation(jsonPath + ".location", json["location"]);
+ }
+ int flags;
+ if (json.containsKey("flags")) {
+ flags = _decodeInt(jsonPath + ".flags", json["flags"]);
+ } else {
+ throw missingKey(jsonPath, "flags");
+ }
+ String parameters;
+ if (json.containsKey("parameters")) {
+ parameters = _decodeString(jsonPath + ".parameters", json["parameters"]);
+ }
+ String returnType;
+ if (json.containsKey("returnType")) {
+ returnType = _decodeString(jsonPath + ".returnType", json["returnType"]);
+ }
+ return new Element(kind, name, flags, location: location, parameters: parameters, returnType: returnType);
+ } else {
+ throw mismatch(jsonPath, "Element");
+ }
+ }
+
+ ElementKind decodeElementKind(String jsonPath, Object json) {
+ if (json is String) {
+ try {
+ return new ElementKind(json);
+ } catch(_) {
+ // Fall through
+ }
+ }
+ throw mismatch(jsonPath, "ElementKind");
+ }
+
+ Error decodeError(String jsonPath, Object json) {
+ if (json is Map) {
+ String code;
+ if (json.containsKey("code")) {
+ code = _decodeString(jsonPath + ".code", json["code"]);
+ } else {
+ throw missingKey(jsonPath, "code");
+ }
+ String message;
+ if (json.containsKey("message")) {
+ message = _decodeString(jsonPath + ".message", json["message"]);
+ } else {
+ throw missingKey(jsonPath, "message");
+ }
+ Object data;
+ if (json.containsKey("data")) {
+ data = json["data"];
+ }
+ return new Error(code, message, data: data);
+ } else {
+ throw mismatch(jsonPath, "Error");
+ }
+ }
+
+ ErrorFixes decodeErrorFixes(String jsonPath, Object json) {
+ if (json is Map) {
+ AnalysisError error;
+ if (json.containsKey("error")) {
+ error = decodeAnalysisError(jsonPath + ".error", json["error"]);
+ } else {
+ throw missingKey(jsonPath, "error");
+ }
+ List<SourceChange> fixes;
+ if (json.containsKey("fixes")) {
+ fixes = _decodeList(jsonPath + ".fixes", json["fixes"], decodeSourceChange);
+ } else {
+ throw missingKey(jsonPath, "fixes");
+ }
+ return new ErrorFixes(error, fixes);
+ } else {
+ throw mismatch(jsonPath, "ErrorFixes");
+ }
+ }
+
+ ErrorSeverity decodeErrorSeverity(String jsonPath, Object json) {
+ if (json is String) {
+ try {
+ return new ErrorSeverity(json);
+ } catch(_) {
+ // Fall through
+ }
+ }
+ throw mismatch(jsonPath, "ErrorSeverity");
+ }
+
+ ErrorType decodeErrorType(String jsonPath, Object json) {
+ if (json is String) {
+ try {
+ return new ErrorType(json);
+ } catch(_) {
+ // Fall through
+ }
+ }
+ throw mismatch(jsonPath, "ErrorType");
+ }
+
+ ExecutableFile decodeExecutableFile(String jsonPath, Object json) {
+ if (json is Map) {
+ String file;
+ if (json.containsKey("file")) {
+ file = _decodeString(jsonPath + ".file", json["file"]);
+ } else {
+ throw missingKey(jsonPath, "file");
+ }
+ ExecutableKind offset;
+ if (json.containsKey("offset")) {
+ offset = decodeExecutableKind(jsonPath + ".offset", json["offset"]);
+ } else {
+ throw missingKey(jsonPath, "offset");
+ }
+ return new ExecutableFile(file, offset);
+ } else {
+ throw mismatch(jsonPath, "ExecutableFile");
+ }
+ }
+
+ ExecutableKind decodeExecutableKind(String jsonPath, Object json) {
+ if (json is String) {
+ try {
+ return new ExecutableKind(json);
+ } catch(_) {
+ // Fall through
+ }
+ }
+ throw mismatch(jsonPath, "ExecutableKind");
+ }
+
+ FoldingKind decodeFoldingKind(String jsonPath, Object json) {
+ if (json is String) {
+ try {
+ return new FoldingKind(json);
+ } catch(_) {
+ // Fall through
+ }
+ }
+ throw mismatch(jsonPath, "FoldingKind");
+ }
+
+ FoldingRegion decodeFoldingRegion(String jsonPath, Object json) {
+ if (json is Map) {
+ FoldingKind kind;
+ if (json.containsKey("kind")) {
+ kind = decodeFoldingKind(jsonPath + ".kind", json["kind"]);
+ } else {
+ throw missingKey(jsonPath, "kind");
+ }
+ int offset;
+ if (json.containsKey("offset")) {
+ offset = _decodeInt(jsonPath + ".offset", json["offset"]);
+ } else {
+ throw missingKey(jsonPath, "offset");
+ }
+ int length;
+ if (json.containsKey("length")) {
+ length = _decodeInt(jsonPath + ".length", json["length"]);
+ } else {
+ throw missingKey(jsonPath, "length");
+ }
+ return new FoldingRegion(kind, offset, length);
+ } else {
+ throw mismatch(jsonPath, "FoldingRegion");
+ }
+ }
+
+ HighlightRegion decodeHighlightRegion(String jsonPath, Object json) {
+ if (json is Map) {
+ HighlightRegionType type;
+ if (json.containsKey("type")) {
+ type = decodeHighlightRegionType(jsonPath + ".type", json["type"]);
+ } else {
+ throw missingKey(jsonPath, "type");
+ }
+ int offset;
+ if (json.containsKey("offset")) {
+ offset = _decodeInt(jsonPath + ".offset", json["offset"]);
+ } else {
+ throw missingKey(jsonPath, "offset");
+ }
+ int length;
+ if (json.containsKey("length")) {
+ length = _decodeInt(jsonPath + ".length", json["length"]);
+ } else {
+ throw missingKey(jsonPath, "length");
+ }
+ return new HighlightRegion(type, offset, length);
+ } else {
+ throw mismatch(jsonPath, "HighlightRegion");
+ }
+ }
+
+ HighlightRegionType decodeHighlightRegionType(String jsonPath, Object json) {
+ if (json is String) {
+ try {
+ return new HighlightRegionType(json);
+ } catch(_) {
+ // Fall through
+ }
+ }
+ throw mismatch(jsonPath, "HighlightRegionType");
+ }
+
+ HoverInformation decodeHoverInformation(String jsonPath, Object json) {
+ if (json is Map) {
+ int offset;
+ if (json.containsKey("offset")) {
+ offset = _decodeInt(jsonPath + ".offset", json["offset"]);
+ } else {
+ throw missingKey(jsonPath, "offset");
+ }
+ int length;
+ if (json.containsKey("length")) {
+ length = _decodeInt(jsonPath + ".length", json["length"]);
+ } else {
+ throw missingKey(jsonPath, "length");
+ }
+ String containingLibraryPath;
+ if (json.containsKey("containingLibraryPath")) {
+ containingLibraryPath = _decodeString(jsonPath + ".containingLibraryPath", json["containingLibraryPath"]);
+ }
+ String containingLibraryName;
+ if (json.containsKey("containingLibraryName")) {
+ containingLibraryName = _decodeString(jsonPath + ".containingLibraryName", json["containingLibraryName"]);
+ }
+ String dartdoc;
+ if (json.containsKey("dartdoc")) {
+ dartdoc = _decodeString(jsonPath + ".dartdoc", json["dartdoc"]);
+ }
+ String elementDescription;
+ if (json.containsKey("elementDescription")) {
+ elementDescription = _decodeString(jsonPath + ".elementDescription", json["elementDescription"]);
+ }
+ String elementKind;
+ if (json.containsKey("elementKind")) {
+ elementKind = _decodeString(jsonPath + ".elementKind", json["elementKind"]);
+ }
+ String parameter;
+ if (json.containsKey("parameter")) {
+ parameter = _decodeString(jsonPath + ".parameter", json["parameter"]);
+ }
+ String propagatedType;
+ if (json.containsKey("propagatedType")) {
+ propagatedType = _decodeString(jsonPath + ".propagatedType", json["propagatedType"]);
+ }
+ String staticType;
+ if (json.containsKey("staticType")) {
+ staticType = _decodeString(jsonPath + ".staticType", json["staticType"]);
+ }
+ return new HoverInformation(offset, length, containingLibraryPath: containingLibraryPath, containingLibraryName: containingLibraryName, dartdoc: dartdoc, elementDescription: elementDescription, elementKind: elementKind, parameter: parameter, propagatedType: propagatedType, staticType: staticType);
+ } else {
+ throw mismatch(jsonPath, "HoverInformation");
+ }
+ }
+
+ LinkedEditGroup decodeLinkedEditGroup(String jsonPath, Object json) {
+ if (json is Map) {
+ List<Position> positions;
+ if (json.containsKey("positions")) {
+ positions = _decodeList(jsonPath + ".positions", json["positions"], decodePosition);
+ } else {
+ throw missingKey(jsonPath, "positions");
+ }
+ int length;
+ if (json.containsKey("length")) {
+ length = _decodeInt(jsonPath + ".length", json["length"]);
+ } else {
+ throw missingKey(jsonPath, "length");
+ }
+ List<LinkedEditSuggestion> suggestions;
+ if (json.containsKey("suggestions")) {
+ suggestions = _decodeList(jsonPath + ".suggestions", json["suggestions"], decodeLinkedEditSuggestion);
+ } else {
+ throw missingKey(jsonPath, "suggestions");
+ }
+ return new LinkedEditGroup(positions, length, suggestions);
+ } else {
+ throw mismatch(jsonPath, "LinkedEditGroup");
+ }
+ }
+
+ LinkedEditSuggestion decodeLinkedEditSuggestion(String jsonPath, Object json) {
+ if (json is Map) {
+ String value;
+ if (json.containsKey("value")) {
+ value = _decodeString(jsonPath + ".value", json["value"]);
+ } else {
+ throw missingKey(jsonPath, "value");
+ }
+ LinkedEditSuggestionKind kind;
+ if (json.containsKey("kind")) {
+ kind = decodeLinkedEditSuggestionKind(jsonPath + ".kind", json["kind"]);
+ } else {
+ throw missingKey(jsonPath, "kind");
+ }
+ return new LinkedEditSuggestion(value, kind);
+ } else {
+ throw mismatch(jsonPath, "LinkedEditSuggestion");
+ }
+ }
+
+ LinkedEditSuggestionKind decodeLinkedEditSuggestionKind(String jsonPath, Object json) {
+ if (json is String) {
+ try {
+ return new LinkedEditSuggestionKind(json);
+ } catch(_) {
+ // Fall through
+ }
+ }
+ throw mismatch(jsonPath, "LinkedEditSuggestionKind");
+ }
+
+ Location decodeLocation(String jsonPath, Object json) {
+ if (json is Map) {
+ String file;
+ if (json.containsKey("file")) {
+ file = _decodeString(jsonPath + ".file", json["file"]);
+ } else {
+ throw missingKey(jsonPath, "file");
+ }
+ int offset;
+ if (json.containsKey("offset")) {
+ offset = _decodeInt(jsonPath + ".offset", json["offset"]);
+ } else {
+ throw missingKey(jsonPath, "offset");
+ }
+ int length;
+ if (json.containsKey("length")) {
+ length = _decodeInt(jsonPath + ".length", json["length"]);
+ } else {
+ throw missingKey(jsonPath, "length");
+ }
+ int startLine;
+ if (json.containsKey("startLine")) {
+ startLine = _decodeInt(jsonPath + ".startLine", json["startLine"]);
+ } else {
+ throw missingKey(jsonPath, "startLine");
+ }
+ int startColumn;
+ if (json.containsKey("startColumn")) {
+ startColumn = _decodeInt(jsonPath + ".startColumn", json["startColumn"]);
+ } else {
+ throw missingKey(jsonPath, "startColumn");
+ }
+ return new Location(file, offset, length, startLine, startColumn);
+ } else {
+ throw mismatch(jsonPath, "Location");
+ }
+ }
+
+ NavigationRegion decodeNavigationRegion(String jsonPath, Object json) {
+ if (json is Map) {
+ int offset;
+ if (json.containsKey("offset")) {
+ offset = _decodeInt(jsonPath + ".offset", json["offset"]);
+ } else {
+ throw missingKey(jsonPath, "offset");
+ }
+ int length;
+ if (json.containsKey("length")) {
+ length = _decodeInt(jsonPath + ".length", json["length"]);
+ } else {
+ throw missingKey(jsonPath, "length");
+ }
+ List<Element> targets;
+ if (json.containsKey("targets")) {
+ targets = _decodeList(jsonPath + ".targets", json["targets"], decodeElement);
+ } else {
+ throw missingKey(jsonPath, "targets");
+ }
+ return new NavigationRegion(offset, length, targets);
+ } else {
+ throw mismatch(jsonPath, "NavigationRegion");
+ }
+ }
+
+ Occurrences decodeOccurrences(String jsonPath, Object json) {
+ if (json is Map) {
+ Element element;
+ if (json.containsKey("element")) {
+ element = decodeElement(jsonPath + ".element", json["element"]);
+ } else {
+ throw missingKey(jsonPath, "element");
+ }
+ List<int> offsets;
+ if (json.containsKey("offsets")) {
+ offsets = _decodeList(jsonPath + ".offsets", json["offsets"], _decodeInt);
+ } else {
+ throw missingKey(jsonPath, "offsets");
+ }
+ int length;
+ if (json.containsKey("length")) {
+ length = _decodeInt(jsonPath + ".length", json["length"]);
+ } else {
+ throw missingKey(jsonPath, "length");
+ }
+ return new Occurrences(element, offsets, length);
+ } else {
+ throw mismatch(jsonPath, "Occurrences");
+ }
+ }
+
+ Outline decodeOutline(String jsonPath, Object json) {
+ if (json is Map) {
+ Element element;
+ if (json.containsKey("element")) {
+ element = decodeElement(jsonPath + ".element", json["element"]);
+ } else {
+ throw missingKey(jsonPath, "element");
+ }
+ int offset;
+ if (json.containsKey("offset")) {
+ offset = _decodeInt(jsonPath + ".offset", json["offset"]);
+ } else {
+ throw missingKey(jsonPath, "offset");
+ }
+ int length;
+ if (json.containsKey("length")) {
+ length = _decodeInt(jsonPath + ".length", json["length"]);
+ } else {
+ throw missingKey(jsonPath, "length");
+ }
+ List<Outline> children;
+ if (json.containsKey("children")) {
+ children = _decodeList(jsonPath + ".children", json["children"], decodeOutline);
+ }
+ return new Outline(element, offset, length, children: children);
+ } else {
+ throw mismatch(jsonPath, "Outline");
+ }
+ }
+
+ Override decodeOverride(String jsonPath, Object json) {
+ if (json is Map) {
+ int offset;
+ if (json.containsKey("offset")) {
+ offset = _decodeInt(jsonPath + ".offset", json["offset"]);
+ } else {
+ throw missingKey(jsonPath, "offset");
+ }
+ int length;
+ if (json.containsKey("length")) {
+ length = _decodeInt(jsonPath + ".length", json["length"]);
+ } else {
+ throw missingKey(jsonPath, "length");
+ }
+ OverriddenMember superclassMember;
+ if (json.containsKey("superclassMember")) {
+ superclassMember = decodeOverriddenMember(jsonPath + ".superclassMember", json["superclassMember"]);
+ }
+ List<OverriddenMember> interfaceMembers;
+ if (json.containsKey("interfaceMembers")) {
+ interfaceMembers = _decodeList(jsonPath + ".interfaceMembers", json["interfaceMembers"], decodeOverriddenMember);
+ }
+ return new Override(offset, length, superclassMember: superclassMember, interfaceMembers: interfaceMembers);
+ } else {
+ throw mismatch(jsonPath, "Override");
+ }
+ }
+
+ OverriddenMember decodeOverriddenMember(String jsonPath, Object json) {
+ if (json is Map) {
+ Element element;
+ if (json.containsKey("element")) {
+ element = decodeElement(jsonPath + ".element", json["element"]);
+ } else {
+ throw missingKey(jsonPath, "element");
+ }
+ String className;
+ if (json.containsKey("className")) {
+ className = _decodeString(jsonPath + ".className", json["className"]);
+ } else {
+ throw missingKey(jsonPath, "className");
+ }
+ return new OverriddenMember(element, className);
+ } else {
+ throw mismatch(jsonPath, "OverriddenMember");
+ }
+ }
+
+ Position decodePosition(String jsonPath, Object json) {
+ if (json is Map) {
+ String file;
+ if (json.containsKey("file")) {
+ file = _decodeString(jsonPath + ".file", json["file"]);
+ } else {
+ throw missingKey(jsonPath, "file");
+ }
+ int offset;
+ if (json.containsKey("offset")) {
+ offset = _decodeInt(jsonPath + ".offset", json["offset"]);
+ } else {
+ throw missingKey(jsonPath, "offset");
+ }
+ return new Position(file, offset);
+ } else {
+ throw mismatch(jsonPath, "Position");
+ }
+ }
+
+ RefactoringKind decodeRefactoringKind(String jsonPath, Object json) {
+ if (json is String) {
+ try {
+ return new RefactoringKind(json);
+ } catch(_) {
+ // Fall through
+ }
+ }
+ throw mismatch(jsonPath, "RefactoringKind");
+ }
+
+ RefactoringMethodParameter decodeRefactoringMethodParameter(String jsonPath, Object json) {
+ if (json is Map) {
+ String id;
+ if (json.containsKey("id")) {
+ id = _decodeString(jsonPath + ".id", json["id"]);
+ }
+ RefactoringMethodParameterKind kind;
+ if (json.containsKey("kind")) {
+ kind = decodeRefactoringMethodParameterKind(jsonPath + ".kind", json["kind"]);
+ } else {
+ throw missingKey(jsonPath, "kind");
+ }
+ String type;
+ if (json.containsKey("type")) {
+ type = _decodeString(jsonPath + ".type", json["type"]);
+ } else {
+ throw missingKey(jsonPath, "type");
+ }
+ String name;
+ if (json.containsKey("name")) {
+ name = _decodeString(jsonPath + ".name", json["name"]);
+ } else {
+ throw missingKey(jsonPath, "name");
+ }
+ String parameters;
+ if (json.containsKey("parameters")) {
+ parameters = _decodeString(jsonPath + ".parameters", json["parameters"]);
+ }
+ return new RefactoringMethodParameter(kind, type, name, id: id, parameters: parameters);
+ } else {
+ throw mismatch(jsonPath, "RefactoringMethodParameter");
+ }
+ }
+
+ RefactoringMethodParameterKind decodeRefactoringMethodParameterKind(String jsonPath, Object json) {
+ if (json is String) {
+ try {
+ return new RefactoringMethodParameterKind(json);
+ } catch(_) {
+ // Fall through
+ }
+ }
+ throw mismatch(jsonPath, "RefactoringMethodParameterKind");
+ }
+
+ RefactoringProblem decodeRefactoringProblem(String jsonPath, Object json) {
+ if (json is Map) {
+ RefactoringProblemSeverity severity;
+ if (json.containsKey("severity")) {
+ severity = decodeRefactoringProblemSeverity(jsonPath + ".severity", json["severity"]);
+ } else {
+ throw missingKey(jsonPath, "severity");
+ }
+ String message;
+ if (json.containsKey("message")) {
+ message = _decodeString(jsonPath + ".message", json["message"]);
+ } else {
+ throw missingKey(jsonPath, "message");
+ }
+ Location location;
+ if (json.containsKey("location")) {
+ location = decodeLocation(jsonPath + ".location", json["location"]);
+ } else {
+ throw missingKey(jsonPath, "location");
+ }
+ return new RefactoringProblem(severity, message, location);
+ } else {
+ throw mismatch(jsonPath, "RefactoringProblem");
+ }
+ }
+
+ RefactoringProblemSeverity decodeRefactoringProblemSeverity(String jsonPath, Object json) {
+ if (json is String) {
+ try {
+ return new RefactoringProblemSeverity(json);
+ } catch(_) {
+ // Fall through
+ }
+ }
+ throw mismatch(jsonPath, "RefactoringProblemSeverity");
+ }
+
+ RemoveContentOverlay decodeRemoveContentOverlay(String jsonPath, Object json) {
+ if (json is Map) {
+ if (json["type"] != "remove") {
+ throw mismatch(jsonPath, "equal " + "remove");
+ }
+ return new RemoveContentOverlay();
+ } else {
+ throw mismatch(jsonPath, "RemoveContentOverlay");
+ }
+ }
+
+ SearchResult decodeSearchResult(String jsonPath, Object json) {
+ if (json is Map) {
+ Location location;
+ if (json.containsKey("location")) {
+ location = decodeLocation(jsonPath + ".location", json["location"]);
+ } else {
+ throw missingKey(jsonPath, "location");
+ }
+ SearchResultKind kind;
+ if (json.containsKey("kind")) {
+ kind = decodeSearchResultKind(jsonPath + ".kind", json["kind"]);
+ } else {
+ throw missingKey(jsonPath, "kind");
+ }
+ bool isPotential;
+ if (json.containsKey("isPotential")) {
+ isPotential = _decodeBool(jsonPath + ".isPotential", json["isPotential"]);
+ } else {
+ throw missingKey(jsonPath, "isPotential");
+ }
+ List<Element> path;
+ if (json.containsKey("path")) {
+ path = _decodeList(jsonPath + ".path", json["path"], decodeElement);
+ } else {
+ throw missingKey(jsonPath, "path");
+ }
+ return new SearchResult(location, kind, isPotential, path);
+ } else {
+ throw mismatch(jsonPath, "SearchResult");
+ }
+ }
+
+ SearchResultKind decodeSearchResultKind(String jsonPath, Object json) {
+ if (json is String) {
+ try {
+ return new SearchResultKind(json);
+ } catch(_) {
+ // Fall through
+ }
+ }
+ throw mismatch(jsonPath, "SearchResultKind");
+ }
+
+ ServerService decodeServerService(String jsonPath, Object json) {
+ if (json is String) {
+ try {
+ return new ServerService(json);
+ } catch(_) {
+ // Fall through
+ }
+ }
+ throw mismatch(jsonPath, "ServerService");
+ }
+
+ SourceChange decodeSourceChange(String jsonPath, Object json) {
+ if (json is Map) {
+ String message;
+ if (json.containsKey("message")) {
+ message = _decodeString(jsonPath + ".message", json["message"]);
+ } else {
+ throw missingKey(jsonPath, "message");
+ }
+ List<SourceFileEdit> edits;
+ if (json.containsKey("edits")) {
+ edits = _decodeList(jsonPath + ".edits", json["edits"], decodeSourceFileEdit);
+ } else {
+ throw missingKey(jsonPath, "edits");
+ }
+ List<LinkedEditGroup> linkedEditGroups;
+ if (json.containsKey("linkedEditGroups")) {
+ linkedEditGroups = _decodeList(jsonPath + ".linkedEditGroups", json["linkedEditGroups"], decodeLinkedEditGroup);
+ } else {
+ throw missingKey(jsonPath, "linkedEditGroups");
+ }
+ Position selection;
+ if (json.containsKey("selection")) {
+ selection = decodePosition(jsonPath + ".selection", json["selection"]);
+ }
+ return new SourceChange(message, edits, linkedEditGroups, selection: selection);
+ } else {
+ throw mismatch(jsonPath, "SourceChange");
+ }
+ }
+
+ SourceEdit decodeSourceEdit(String jsonPath, Object json) {
+ if (json is Map) {
+ int offset;
+ if (json.containsKey("offset")) {
+ offset = _decodeInt(jsonPath + ".offset", json["offset"]);
+ } else {
+ throw missingKey(jsonPath, "offset");
+ }
+ int length;
+ if (json.containsKey("length")) {
+ length = _decodeInt(jsonPath + ".length", json["length"]);
+ } else {
+ throw missingKey(jsonPath, "length");
+ }
+ String replacement;
+ if (json.containsKey("replacement")) {
+ replacement = _decodeString(jsonPath + ".replacement", json["replacement"]);
+ } else {
+ throw missingKey(jsonPath, "replacement");
+ }
+ String id;
+ if (json.containsKey("id")) {
+ id = _decodeString(jsonPath + ".id", json["id"]);
+ }
+ return new SourceEdit(offset, length, replacement, id: id);
+ } else {
+ throw mismatch(jsonPath, "SourceEdit");
+ }
+ }
+
+ SourceFileEdit decodeSourceFileEdit(String jsonPath, Object json) {
+ if (json is Map) {
+ String file;
+ if (json.containsKey("file")) {
+ file = _decodeString(jsonPath + ".file", json["file"]);
+ } else {
+ throw missingKey(jsonPath, "file");
+ }
+ List<SourceEdit> edits;
+ if (json.containsKey("edits")) {
+ edits = _decodeList(jsonPath + ".edits", json["edits"], decodeSourceEdit);
+ } else {
+ throw missingKey(jsonPath, "edits");
+ }
+ return new SourceFileEdit(file, edits);
+ } else {
+ throw mismatch(jsonPath, "SourceFileEdit");
+ }
+ }
+
+ TypeHierarchyItem decodeTypeHierarchyItem(String jsonPath, Object json) {
+ if (json is Map) {
+ Element classElement;
+ if (json.containsKey("classElement")) {
+ classElement = decodeElement(jsonPath + ".classElement", json["classElement"]);
+ } else {
+ throw missingKey(jsonPath, "classElement");
+ }
+ String displayName;
+ if (json.containsKey("displayName")) {
+ displayName = _decodeString(jsonPath + ".displayName", json["displayName"]);
+ }
+ Element memberElement;
+ if (json.containsKey("memberElement")) {
+ memberElement = decodeElement(jsonPath + ".memberElement", json["memberElement"]);
+ }
+ int superclass;
+ if (json.containsKey("superclass")) {
+ superclass = _decodeInt(jsonPath + ".superclass", json["superclass"]);
+ }
+ List<int> interfaces;
+ if (json.containsKey("interfaces")) {
+ interfaces = _decodeList(jsonPath + ".interfaces", json["interfaces"], _decodeInt);
+ } else {
+ throw missingKey(jsonPath, "interfaces");
+ }
+ List<int> mixins;
+ if (json.containsKey("mixins")) {
+ mixins = _decodeList(jsonPath + ".mixins", json["mixins"], _decodeInt);
+ } else {
+ throw missingKey(jsonPath, "mixins");
+ }
+ List<int> subclasses;
+ if (json.containsKey("subclasses")) {
+ subclasses = _decodeList(jsonPath + ".subclasses", json["subclasses"], _decodeInt);
+ } else {
+ throw missingKey(jsonPath, "subclasses");
+ }
+ return new TypeHierarchyItem(classElement, interfaces, mixins, subclasses, displayName: displayName, memberElement: memberElement, superclass: superclass);
+ } else {
+ throw mismatch(jsonPath, "TypeHierarchyItem");
+ }
+ }
+
+ ExtractLocalVariableFeedback decodeExtractLocalVariableFeedback(String jsonPath, Object json) {
+ if (json is Map) {
+ List<String> names;
+ if (json.containsKey("names")) {
+ names = _decodeList(jsonPath + ".names", json["names"], _decodeString);
+ } else {
+ throw missingKey(jsonPath, "names");
+ }
+ List<int> offsets;
+ if (json.containsKey("offsets")) {
+ offsets = _decodeList(jsonPath + ".offsets", json["offsets"], _decodeInt);
+ } else {
+ throw missingKey(jsonPath, "offsets");
+ }
+ List<int> lengths;
+ if (json.containsKey("lengths")) {
+ lengths = _decodeList(jsonPath + ".lengths", json["lengths"], _decodeInt);
+ } else {
+ throw missingKey(jsonPath, "lengths");
+ }
+ return new ExtractLocalVariableFeedback(names, offsets, lengths);
+ } else {
+ throw mismatch(jsonPath, "extractLocalVariable feedback");
+ }
+ }
+
+ ExtractLocalVariableOptions decodeExtractLocalVariableOptions(String jsonPath, Object json) {
+ if (json is Map) {
+ String name;
+ if (json.containsKey("name")) {
+ name = _decodeString(jsonPath + ".name", json["name"]);
+ } else {
+ throw missingKey(jsonPath, "name");
+ }
+ bool extractAll;
+ if (json.containsKey("extractAll")) {
+ extractAll = _decodeBool(jsonPath + ".extractAll", json["extractAll"]);
+ } else {
+ throw missingKey(jsonPath, "extractAll");
+ }
+ return new ExtractLocalVariableOptions(name, extractAll);
+ } else {
+ throw mismatch(jsonPath, "extractLocalVariable options");
+ }
+ }
+
+ ExtractMethodFeedback decodeExtractMethodFeedback(String jsonPath, Object json) {
+ if (json is Map) {
+ int offset;
+ if (json.containsKey("offset")) {
+ offset = _decodeInt(jsonPath + ".offset", json["offset"]);
+ } else {
+ throw missingKey(jsonPath, "offset");
+ }
+ int length;
+ if (json.containsKey("length")) {
+ length = _decodeInt(jsonPath + ".length", json["length"]);
+ } else {
+ throw missingKey(jsonPath, "length");
+ }
+ String returnType;
+ if (json.containsKey("returnType")) {
+ returnType = _decodeString(jsonPath + ".returnType", json["returnType"]);
+ } else {
+ throw missingKey(jsonPath, "returnType");
+ }
+ List<String> names;
+ if (json.containsKey("names")) {
+ names = _decodeList(jsonPath + ".names", json["names"], _decodeString);
+ } else {
+ throw missingKey(jsonPath, "names");
+ }
+ bool canCreateGetter;
+ if (json.containsKey("canCreateGetter")) {
+ canCreateGetter = _decodeBool(jsonPath + ".canCreateGetter", json["canCreateGetter"]);
+ } else {
+ throw missingKey(jsonPath, "canCreateGetter");
+ }
+ List<RefactoringMethodParameter> parameters;
+ if (json.containsKey("parameters")) {
+ parameters = _decodeList(jsonPath + ".parameters", json["parameters"], decodeRefactoringMethodParameter);
+ } else {
+ throw missingKey(jsonPath, "parameters");
+ }
+ int occurrences;
+ if (json.containsKey("occurrences")) {
+ occurrences = _decodeInt(jsonPath + ".occurrences", json["occurrences"]);
+ } else {
+ throw missingKey(jsonPath, "occurrences");
+ }
+ List<int> offsets;
+ if (json.containsKey("offsets")) {
+ offsets = _decodeList(jsonPath + ".offsets", json["offsets"], _decodeInt);
+ } else {
+ throw missingKey(jsonPath, "offsets");
+ }
+ List<int> lengths;
+ if (json.containsKey("lengths")) {
+ lengths = _decodeList(jsonPath + ".lengths", json["lengths"], _decodeInt);
+ } else {
+ throw missingKey(jsonPath, "lengths");
+ }
+ return new ExtractMethodFeedback(offset, length, returnType, names, canCreateGetter, parameters, occurrences, offsets, lengths);
+ } else {
+ throw mismatch(jsonPath, "extractMethod feedback");
+ }
+ }
+
+ ExtractMethodOptions decodeExtractMethodOptions(String jsonPath, Object json) {
+ if (json is Map) {
+ String returnType;
+ if (json.containsKey("returnType")) {
+ returnType = _decodeString(jsonPath + ".returnType", json["returnType"]);
+ } else {
+ throw missingKey(jsonPath, "returnType");
+ }
+ bool createGetter;
+ if (json.containsKey("createGetter")) {
+ createGetter = _decodeBool(jsonPath + ".createGetter", json["createGetter"]);
+ } else {
+ throw missingKey(jsonPath, "createGetter");
+ }
+ String name;
+ if (json.containsKey("name")) {
+ name = _decodeString(jsonPath + ".name", json["name"]);
+ } else {
+ throw missingKey(jsonPath, "name");
+ }
+ List<RefactoringMethodParameter> parameters;
+ if (json.containsKey("parameters")) {
+ parameters = _decodeList(jsonPath + ".parameters", json["parameters"], decodeRefactoringMethodParameter);
+ } else {
+ throw missingKey(jsonPath, "parameters");
+ }
+ bool extractAll;
+ if (json.containsKey("extractAll")) {
+ extractAll = _decodeBool(jsonPath + ".extractAll", json["extractAll"]);
+ } else {
+ throw missingKey(jsonPath, "extractAll");
+ }
+ return new ExtractMethodOptions(returnType, createGetter, name, parameters, extractAll);
+ } else {
+ throw mismatch(jsonPath, "extractMethod options");
+ }
+ }
+
+ InlineMethodOptions decodeInlineMethodOptions(String jsonPath, Object json) {
+ if (json is Map) {
+ bool deleteSource;
+ if (json.containsKey("deleteSource")) {
+ deleteSource = _decodeBool(jsonPath + ".deleteSource", json["deleteSource"]);
+ } else {
+ throw missingKey(jsonPath, "deleteSource");
+ }
+ bool inlineAll;
+ if (json.containsKey("inlineAll")) {
+ inlineAll = _decodeBool(jsonPath + ".inlineAll", json["inlineAll"]);
+ } else {
+ throw missingKey(jsonPath, "inlineAll");
+ }
+ return new InlineMethodOptions(deleteSource, inlineAll);
+ } else {
+ throw mismatch(jsonPath, "inlineMethod options");
+ }
+ }
+
+ RenameFeedback decodeRenameFeedback(String jsonPath, Object json) {
+ if (json is Map) {
+ int offset;
+ if (json.containsKey("offset")) {
+ offset = _decodeInt(jsonPath + ".offset", json["offset"]);
+ } else {
+ throw missingKey(jsonPath, "offset");
+ }
+ int length;
+ if (json.containsKey("length")) {
+ length = _decodeInt(jsonPath + ".length", json["length"]);
+ } else {
+ throw missingKey(jsonPath, "length");
+ }
+ return new RenameFeedback(offset, length);
+ } else {
+ throw mismatch(jsonPath, "rename feedback");
+ }
+ }
+
+ RenameOptions decodeRenameOptions(String jsonPath, Object json) {
+ if (json is Map) {
+ String newName;
+ if (json.containsKey("newName")) {
+ newName = _decodeString(jsonPath + ".newName", json["newName"]);
+ } else {
+ throw missingKey(jsonPath, "newName");
+ }
+ return new RenameOptions(newName);
+ } else {
+ throw mismatch(jsonPath, "rename options");
+ }
+ }
+}
+
+/**
+ * Decode the response to a request of type server.getVersion
+ *
+ * Return the version number of the analysis server.
+ */
+ServerGetVersionResult decodeServerGetVersionResponse(Response response) {
Brian Wilkerson 2014/08/18 14:10:16 Consider converting these functions to constructor
Paul Berry 2014/08/18 21:58:03 Done.
+ var decoder = new ResponseDecoder();
+ return decoder.decodeServerGetVersionResult("result", response.result);
+}
+
+/**
+ * Decode a request of type server.setSubscriptions
+ *
+ * Subscribe for services. All previous subscriptions are replaced by the given
+ * set of services.
+ *
+ * It is an error if any of the elements in the list are not valid services. If
+ * there is an error, then the current subscriptions will remain unchanged.
+ */
+ServerSetSubscriptionsParams decodeServerSetSubscriptionsRequest(Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeServerSetSubscriptionsParams("params", request.params);
+}
+
+/**
+ * Decode a notification of type server.error
+ *
+ * Reports that an unexpected error has occurred while executing the server.
+ * This notification is not used for problems with specific requests (which are
+ * returned as part of the response) but is used for exceptions that occur
+ * while performing other tasks, such as analysis or preparing notifications.
+ *
+ * It is not possible to subscribe to or unsubscribe from this notification.
+ */
+ServerErrorParams decodeServerErrorNotification(Notification notification) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeServerErrorParams("params", notification.params);
+}
+
+/**
+ * Decode a notification of type server.status
+ *
+ * Reports the current status of the server. Parameters are omitted if there
+ * has been no change in the status represented by that parameter.
+ *
+ * This notification is not subscribed to by default. Clients can subscribe by
+ * including the value "STATUS" in the list of services passed in a
+ * server.setSubscriptions request.
+ */
+ServerStatusParams decodeServerStatusNotification(Notification notification) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeServerStatusParams("params", notification.params);
+}
+
+/**
+ * Decode a request of type analysis.getErrors
+ *
+ * Return the errors associated with the given file. If the errors for the
+ * given file have not yet been computed, or the most recently computed errors
+ * for the given file are out of date, then the response for this request will
+ * be delayed until they have been computed. If some or all of the errors for
+ * the file cannot be computed, then the subset of the errors that can be
+ * computed will be returned and the response will contain an error to indicate
+ * why the errors could not be computed.
+ *
+ * This request is intended to be used by clients that cannot asynchronously
+ * apply updated error information. Clients that can apply error information as
+ * it becomes available should use the information provided by the
+ * 'analysis.errors' notification.
+ */
+AnalysisGetErrorsParams decodeAnalysisGetErrorsRequest(Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeAnalysisGetErrorsParams("params", request.params);
+}
+
+/**
+ * Decode the response to a request of type analysis.getErrors
+ *
+ * Return the errors associated with the given file. If the errors for the
+ * given file have not yet been computed, or the most recently computed errors
+ * for the given file are out of date, then the response for this request will
+ * be delayed until they have been computed. If some or all of the errors for
+ * the file cannot be computed, then the subset of the errors that can be
+ * computed will be returned and the response will contain an error to indicate
+ * why the errors could not be computed.
+ *
+ * This request is intended to be used by clients that cannot asynchronously
+ * apply updated error information. Clients that can apply error information as
+ * it becomes available should use the information provided by the
+ * 'analysis.errors' notification.
+ */
+AnalysisGetErrorsResult decodeAnalysisGetErrorsResponse(Response response) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeAnalysisGetErrorsResult("result", response.result);
+}
+
+/**
+ * Decode a request of type analysis.getHover
+ *
+ * Return the hover information associate with the given location. If some or
+ * all of the hover information is not available at the time this request is
+ * processed the information will be omitted from the response.
+ */
+AnalysisGetHoverParams decodeAnalysisGetHoverRequest(Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeAnalysisGetHoverParams("params", request.params);
+}
+
+/**
+ * Decode the response to a request of type analysis.getHover
+ *
+ * Return the hover information associate with the given location. If some or
+ * all of the hover information is not available at the time this request is
+ * processed the information will be omitted from the response.
+ */
+AnalysisGetHoverResult decodeAnalysisGetHoverResponse(Response response) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeAnalysisGetHoverResult("result", response.result);
+}
+
+/**
+ * Decode a request of type analysis.setAnalysisRoots
+ *
+ * Sets the root paths used to determine which files to analyze. The set of
+ * files to be analyzed are all of the files in one of the root paths that are
+ * not also in one of the excluded paths.
+ *
+ * Note that this request determines the set of requested analysis roots. The
+ * actual set of analysis roots at any given time is the intersection of this
+ * set with the set of files and directories actually present on the
+ * filesystem. When the filesystem changes, the actual set of analysis roots is
+ * automatically updated, but the set of requested analysis roots is unchanged.
+ * This means that if the client sets an analysis root before the root becomes
+ * visible to server in the filesystem, there is no error; once the server sees
+ * the root in the filesystem it will start analyzing it. Similarly, server
+ * will stop analyzing files that are removed from the file system but they
+ * will remain in the set of requested roots.
+ *
+ * If an included path represents a file, then server will look in the
+ * directory containing the file for a pubspec.yaml file. If none is found,
+ * then the parents of the directory will be searched until such a file is
+ * found or the root of the file system is reached. If such a file is found, it
+ * will be used to resolve package: URI’s within the file.
+ */
+AnalysisSetAnalysisRootsParams decodeAnalysisSetAnalysisRootsRequest(Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeAnalysisSetAnalysisRootsParams("params", request.params);
+}
+
+/**
+ * Decode a request of type analysis.setPriorityFiles
+ *
+ * Set the priority files to the files in the given list. A priority file is a
+ * file that is given priority when scheduling which analysis work to do first.
+ * The list typically contains those files that are visible to the user and
+ * those for which analysis results will have the biggest impact on the user
+ * experience. The order of the files within the list is significant: the first
+ * file will be given higher priority than the second, the second higher
+ * priority than the third, and so on.
+ *
+ * Note that this request determines the set of requested priority files. The
+ * actual set of priority files is the intersection of the requested set of
+ * priority files with the set of files currently subject to analysis. (See
+ * analysis.setSubscriptions for a description of files that are subject to
+ * analysis.)
+ *
+ * If a requested priority file is a directory it is ignored, but remains in
+ * the set of requested priority files so that if it later becomes a file it
+ * can be included in the set of actual priority files.
+ */
+AnalysisSetPriorityFilesParams decodeAnalysisSetPriorityFilesRequest(Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeAnalysisSetPriorityFilesParams("params", request.params);
+}
+
+/**
+ * Decode a request of type analysis.setSubscriptions
+ *
+ * Subscribe for services. All previous subscriptions are replaced by the
+ * current set of subscriptions. If a given service is not included as a key in
+ * the map then no files will be subscribed to the service, exactly as if the
+ * service had been included in the map with an explicit empty list of files.
+ *
+ * Note that this request determines the set of requested subscriptions. The
+ * actual set of subscriptions at any given time is the intersection of this
+ * set with the set of files currently subject to analysis. The files currently
+ * subject to analysis are the set of files contained within an actual analysis
+ * root but not excluded, plus all of the files transitively reachable from
+ * those files via import, export and part directives. (See
+ * analysis.setAnalysisRoots for an explanation of how the actual analysis
+ * roots are determined.) When the actual analysis roots change, the actual set
+ * of subscriptions is automatically updated, but the set of requested
+ * subscriptions is unchanged.
+ *
+ * If a requested subscription is a directory it is ignored, but remains in the
+ * set of requested subscriptions so that if it later becomes a file it can be
+ * included in the set of actual subscriptions.
+ *
+ * It is an error if any of the keys in the map are not valid services. If
+ * there is an error, then the existing subscriptions will remain unchanged.
+ */
+AnalysisSetSubscriptionsParams decodeAnalysisSetSubscriptionsRequest(Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeAnalysisSetSubscriptionsParams("params", request.params);
+}
+
+/**
+ * Decode a request of type analysis.updateContent
+ *
+ * Update the content of one or more files. Files that were previously updated
+ * but not included in this update remain unchanged. This effectively
+ * represents an overlay of the filesystem. The files whose content is
+ * overridden are therefore seen by server as being files with the given
+ * content, even if the files do not exist on the filesystem or if the file
+ * path represents the path to a directory on the filesystem.
+ */
+AnalysisUpdateContentParams decodeAnalysisUpdateContentRequest(Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeAnalysisUpdateContentParams("params", request.params);
+}
+
+/**
+ * Decode a request of type analysis.updateOptions
+ *
+ * Update the options controlling analysis based on the given set of options.
+ * Any options that are not included in the analysis options will not be
+ * changed. If there are options in the analysis options that are not valid an
+ * error will be reported but the values of the valid options will still be
+ * updated.
+ */
+AnalysisUpdateOptionsParams decodeAnalysisUpdateOptionsRequest(Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeAnalysisUpdateOptionsParams("params", request.params);
+}
+
+/**
+ * Decode a notification of type analysis.errors
+ *
+ * Reports the errors associated with a given file. The set of errors included
+ * in the notification is always a complete list that supersedes any previously
+ * reported errors.
+ *
+ * It is only possible to unsubscribe from this notification by using the
+ * command-line flag --no-error-notification.
+ */
+AnalysisErrorsParams decodeAnalysisErrorsNotification(Notification notification) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeAnalysisErrorsParams("params", notification.params);
+}
+
+/**
+ * Decode a notification of type analysis.flushResults
+ *
+ * Reports that any analysis results that were previously associated with the
+ * given files should be considered to be invalid because those files are no
+ * longer being analyzed, either because the analysis root that contained it is
+ * no longer being analyzed or because the file no longer exists.
+ *
+ * If a file is included in this notification and at some later time a
+ * notification with results for the file is received, clients should assume
+ * that the file is once again being analyzed and the information should be
+ * processed.
+ *
+ * It is not possible to subscribe to or unsubscribe from this notification.
+ */
+AnalysisFlushResultsParams decodeAnalysisFlushResultsNotification(Notification notification) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeAnalysisFlushResultsParams("params", notification.params);
+}
+
+/**
+ * Decode a notification of type analysis.folding
+ *
+ * Reports the folding regions associated with a given file. Folding regions
+ * can be nested, but will not be overlapping. Nesting occurs when a foldable
+ * element, such as a method, is nested inside another foldable element such as
+ * a class.
+ *
+ * This notification is not subscribed to by default. Clients can subscribe by
+ * including the value "FOLDING" in the list of services passed in an
+ * analysis.setSubscriptions request.
+ */
+AnalysisFoldingParams decodeAnalysisFoldingNotification(Notification notification) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeAnalysisFoldingParams("params", notification.params);
+}
+
+/**
+ * Decode a notification of type analysis.highlights
+ *
+ * Reports the highlight regions associated with a given file.
+ *
+ * This notification is not subscribed to by default. Clients can subscribe by
+ * including the value "HIGHLIGHTS" in the list of services passed in an
+ * analysis.setSubscriptions request.
+ */
+AnalysisHighlightsParams decodeAnalysisHighlightsNotification(Notification notification) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeAnalysisHighlightsParams("params", notification.params);
+}
+
+/**
+ * Decode a notification of type analysis.navigation
+ *
+ * Reports the navigation targets associated with a given file.
+ *
+ * This notification is not subscribed to by default. Clients can subscribe by
+ * including the value "NAVIGATION" in the list of services passed in an
+ * analysis.setSubscriptions request.
+ */
+AnalysisNavigationParams decodeAnalysisNavigationNotification(Notification notification) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeAnalysisNavigationParams("params", notification.params);
+}
+
+/**
+ * Decode a notification of type analysis.occurrences
+ *
+ * Reports the occurrences of references to elements within a single file.
+ *
+ * This notification is not subscribed to by default. Clients can subscribe by
+ * including the value "OCCURRENCES" in the list of services passed in an
+ * analysis.setSubscriptions request.
+ */
+AnalysisOccurrencesParams decodeAnalysisOccurrencesNotification(Notification notification) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeAnalysisOccurrencesParams("params", notification.params);
+}
+
+/**
+ * Decode a notification of type analysis.outline
+ *
+ * Reports the outline associated with a single file.
+ *
+ * This notification is not subscribed to by default. Clients can subscribe by
+ * including the value "OUTLINE" in the list of services passed in an
+ * analysis.setSubscriptions request.
+ */
+AnalysisOutlineParams decodeAnalysisOutlineNotification(Notification notification) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeAnalysisOutlineParams("params", notification.params);
+}
+
+/**
+ * Decode a notification of type analysis.overrides
+ *
+ * Reports the overridding members in a file.
+ *
+ * This notification is not subscribed to by default. Clients can subscribe by
+ * including the value "OVERRIDES" in the list of services passed in an
+ * analysis.setSubscriptions request.
+ */
+AnalysisOverridesParams decodeAnalysisOverridesNotification(Notification notification) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeAnalysisOverridesParams("params", notification.params);
+}
+
+/**
+ * Decode a request of type completion.getSuggestions
+ *
+ * Request that completion suggestions for the given offset in the given file
+ * be returned.
+ */
+CompletionGetSuggestionsParams decodeCompletionGetSuggestionsRequest(Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeCompletionGetSuggestionsParams("params", request.params);
+}
+
+/**
+ * Decode the response to a request of type completion.getSuggestions
+ *
+ * Request that completion suggestions for the given offset in the given file
+ * be returned.
+ */
+CompletionGetSuggestionsResult decodeCompletionGetSuggestionsResponse(Response response) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeCompletionGetSuggestionsResult("result", response.result);
+}
+
+/**
+ * Decode a notification of type completion.results
+ *
+ * Reports the completion suggestions that should be presented to the user. The
+ * set of suggestions included in the notification is always a complete list
+ * that supersedes any previously reported suggestions.
+ */
+CompletionResultsParams decodeCompletionResultsNotification(Notification notification) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeCompletionResultsParams("params", notification.params);
+}
+
+/**
+ * Decode a request of type search.findElementReferences
+ *
+ * Perform a search for references to the element defined or referenced at the
+ * given offset in the given file.
+ *
+ * An identifier is returned immediately, and individual results will be
+ * returned via the search.results notification as they become available.
+ */
+SearchFindElementReferencesParams decodeSearchFindElementReferencesRequest(Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeSearchFindElementReferencesParams("params", request.params);
+}
+
+/**
+ * Decode the response to a request of type search.findElementReferences
+ *
+ * Perform a search for references to the element defined or referenced at the
+ * given offset in the given file.
+ *
+ * An identifier is returned immediately, and individual results will be
+ * returned via the search.results notification as they become available.
+ */
+SearchFindElementReferencesResult decodeSearchFindElementReferencesResponse(Response response) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeSearchFindElementReferencesResult("result", response.result);
+}
+
+/**
+ * Decode a request of type search.findMemberDeclarations
+ *
+ * Perform a search for declarations of members whose name is equal to the
+ * given name.
+ *
+ * An identifier is returned immediately, and individual results will be
+ * returned via the search.results notification as they become available.
+ */
+SearchFindMemberDeclarationsParams decodeSearchFindMemberDeclarationsRequest(Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeSearchFindMemberDeclarationsParams("params", request.params);
+}
+
+/**
+ * Decode the response to a request of type search.findMemberDeclarations
+ *
+ * Perform a search for declarations of members whose name is equal to the
+ * given name.
+ *
+ * An identifier is returned immediately, and individual results will be
+ * returned via the search.results notification as they become available.
+ */
+SearchFindMemberDeclarationsResult decodeSearchFindMemberDeclarationsResponse(Response response) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeSearchFindMemberDeclarationsResult("result", response.result);
+}
+
+/**
+ * Decode a request of type search.findMemberReferences
+ *
+ * Perform a search for references to members whose name is equal to the given
+ * name. This search does not check to see that there is a member defined with
+ * the given name, so it is able to find references to undefined members as
+ * well.
+ *
+ * An identifier is returned immediately, and individual results will be
+ * returned via the search.results notification as they become available.
+ */
+SearchFindMemberReferencesParams decodeSearchFindMemberReferencesRequest(Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeSearchFindMemberReferencesParams("params", request.params);
+}
+
+/**
+ * Decode the response to a request of type search.findMemberReferences
+ *
+ * Perform a search for references to members whose name is equal to the given
+ * name. This search does not check to see that there is a member defined with
+ * the given name, so it is able to find references to undefined members as
+ * well.
+ *
+ * An identifier is returned immediately, and individual results will be
+ * returned via the search.results notification as they become available.
+ */
+SearchFindMemberReferencesResult decodeSearchFindMemberReferencesResponse(Response response) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeSearchFindMemberReferencesResult("result", response.result);
+}
+
+/**
+ * Decode a request of type search.findTopLevelDeclarations
+ *
+ * Perform a search for declarations of top-level elements (classes, typedefs,
+ * getters, setters, functions and fields) whose name matches the given
+ * pattern.
+ *
+ * An identifier is returned immediately, and individual results will be
+ * returned via the search.results notification as they become available.
+ */
+SearchFindTopLevelDeclarationsParams decodeSearchFindTopLevelDeclarationsRequest(Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeSearchFindTopLevelDeclarationsParams("params", request.params);
+}
+
+/**
+ * Decode the response to a request of type search.findTopLevelDeclarations
+ *
+ * Perform a search for declarations of top-level elements (classes, typedefs,
+ * getters, setters, functions and fields) whose name matches the given
+ * pattern.
+ *
+ * An identifier is returned immediately, and individual results will be
+ * returned via the search.results notification as they become available.
+ */
+SearchFindTopLevelDeclarationsResult decodeSearchFindTopLevelDeclarationsResponse(Response response) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeSearchFindTopLevelDeclarationsResult("result", response.result);
+}
+
+/**
+ * Decode a request of type search.getTypeHierarchy
+ *
+ * Return the type hierarchy of the class declared or referenced at the given
+ * location.
+ */
+SearchGetTypeHierarchyParams decodeSearchGetTypeHierarchyRequest(Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeSearchGetTypeHierarchyParams("params", request.params);
+}
+
+/**
+ * Decode the response to a request of type search.getTypeHierarchy
+ *
+ * Return the type hierarchy of the class declared or referenced at the given
+ * location.
+ */
+SearchGetTypeHierarchyResult decodeSearchGetTypeHierarchyResponse(Response response) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeSearchGetTypeHierarchyResult("result", response.result);
+}
+
+/**
+ * Decode a notification of type search.results
+ *
+ * Reports some or all of the results of performing a requested search. Unlike
+ * other notifications, this notification contains search results that should
+ * be added to any previously received search results associated with the same
+ * search id.
+ */
+SearchResultsParams decodeSearchResultsNotification(Notification notification) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeSearchResultsParams("params", notification.params);
+}
+
+/**
+ * Decode a request of type edit.getAssists
+ *
+ * Return the set of assists that are available at the given location. An
+ * assist is distinguished from a refactoring primarily by the fact that it
+ * affects a single file and does not require user input in order to be
+ * performed.
+ */
+EditGetAssistsParams decodeEditGetAssistsRequest(Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeEditGetAssistsParams("params", request.params);
+}
+
+/**
+ * Decode the response to a request of type edit.getAssists
+ *
+ * Return the set of assists that are available at the given location. An
+ * assist is distinguished from a refactoring primarily by the fact that it
+ * affects a single file and does not require user input in order to be
+ * performed.
+ */
+EditGetAssistsResult decodeEditGetAssistsResponse(Response response) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeEditGetAssistsResult("result", response.result);
+}
+
+/**
+ * Decode a request of type edit.getAvailableRefactorings
+ *
+ * Get a list of the kinds of refactorings that are valid for the given
+ * selection in the given file.
+ */
+EditGetAvailableRefactoringsParams decodeEditGetAvailableRefactoringsRequest(Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeEditGetAvailableRefactoringsParams("params", request.params);
+}
+
+/**
+ * Decode the response to a request of type edit.getAvailableRefactorings
+ *
+ * Get a list of the kinds of refactorings that are valid for the given
+ * selection in the given file.
+ */
+EditGetAvailableRefactoringsResult decodeEditGetAvailableRefactoringsResponse(Response response) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeEditGetAvailableRefactoringsResult("result", response.result);
+}
+
+/**
+ * Decode a request of type edit.getFixes
+ *
+ * Return the set of fixes that are available for the errors at a given offset
+ * in a given file.
+ */
+EditGetFixesParams decodeEditGetFixesRequest(Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeEditGetFixesParams("params", request.params);
+}
+
+/**
+ * Decode the response to a request of type edit.getFixes
+ *
+ * Return the set of fixes that are available for the errors at a given offset
+ * in a given file.
+ */
+EditGetFixesResult decodeEditGetFixesResponse(Response response) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeEditGetFixesResult("result", response.result);
+}
+
+/**
+ * Decode a request of type edit.getRefactoring
+ *
+ * Get the changes required to perform a refactoring.
+ */
+EditGetRefactoringParams decodeEditGetRefactoringRequest(Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeEditGetRefactoringParams("params", request.params);
+}
+
+/**
+ * Decode the response to a request of type edit.getRefactoring
+ *
+ * Get the changes required to perform a refactoring.
+ */
+EditGetRefactoringResult decodeEditGetRefactoringResponse(Response response) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeEditGetRefactoringResult("result", response.result);
+}
+
+/**
+ * Decode a request of type debug.createContext
+ *
+ * Create a debugging context for the executable file with the given path. The
+ * context that is created will persist until debug.deleteContext is used to
+ * delete it. Clients, therefore, are responsible for managing the lifetime of
+ * debugging contexts.
+ */
+DebugCreateContextParams decodeDebugCreateContextRequest(Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeDebugCreateContextParams("params", request.params);
+}
+
+/**
+ * Decode the response to a request of type debug.createContext
+ *
+ * Create a debugging context for the executable file with the given path. The
+ * context that is created will persist until debug.deleteContext is used to
+ * delete it. Clients, therefore, are responsible for managing the lifetime of
+ * debugging contexts.
+ */
+DebugCreateContextResult decodeDebugCreateContextResponse(Response response) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeDebugCreateContextResult("result", response.result);
+}
+
+/**
+ * Decode a request of type debug.deleteContext
+ *
+ * Delete the debugging context with the given identifier. The context id is no
+ * longer valid after this command. The server is allowed to re-use ids when
+ * they are no longer valid.
+ */
+DebugDeleteContextParams decodeDebugDeleteContextRequest(Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeDebugDeleteContextParams("params", request.params);
+}
+
+/**
+ * Decode a request of type debug.mapUri
+ *
+ * Map a URI from the debugging context to the file that it corresponds to, or
+ * map a file to the URI that it corresponds to in the debugging context.
+ *
+ * Exactly one of the file and uri fields must be provided.
+ */
+DebugMapUriParams decodeDebugMapUriRequest(Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeDebugMapUriParams("params", request.params);
+}
+
+/**
+ * Decode the response to a request of type debug.mapUri
+ *
+ * Map a URI from the debugging context to the file that it corresponds to, or
+ * map a file to the URI that it corresponds to in the debugging context.
+ *
+ * Exactly one of the file and uri fields must be provided.
+ */
+DebugMapUriResult decodeDebugMapUriResponse(Response response) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeDebugMapUriResult("result", response.result);
+}
+
+/**
+ * Decode a request of type debug.setSubscriptions
+ *
+ * Subscribe for services. All previous subscriptions are replaced by the given
+ * set of services.
+ *
+ * It is an error if any of the elements in the list are not valid services. If
+ * there is an error, then the current subscriptions will remain unchanged.
+ */
+DebugSetSubscriptionsParams decodeDebugSetSubscriptionsRequest(Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeDebugSetSubscriptionsParams("params", request.params);
+}
+
+/**
+ * Decode a notification of type debug.launchData
+ *
+ * Reports information needed to allow applications within the given context to
+ * be launched.
+ *
+ * This notification is not subscribed to by default. Clients can subscribe by
+ * including the value "LAUNCH_DATA" in the list of services passed in a
+ * debug.setSubscriptions request.
+ */
+DebugLaunchDataParams decodeDebugLaunchDataNotification(Notification notification) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeDebugLaunchDataParams("params", notification.params);
+}
+
+/**
+ * Decode refactoring feedback of type EXTRACT_LOCAL_VARIABLE
+ *
+ * Create a local variable initialized by a specified expression.
+ *
+ * It is an error if the range contains anything other than a complete
+ * expression (no partial expressions are allowed).
+ */
+ExtractLocalVariableFeedback decodeExtractLocalVariableFeedback(EditGetRefactoringResult refactoringResult) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeExtractLocalVariableFeedback("feedback", refactoringResult.feedback);
+}
+
+/**
+ * Decode refactoring options of type EXTRACT_LOCAL_VARIABLE
+ *
+ * Create a local variable initialized by a specified expression.
+ *
+ * It is an error if the range contains anything other than a complete
+ * expression (no partial expressions are allowed).
+ */
+ExtractLocalVariableOptions decodeExtractLocalVariableOptions(EditGetRefactoringParams refactoringParams, Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeExtractLocalVariableOptions("options", refactoringParams.options);
+}
+
+/**
+ * Decode refactoring feedback of type EXTRACT_METHOD
+ *
+ * Create a method whose body is the specified expression or list of
+ * statements, possibly augmented with a return statement.
+ *
+ * It is an error if the range contains anything other than a complete
+ * expression (no partial expressions are allowed) or a complete sequence of
+ * statements.
+ */
+ExtractMethodFeedback decodeExtractMethodFeedback(EditGetRefactoringResult refactoringResult) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeExtractMethodFeedback("feedback", refactoringResult.feedback);
+}
+
+/**
+ * Decode refactoring options of type EXTRACT_METHOD
+ *
+ * Create a method whose body is the specified expression or list of
+ * statements, possibly augmented with a return statement.
+ *
+ * It is an error if the range contains anything other than a complete
+ * expression (no partial expressions are allowed) or a complete sequence of
+ * statements.
+ */
+ExtractMethodOptions decodeExtractMethodOptions(EditGetRefactoringParams refactoringParams, Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeExtractMethodOptions("options", refactoringParams.options);
+}
+
+/**
+ * Decode refactoring options of type INLINE_METHOD
+ *
+ * Inline a method in place of one or all references to that method.
+ *
+ * It is an error if the range contains anything other than all or part of the
+ * name of a single method.
+ */
+InlineMethodOptions decodeInlineMethodOptions(EditGetRefactoringParams refactoringParams, Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeInlineMethodOptions("options", refactoringParams.options);
+}
+
+/**
+ * Decode refactoring feedback of type RENAME
+ *
+ * Rename a given element and all of the references to that element.
+ *
+ * It is an error if the range contains anything other than all or part of the
+ * name of a single function (including methods, getters and setters), variable
+ * (including fields, parameters and local variables), class or function type.
+ */
+RenameFeedback decodeRenameFeedback(EditGetRefactoringResult refactoringResult) {
+ var decoder = new ResponseDecoder();
+ return decoder.decodeRenameFeedback("feedback", refactoringResult.feedback);
+}
+
+/**
+ * Decode refactoring options of type RENAME
+ *
+ * Rename a given element and all of the references to that element.
+ *
+ * It is an error if the range contains anything other than all or part of the
+ * name of a single function (including methods, getters and setters), variable
+ * (including fields, parameters and local variables), class or function type.
+ */
+RenameOptions decodeRenameOptions(EditGetRefactoringParams refactoringParams, Request request) {
+ var decoder = new RequestDecoder(request);
+ return decoder.decodeRenameOptions("options", refactoringParams.options);
+}
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/protocol2.dart » ('j') | pkg/analysis_server/lib/src/protocol2.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698