| Index: pkg/analysis_server/lib/protocol/protocol_generated.dart
|
| diff --git a/pkg/analysis_server/lib/protocol/protocol_generated.dart b/pkg/analysis_server/lib/protocol/protocol_generated.dart
|
| index 67408251eebe4d9d67d294ec56671a91ef439499..83574bf1cef58f61f38e6050bd130aff1f6623c0 100644
|
| --- a/pkg/analysis_server/lib/protocol/protocol_generated.dart
|
| +++ b/pkg/analysis_server/lib/protocol/protocol_generated.dart
|
| @@ -11,86 +11,7 @@ import 'dart:convert' hide JsonDecoder;
|
| import 'package:analyzer/src/generated/utilities_general.dart';
|
| import 'package:analysis_server/protocol/protocol.dart';
|
| import 'package:analysis_server/src/protocol/protocol_internal.dart';
|
| -
|
| -/**
|
| - * AddContentOverlay
|
| - *
|
| - * {
|
| - * "type": "add"
|
| - * "content": String
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class AddContentOverlay implements HasToJson {
|
| - String _content;
|
| -
|
| - /**
|
| - * The new content of the file.
|
| - */
|
| - String get content => _content;
|
| -
|
| - /**
|
| - * The new content of the file.
|
| - */
|
| - void set content(String value) {
|
| - assert(value != null);
|
| - this._content = value;
|
| - }
|
| -
|
| - AddContentOverlay(String content) {
|
| - this.content = content;
|
| - }
|
| -
|
| - factory AddContentOverlay.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - if (json["type"] != "add") {
|
| - throw jsonDecoder.mismatch(jsonPath, "equal " + "add", json);
|
| - }
|
| - String content;
|
| - if (json.containsKey("content")) {
|
| - content =
|
| - jsonDecoder.decodeString(jsonPath + ".content", json["content"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "content");
|
| - }
|
| - return new AddContentOverlay(content);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "AddContentOverlay", json);
|
| - }
|
| - }
|
| -
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - result["type"] = "add";
|
| - result["content"] = content;
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is AddContentOverlay) {
|
| - return content == other.content;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, 704418402);
|
| - hash = JenkinsSmiHash.combine(hash, content.hashCode);
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| -}
|
| +import 'package:analyzer_plugin/protocol/protocol_common.dart';
|
|
|
| /**
|
| * analysis.analyzedFiles params
|
| @@ -179,261 +100,6 @@ class AnalysisAnalyzedFilesParams implements HasToJson {
|
| }
|
|
|
| /**
|
| - * AnalysisError
|
| - *
|
| - * {
|
| - * "severity": AnalysisErrorSeverity
|
| - * "type": AnalysisErrorType
|
| - * "location": Location
|
| - * "message": String
|
| - * "correction": optional String
|
| - * "code": String
|
| - * "hasFix": optional bool
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class AnalysisError implements HasToJson {
|
| - AnalysisErrorSeverity _severity;
|
| -
|
| - AnalysisErrorType _type;
|
| -
|
| - Location _location;
|
| -
|
| - String _message;
|
| -
|
| - String _correction;
|
| -
|
| - String _code;
|
| -
|
| - bool _hasFix;
|
| -
|
| - /**
|
| - * The severity of the error.
|
| - */
|
| - AnalysisErrorSeverity get severity => _severity;
|
| -
|
| - /**
|
| - * The severity of the error.
|
| - */
|
| - void set severity(AnalysisErrorSeverity value) {
|
| - assert(value != null);
|
| - this._severity = value;
|
| - }
|
| -
|
| - /**
|
| - * The type of the error.
|
| - */
|
| - AnalysisErrorType get type => _type;
|
| -
|
| - /**
|
| - * The type of the error.
|
| - */
|
| - void set type(AnalysisErrorType value) {
|
| - assert(value != null);
|
| - this._type = value;
|
| - }
|
| -
|
| - /**
|
| - * The location associated with the error.
|
| - */
|
| - Location get location => _location;
|
| -
|
| - /**
|
| - * The location associated with the error.
|
| - */
|
| - void set location(Location value) {
|
| - assert(value != null);
|
| - this._location = value;
|
| - }
|
| -
|
| - /**
|
| - * The message to be displayed for this error. The message should indicate
|
| - * what is wrong with the code and why it is wrong.
|
| - */
|
| - String get message => _message;
|
| -
|
| - /**
|
| - * The message to be displayed for this error. The message should indicate
|
| - * what is wrong with the code and why it is wrong.
|
| - */
|
| - void set message(String value) {
|
| - assert(value != null);
|
| - this._message = value;
|
| - }
|
| -
|
| - /**
|
| - * 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.
|
| - */
|
| - String get correction => _correction;
|
| -
|
| - /**
|
| - * 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.
|
| - */
|
| - void set correction(String value) {
|
| - this._correction = value;
|
| - }
|
| -
|
| - /**
|
| - * The name, as a string, of the error code associated with this error.
|
| - */
|
| - String get code => _code;
|
| -
|
| - /**
|
| - * The name, as a string, of the error code associated with this error.
|
| - */
|
| - void set code(String value) {
|
| - assert(value != null);
|
| - this._code = value;
|
| - }
|
| -
|
| - /**
|
| - * A hint to indicate to interested clients that this error has an associated
|
| - * fix (or fixes). The absence of this field implies there are not known to
|
| - * be fixes. Note that since the operation to calculate whether fixes apply
|
| - * needs to be performant it is possible that complicated tests will be
|
| - * skipped and a false negative returned. For this reason, this attribute
|
| - * should be treated as a "hint". Despite the possibility of false negatives,
|
| - * no false positives should be returned. If a client sees this flag set they
|
| - * can proceed with the confidence that there are in fact associated fixes.
|
| - */
|
| - bool get hasFix => _hasFix;
|
| -
|
| - /**
|
| - * A hint to indicate to interested clients that this error has an associated
|
| - * fix (or fixes). The absence of this field implies there are not known to
|
| - * be fixes. Note that since the operation to calculate whether fixes apply
|
| - * needs to be performant it is possible that complicated tests will be
|
| - * skipped and a false negative returned. For this reason, this attribute
|
| - * should be treated as a "hint". Despite the possibility of false negatives,
|
| - * no false positives should be returned. If a client sees this flag set they
|
| - * can proceed with the confidence that there are in fact associated fixes.
|
| - */
|
| - void set hasFix(bool value) {
|
| - this._hasFix = value;
|
| - }
|
| -
|
| - AnalysisError(AnalysisErrorSeverity severity, AnalysisErrorType type,
|
| - Location location, String message, String code,
|
| - {String correction, bool hasFix}) {
|
| - this.severity = severity;
|
| - this.type = type;
|
| - this.location = location;
|
| - this.message = message;
|
| - this.correction = correction;
|
| - this.code = code;
|
| - this.hasFix = hasFix;
|
| - }
|
| -
|
| - factory AnalysisError.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - AnalysisErrorSeverity severity;
|
| - if (json.containsKey("severity")) {
|
| - severity = new AnalysisErrorSeverity.fromJson(
|
| - jsonDecoder, jsonPath + ".severity", json["severity"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "severity");
|
| - }
|
| - AnalysisErrorType type;
|
| - if (json.containsKey("type")) {
|
| - type = new AnalysisErrorType.fromJson(
|
| - jsonDecoder, jsonPath + ".type", json["type"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "type");
|
| - }
|
| - Location location;
|
| - if (json.containsKey("location")) {
|
| - location = new Location.fromJson(
|
| - jsonDecoder, jsonPath + ".location", json["location"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "location");
|
| - }
|
| - String message;
|
| - if (json.containsKey("message")) {
|
| - message =
|
| - jsonDecoder.decodeString(jsonPath + ".message", json["message"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "message");
|
| - }
|
| - String correction;
|
| - if (json.containsKey("correction")) {
|
| - correction = jsonDecoder.decodeString(
|
| - jsonPath + ".correction", json["correction"]);
|
| - }
|
| - String code;
|
| - if (json.containsKey("code")) {
|
| - code = jsonDecoder.decodeString(jsonPath + ".code", json["code"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "code");
|
| - }
|
| - bool hasFix;
|
| - if (json.containsKey("hasFix")) {
|
| - hasFix = jsonDecoder.decodeBool(jsonPath + ".hasFix", json["hasFix"]);
|
| - }
|
| - return new AnalysisError(severity, type, location, message, code,
|
| - correction: correction, hasFix: hasFix);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "AnalysisError", json);
|
| - }
|
| - }
|
| -
|
| - @override
|
| - 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;
|
| - }
|
| - result["code"] = code;
|
| - if (hasFix != null) {
|
| - result["hasFix"] = hasFix;
|
| - }
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is AnalysisError) {
|
| - return severity == other.severity &&
|
| - type == other.type &&
|
| - location == other.location &&
|
| - message == other.message &&
|
| - correction == other.correction &&
|
| - code == other.code &&
|
| - hasFix == other.hasFix;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - 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);
|
| - hash = JenkinsSmiHash.combine(hash, code.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, hasFix.hashCode);
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| -}
|
| -
|
| -/**
|
| * AnalysisErrorFixes
|
| *
|
| * {
|
| @@ -544,214 +210,55 @@ class AnalysisErrorFixes implements HasToJson {
|
| }
|
|
|
| /**
|
| - * AnalysisErrorSeverity
|
| + * analysis.errors params
|
| *
|
| - * enum {
|
| - * INFO
|
| - * WARNING
|
| - * ERROR
|
| + * {
|
| + * "file": FilePath
|
| + * "errors": List<AnalysisError>
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class AnalysisErrorSeverity implements Enum {
|
| - static const AnalysisErrorSeverity INFO =
|
| - const AnalysisErrorSeverity._("INFO");
|
| +class AnalysisErrorsParams implements HasToJson {
|
| + String _file;
|
|
|
| - static const AnalysisErrorSeverity WARNING =
|
| - const AnalysisErrorSeverity._("WARNING");
|
| + List<AnalysisError> _errors;
|
|
|
| - static const AnalysisErrorSeverity ERROR =
|
| - const AnalysisErrorSeverity._("ERROR");
|
| + /**
|
| + * The file containing the errors.
|
| + */
|
| + String get file => _file;
|
|
|
| /**
|
| - * A list containing all of the enum values that are defined.
|
| + * The file containing the errors.
|
| */
|
| - static const List<AnalysisErrorSeverity> VALUES =
|
| - const <AnalysisErrorSeverity>[INFO, WARNING, ERROR];
|
| + void set file(String value) {
|
| + assert(value != null);
|
| + this._file = value;
|
| + }
|
|
|
| - @override
|
| - final String name;
|
| + /**
|
| + * The errors contained in the file.
|
| + */
|
| + List<AnalysisError> get errors => _errors;
|
|
|
| - const AnalysisErrorSeverity._(this.name);
|
| + /**
|
| + * The errors contained in the file.
|
| + */
|
| + void set errors(List<AnalysisError> value) {
|
| + assert(value != null);
|
| + this._errors = value;
|
| + }
|
|
|
| - factory AnalysisErrorSeverity(String name) {
|
| - switch (name) {
|
| - case "INFO":
|
| - return INFO;
|
| - case "WARNING":
|
| - return WARNING;
|
| - case "ERROR":
|
| - return ERROR;
|
| - }
|
| - throw new Exception('Illegal enum value: $name');
|
| + AnalysisErrorsParams(String file, List<AnalysisError> errors) {
|
| + this.file = file;
|
| + this.errors = errors;
|
| }
|
|
|
| - factory AnalysisErrorSeverity.fromJson(
|
| + factory AnalysisErrorsParams.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json is String) {
|
| - try {
|
| - return new AnalysisErrorSeverity(json);
|
| - } catch (_) {
|
| - // Fall through
|
| - }
|
| - }
|
| - throw jsonDecoder.mismatch(jsonPath, "AnalysisErrorSeverity", json);
|
| - }
|
| -
|
| - @override
|
| - String toString() => "AnalysisErrorSeverity.$name";
|
| -
|
| - String toJson() => name;
|
| -}
|
| -
|
| -/**
|
| - * AnalysisErrorType
|
| - *
|
| - * enum {
|
| - * CHECKED_MODE_COMPILE_TIME_ERROR
|
| - * COMPILE_TIME_ERROR
|
| - * HINT
|
| - * LINT
|
| - * STATIC_TYPE_WARNING
|
| - * STATIC_WARNING
|
| - * SYNTACTIC_ERROR
|
| - * TODO
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class AnalysisErrorType implements Enum {
|
| - static const AnalysisErrorType CHECKED_MODE_COMPILE_TIME_ERROR =
|
| - const AnalysisErrorType._("CHECKED_MODE_COMPILE_TIME_ERROR");
|
| -
|
| - static const AnalysisErrorType COMPILE_TIME_ERROR =
|
| - const AnalysisErrorType._("COMPILE_TIME_ERROR");
|
| -
|
| - static const AnalysisErrorType HINT = const AnalysisErrorType._("HINT");
|
| -
|
| - static const AnalysisErrorType LINT = const AnalysisErrorType._("LINT");
|
| -
|
| - static const AnalysisErrorType STATIC_TYPE_WARNING =
|
| - const AnalysisErrorType._("STATIC_TYPE_WARNING");
|
| -
|
| - static const AnalysisErrorType STATIC_WARNING =
|
| - const AnalysisErrorType._("STATIC_WARNING");
|
| -
|
| - static const AnalysisErrorType SYNTACTIC_ERROR =
|
| - const AnalysisErrorType._("SYNTACTIC_ERROR");
|
| -
|
| - static const AnalysisErrorType TODO = const AnalysisErrorType._("TODO");
|
| -
|
| - /**
|
| - * A list containing all of the enum values that are defined.
|
| - */
|
| - static const List<AnalysisErrorType> VALUES = const <AnalysisErrorType>[
|
| - CHECKED_MODE_COMPILE_TIME_ERROR,
|
| - COMPILE_TIME_ERROR,
|
| - HINT,
|
| - LINT,
|
| - STATIC_TYPE_WARNING,
|
| - STATIC_WARNING,
|
| - SYNTACTIC_ERROR,
|
| - TODO
|
| - ];
|
| -
|
| - @override
|
| - final String name;
|
| -
|
| - const AnalysisErrorType._(this.name);
|
| -
|
| - factory AnalysisErrorType(String name) {
|
| - switch (name) {
|
| - case "CHECKED_MODE_COMPILE_TIME_ERROR":
|
| - return CHECKED_MODE_COMPILE_TIME_ERROR;
|
| - case "COMPILE_TIME_ERROR":
|
| - return COMPILE_TIME_ERROR;
|
| - case "HINT":
|
| - return HINT;
|
| - case "LINT":
|
| - return LINT;
|
| - 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');
|
| - }
|
| -
|
| - factory AnalysisErrorType.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json is String) {
|
| - try {
|
| - return new AnalysisErrorType(json);
|
| - } catch (_) {
|
| - // Fall through
|
| - }
|
| - }
|
| - throw jsonDecoder.mismatch(jsonPath, "AnalysisErrorType", json);
|
| - }
|
| -
|
| - @override
|
| - String toString() => "AnalysisErrorType.$name";
|
| -
|
| - String toJson() => name;
|
| -}
|
| -
|
| -/**
|
| - * analysis.errors params
|
| - *
|
| - * {
|
| - * "file": FilePath
|
| - * "errors": List<AnalysisError>
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class AnalysisErrorsParams implements HasToJson {
|
| - String _file;
|
| -
|
| - List<AnalysisError> _errors;
|
| -
|
| - /**
|
| - * The file containing the errors.
|
| - */
|
| - String get file => _file;
|
| -
|
| - /**
|
| - * The file containing the errors.
|
| - */
|
| - void set file(String value) {
|
| - assert(value != null);
|
| - this._file = value;
|
| - }
|
| -
|
| - /**
|
| - * The errors contained in the file.
|
| - */
|
| - List<AnalysisError> get errors => _errors;
|
| -
|
| - /**
|
| - * The errors contained in the file.
|
| - */
|
| - void set errors(List<AnalysisError> value) {
|
| - assert(value != null);
|
| - this._errors = value;
|
| - }
|
| -
|
| - AnalysisErrorsParams(String file, List<AnalysisError> errors) {
|
| - this.file = file;
|
| - this.errors = errors;
|
| - }
|
| -
|
| - factory AnalysisErrorsParams.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| + if (json == null) {
|
| + json = {};
|
| }
|
| if (json is Map) {
|
| String file;
|
| @@ -4518,90 +4025,6 @@ class AnalysisUpdateOptionsResult implements ResponseResult {
|
| }
|
|
|
| /**
|
| - * ChangeContentOverlay
|
| - *
|
| - * {
|
| - * "type": "change"
|
| - * "edits": List<SourceEdit>
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class ChangeContentOverlay implements HasToJson {
|
| - List<SourceEdit> _edits;
|
| -
|
| - /**
|
| - * The edits to be applied to the file.
|
| - */
|
| - List<SourceEdit> get edits => _edits;
|
| -
|
| - /**
|
| - * The edits to be applied to the file.
|
| - */
|
| - void set edits(List<SourceEdit> value) {
|
| - assert(value != null);
|
| - this._edits = value;
|
| - }
|
| -
|
| - ChangeContentOverlay(List<SourceEdit> edits) {
|
| - this.edits = edits;
|
| - }
|
| -
|
| - factory ChangeContentOverlay.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - if (json["type"] != "change") {
|
| - throw jsonDecoder.mismatch(jsonPath, "equal " + "change", json);
|
| - }
|
| - List<SourceEdit> edits;
|
| - if (json.containsKey("edits")) {
|
| - edits = jsonDecoder.decodeList(
|
| - jsonPath + ".edits",
|
| - json["edits"],
|
| - (String jsonPath, Object json) =>
|
| - new SourceEdit.fromJson(jsonDecoder, jsonPath, json));
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "edits");
|
| - }
|
| - return new ChangeContentOverlay(edits);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "ChangeContentOverlay", json);
|
| - }
|
| - }
|
| -
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - result["type"] = "change";
|
| - result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList();
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is ChangeContentOverlay) {
|
| - return listEqual(
|
| - edits, other.edits, (SourceEdit a, SourceEdit b) => a == b);
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, 873118866);
|
| - hash = JenkinsSmiHash.combine(hash, edits.hashCode);
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| -}
|
| -
|
| -/**
|
| * completion.getSuggestions params
|
| *
|
| * {
|
| @@ -5013,637 +4436,160 @@ class CompletionResultsParams implements HasToJson {
|
| }
|
|
|
| /**
|
| - * CompletionSuggestion
|
| + * ContextData
|
| *
|
| * {
|
| - * "kind": CompletionSuggestionKind
|
| - * "relevance": int
|
| - * "completion": String
|
| - * "selectionOffset": int
|
| - * "selectionLength": int
|
| - * "isDeprecated": bool
|
| - * "isPotential": bool
|
| - * "docSummary": optional String
|
| - * "docComplete": optional String
|
| - * "declaringType": optional String
|
| - * "defaultArgumentListString": optional String
|
| - * "defaultArgumentListTextRanges": optional List<int>
|
| - * "element": optional Element
|
| - * "returnType": optional String
|
| - * "parameterNames": optional List<String>
|
| - * "parameterTypes": optional List<String>
|
| - * "requiredParameterCount": optional int
|
| - * "hasNamedParameters": optional bool
|
| - * "parameterName": optional String
|
| - * "parameterType": optional String
|
| - * "importUri": optional String
|
| + * "name": String
|
| + * "explicitFileCount": int
|
| + * "implicitFileCount": int
|
| + * "workItemQueueLength": int
|
| + * "cacheEntryExceptions": List<String>
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class CompletionSuggestion implements HasToJson {
|
| - CompletionSuggestionKind _kind;
|
| -
|
| - int _relevance;
|
| -
|
| - String _completion;
|
| -
|
| - int _selectionOffset;
|
| -
|
| - int _selectionLength;
|
| -
|
| - bool _isDeprecated;
|
| -
|
| - bool _isPotential;
|
| -
|
| - String _docSummary;
|
| -
|
| - String _docComplete;
|
| -
|
| - String _declaringType;
|
| -
|
| - String _defaultArgumentListString;
|
| -
|
| - List<int> _defaultArgumentListTextRanges;
|
| -
|
| - Element _element;
|
| -
|
| - String _returnType;
|
| -
|
| - List<String> _parameterNames;
|
| -
|
| - List<String> _parameterTypes;
|
| -
|
| - int _requiredParameterCount;
|
| -
|
| - bool _hasNamedParameters;
|
| -
|
| - String _parameterName;
|
| +class ContextData implements HasToJson {
|
| + String _name;
|
|
|
| - String _parameterType;
|
| + int _explicitFileCount;
|
|
|
| - String _importUri;
|
| + int _implicitFileCount;
|
|
|
| - /**
|
| - * The kind of element being suggested.
|
| - */
|
| - CompletionSuggestionKind get kind => _kind;
|
| + int _workItemQueueLength;
|
|
|
| - /**
|
| - * The kind of element being suggested.
|
| - */
|
| - void set kind(CompletionSuggestionKind value) {
|
| - assert(value != null);
|
| - this._kind = value;
|
| - }
|
| + List<String> _cacheEntryExceptions;
|
|
|
| /**
|
| - * The relevance of this completion suggestion where a higher number
|
| - * indicates a higher relevance.
|
| + * The name of the context.
|
| */
|
| - int get relevance => _relevance;
|
| + String get name => _name;
|
|
|
| /**
|
| - * The relevance of this completion suggestion where a higher number
|
| - * indicates a higher relevance.
|
| + * The name of the context.
|
| */
|
| - void set relevance(int value) {
|
| + void set name(String value) {
|
| assert(value != null);
|
| - this._relevance = value;
|
| + this._name = value;
|
| }
|
|
|
| /**
|
| - * 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.
|
| + * Explicitly analyzed files.
|
| */
|
| - String get completion => _completion;
|
| + int get explicitFileCount => _explicitFileCount;
|
|
|
| /**
|
| - * 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.
|
| + * Explicitly analyzed files.
|
| */
|
| - void set completion(String value) {
|
| + void set explicitFileCount(int value) {
|
| assert(value != null);
|
| - this._completion = value;
|
| + this._explicitFileCount = value;
|
| }
|
|
|
| /**
|
| - * The offset, relative to the beginning of the completion, of where the
|
| - * selection should be placed after insertion.
|
| + * Implicitly analyzed files.
|
| */
|
| - int get selectionOffset => _selectionOffset;
|
| + int get implicitFileCount => _implicitFileCount;
|
|
|
| /**
|
| - * The offset, relative to the beginning of the completion, of where the
|
| - * selection should be placed after insertion.
|
| + * Implicitly analyzed files.
|
| */
|
| - void set selectionOffset(int value) {
|
| + void set implicitFileCount(int value) {
|
| assert(value != null);
|
| - this._selectionOffset = value;
|
| + this._implicitFileCount = value;
|
| }
|
|
|
| /**
|
| - * The number of characters that should be selected after insertion.
|
| + * The number of work items in the queue.
|
| */
|
| - int get selectionLength => _selectionLength;
|
| + int get workItemQueueLength => _workItemQueueLength;
|
|
|
| /**
|
| - * The number of characters that should be selected after insertion.
|
| + * The number of work items in the queue.
|
| */
|
| - void set selectionLength(int value) {
|
| + void set workItemQueueLength(int value) {
|
| assert(value != null);
|
| - this._selectionLength = value;
|
| + this._workItemQueueLength = value;
|
| }
|
|
|
| /**
|
| - * True if the suggested element is deprecated.
|
| + * Exceptions associated with cache entries.
|
| */
|
| - bool get isDeprecated => _isDeprecated;
|
| + List<String> get cacheEntryExceptions => _cacheEntryExceptions;
|
|
|
| /**
|
| - * True if the suggested element is deprecated.
|
| + * Exceptions associated with cache entries.
|
| */
|
| - void set isDeprecated(bool value) {
|
| + void set cacheEntryExceptions(List<String> value) {
|
| assert(value != null);
|
| - this._isDeprecated = value;
|
| + this._cacheEntryExceptions = value;
|
| }
|
|
|
| - /**
|
| - * True if the element is not known to be valid for the target. This happens
|
| - * if the type of the target is dynamic.
|
| - */
|
| - bool get isPotential => _isPotential;
|
| -
|
| - /**
|
| - * True if the element is not known to be valid for the target. This happens
|
| - * if the type of the target is dynamic.
|
| - */
|
| - void set isPotential(bool value) {
|
| - assert(value != null);
|
| - this._isPotential = value;
|
| + ContextData(String name, int explicitFileCount, int implicitFileCount,
|
| + int workItemQueueLength, List<String> cacheEntryExceptions) {
|
| + this.name = name;
|
| + this.explicitFileCount = explicitFileCount;
|
| + this.implicitFileCount = implicitFileCount;
|
| + this.workItemQueueLength = workItemQueueLength;
|
| + this.cacheEntryExceptions = cacheEntryExceptions;
|
| }
|
|
|
| - /**
|
| - * 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.
|
| - */
|
| - String get docSummary => _docSummary;
|
| -
|
| - /**
|
| - * 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.
|
| - */
|
| - void set docSummary(String value) {
|
| - this._docSummary = value;
|
| - }
|
| -
|
| - /**
|
| - * The Dartdoc associated with the element being suggested, This field is
|
| - * omitted if there is no Dartdoc associated with the element.
|
| - */
|
| - String get docComplete => _docComplete;
|
| -
|
| - /**
|
| - * The Dartdoc associated with the element being suggested, This field is
|
| - * omitted if there is no Dartdoc associated with the element.
|
| - */
|
| - void set docComplete(String value) {
|
| - this._docComplete = value;
|
| - }
|
| -
|
| - /**
|
| - * The class that declares the element being suggested. This field is omitted
|
| - * if the suggested element is not a member of a class.
|
| - */
|
| - String get declaringType => _declaringType;
|
| -
|
| - /**
|
| - * The class that declares the element being suggested. This field is omitted
|
| - * if the suggested element is not a member of a class.
|
| - */
|
| - void set declaringType(String value) {
|
| - this._declaringType = value;
|
| - }
|
| -
|
| - /**
|
| - * A default String for use in generating argument list source contents on
|
| - * the client side.
|
| - */
|
| - String get defaultArgumentListString => _defaultArgumentListString;
|
| -
|
| - /**
|
| - * A default String for use in generating argument list source contents on
|
| - * the client side.
|
| - */
|
| - void set defaultArgumentListString(String value) {
|
| - this._defaultArgumentListString = value;
|
| - }
|
| -
|
| - /**
|
| - * Pairs of offsets and lengths describing 'defaultArgumentListString' text
|
| - * ranges suitable for use by clients to set up linked edits of default
|
| - * argument source contents. For example, given an argument list string 'x,
|
| - * y', the corresponding text range [0, 1, 3, 1], indicates two text ranges
|
| - * of length 1, starting at offsets 0 and 3. Clients can use these ranges to
|
| - * treat the 'x' and 'y' values specially for linked edits.
|
| - */
|
| - List<int> get defaultArgumentListTextRanges => _defaultArgumentListTextRanges;
|
| -
|
| - /**
|
| - * Pairs of offsets and lengths describing 'defaultArgumentListString' text
|
| - * ranges suitable for use by clients to set up linked edits of default
|
| - * argument source contents. For example, given an argument list string 'x,
|
| - * y', the corresponding text range [0, 1, 3, 1], indicates two text ranges
|
| - * of length 1, starting at offsets 0 and 3. Clients can use these ranges to
|
| - * treat the 'x' and 'y' values specially for linked edits.
|
| - */
|
| - void set defaultArgumentListTextRanges(List<int> value) {
|
| - this._defaultArgumentListTextRanges = value;
|
| - }
|
| -
|
| - /**
|
| - * Information about the element reference being suggested.
|
| - */
|
| - Element get element => _element;
|
| -
|
| - /**
|
| - * Information about the element reference being suggested.
|
| - */
|
| - void set element(Element value) {
|
| - this._element = value;
|
| - }
|
| -
|
| - /**
|
| - * The return type of the getter, function or method or the type of the field
|
| - * being suggested. This field is omitted if the suggested element is not a
|
| - * getter, function or method.
|
| - */
|
| - String get returnType => _returnType;
|
| -
|
| - /**
|
| - * The return type of the getter, function or method or the type of the field
|
| - * being suggested. This field is omitted if the suggested element is not a
|
| - * getter, function or method.
|
| - */
|
| - void set returnType(String value) {
|
| - this._returnType = value;
|
| - }
|
| -
|
| - /**
|
| - * 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.
|
| - */
|
| - List<String> get parameterNames => _parameterNames;
|
| -
|
| - /**
|
| - * 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.
|
| - */
|
| - void set parameterNames(List<String> value) {
|
| - this._parameterNames = value;
|
| - }
|
| -
|
| - /**
|
| - * The types of the parameters of the function or method being suggested.
|
| - * This field is omitted if the parameterNames field is omitted.
|
| - */
|
| - List<String> get parameterTypes => _parameterTypes;
|
| -
|
| - /**
|
| - * The types of the parameters of the function or method being suggested.
|
| - * This field is omitted if the parameterNames field is omitted.
|
| - */
|
| - void set parameterTypes(List<String> value) {
|
| - this._parameterTypes = value;
|
| - }
|
| -
|
| - /**
|
| - * The number of required parameters for the function or method being
|
| - * suggested. This field is omitted if the parameterNames field is omitted.
|
| - */
|
| - int get requiredParameterCount => _requiredParameterCount;
|
| -
|
| - /**
|
| - * The number of required parameters for the function or method being
|
| - * suggested. This field is omitted if the parameterNames field is omitted.
|
| - */
|
| - void set requiredParameterCount(int value) {
|
| - this._requiredParameterCount = value;
|
| - }
|
| -
|
| - /**
|
| - * True if the function or method being suggested has at least one named
|
| - * parameter. This field is omitted if the parameterNames field is omitted.
|
| - */
|
| - bool get hasNamedParameters => _hasNamedParameters;
|
| -
|
| - /**
|
| - * True if the function or method being suggested has at least one named
|
| - * parameter. This field is omitted if the parameterNames field is omitted.
|
| - */
|
| - void set hasNamedParameters(bool value) {
|
| - this._hasNamedParameters = value;
|
| - }
|
| -
|
| - /**
|
| - * 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.
|
| - */
|
| - String get parameterName => _parameterName;
|
| -
|
| - /**
|
| - * 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.
|
| - */
|
| - void set parameterName(String value) {
|
| - this._parameterName = value;
|
| - }
|
| -
|
| - /**
|
| - * The type of the options parameter being suggested. This field is omitted
|
| - * if the parameterName field is omitted.
|
| - */
|
| - String get parameterType => _parameterType;
|
| -
|
| - /**
|
| - * The type of the options parameter being suggested. This field is omitted
|
| - * if the parameterName field is omitted.
|
| - */
|
| - void set parameterType(String value) {
|
| - this._parameterType = value;
|
| - }
|
| -
|
| - /**
|
| - * The import to be added if the suggestion is out of scope and needs an
|
| - * import to be added to be in scope.
|
| - */
|
| - String get importUri => _importUri;
|
| -
|
| - /**
|
| - * The import to be added if the suggestion is out of scope and needs an
|
| - * import to be added to be in scope.
|
| - */
|
| - void set importUri(String value) {
|
| - this._importUri = value;
|
| - }
|
| -
|
| - CompletionSuggestion(
|
| - CompletionSuggestionKind kind,
|
| - int relevance,
|
| - String completion,
|
| - int selectionOffset,
|
| - int selectionLength,
|
| - bool isDeprecated,
|
| - bool isPotential,
|
| - {String docSummary,
|
| - String docComplete,
|
| - String declaringType,
|
| - String defaultArgumentListString,
|
| - List<int> defaultArgumentListTextRanges,
|
| - Element element,
|
| - String returnType,
|
| - List<String> parameterNames,
|
| - List<String> parameterTypes,
|
| - int requiredParameterCount,
|
| - bool hasNamedParameters,
|
| - String parameterName,
|
| - String parameterType,
|
| - String importUri}) {
|
| - this.kind = kind;
|
| - this.relevance = relevance;
|
| - this.completion = completion;
|
| - this.selectionOffset = selectionOffset;
|
| - this.selectionLength = selectionLength;
|
| - this.isDeprecated = isDeprecated;
|
| - this.isPotential = isPotential;
|
| - this.docSummary = docSummary;
|
| - this.docComplete = docComplete;
|
| - this.declaringType = declaringType;
|
| - this.defaultArgumentListString = defaultArgumentListString;
|
| - this.defaultArgumentListTextRanges = defaultArgumentListTextRanges;
|
| - this.element = element;
|
| - this.returnType = returnType;
|
| - this.parameterNames = parameterNames;
|
| - this.parameterTypes = parameterTypes;
|
| - this.requiredParameterCount = requiredParameterCount;
|
| - this.hasNamedParameters = hasNamedParameters;
|
| - this.parameterName = parameterName;
|
| - this.parameterType = parameterType;
|
| - this.importUri = importUri;
|
| - }
|
| -
|
| - factory CompletionSuggestion.fromJson(
|
| + factory ContextData.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - CompletionSuggestionKind kind;
|
| - if (json.containsKey("kind")) {
|
| - kind = new CompletionSuggestionKind.fromJson(
|
| - jsonDecoder, jsonPath + ".kind", json["kind"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "kind");
|
| - }
|
| - int relevance;
|
| - if (json.containsKey("relevance")) {
|
| - relevance =
|
| - jsonDecoder.decodeInt(jsonPath + ".relevance", json["relevance"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "relevance");
|
| - }
|
| - String completion;
|
| - if (json.containsKey("completion")) {
|
| - completion = jsonDecoder.decodeString(
|
| - jsonPath + ".completion", json["completion"]);
|
| + String name;
|
| + if (json.containsKey("name")) {
|
| + name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "completion");
|
| + throw jsonDecoder.mismatch(jsonPath, "name");
|
| }
|
| - int selectionOffset;
|
| - if (json.containsKey("selectionOffset")) {
|
| - selectionOffset = jsonDecoder.decodeInt(
|
| - jsonPath + ".selectionOffset", json["selectionOffset"]);
|
| + int explicitFileCount;
|
| + if (json.containsKey("explicitFileCount")) {
|
| + explicitFileCount = jsonDecoder.decodeInt(
|
| + jsonPath + ".explicitFileCount", json["explicitFileCount"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "selectionOffset");
|
| + throw jsonDecoder.mismatch(jsonPath, "explicitFileCount");
|
| }
|
| - int selectionLength;
|
| - if (json.containsKey("selectionLength")) {
|
| - selectionLength = jsonDecoder.decodeInt(
|
| - jsonPath + ".selectionLength", json["selectionLength"]);
|
| + int implicitFileCount;
|
| + if (json.containsKey("implicitFileCount")) {
|
| + implicitFileCount = jsonDecoder.decodeInt(
|
| + jsonPath + ".implicitFileCount", json["implicitFileCount"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "selectionLength");
|
| + throw jsonDecoder.mismatch(jsonPath, "implicitFileCount");
|
| }
|
| - bool isDeprecated;
|
| - if (json.containsKey("isDeprecated")) {
|
| - isDeprecated = jsonDecoder.decodeBool(
|
| - jsonPath + ".isDeprecated", json["isDeprecated"]);
|
| + int workItemQueueLength;
|
| + if (json.containsKey("workItemQueueLength")) {
|
| + workItemQueueLength = jsonDecoder.decodeInt(
|
| + jsonPath + ".workItemQueueLength", json["workItemQueueLength"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "isDeprecated");
|
| + throw jsonDecoder.mismatch(jsonPath, "workItemQueueLength");
|
| }
|
| - bool isPotential;
|
| - if (json.containsKey("isPotential")) {
|
| - isPotential = jsonDecoder.decodeBool(
|
| - jsonPath + ".isPotential", json["isPotential"]);
|
| + List<String> cacheEntryExceptions;
|
| + if (json.containsKey("cacheEntryExceptions")) {
|
| + cacheEntryExceptions = jsonDecoder.decodeList(
|
| + jsonPath + ".cacheEntryExceptions",
|
| + json["cacheEntryExceptions"],
|
| + jsonDecoder.decodeString);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "isPotential");
|
| - }
|
| - String docSummary;
|
| - if (json.containsKey("docSummary")) {
|
| - docSummary = jsonDecoder.decodeString(
|
| - jsonPath + ".docSummary", json["docSummary"]);
|
| - }
|
| - String docComplete;
|
| - if (json.containsKey("docComplete")) {
|
| - docComplete = jsonDecoder.decodeString(
|
| - jsonPath + ".docComplete", json["docComplete"]);
|
| - }
|
| - String declaringType;
|
| - if (json.containsKey("declaringType")) {
|
| - declaringType = jsonDecoder.decodeString(
|
| - jsonPath + ".declaringType", json["declaringType"]);
|
| - }
|
| - String defaultArgumentListString;
|
| - if (json.containsKey("defaultArgumentListString")) {
|
| - defaultArgumentListString = jsonDecoder.decodeString(
|
| - jsonPath + ".defaultArgumentListString",
|
| - json["defaultArgumentListString"]);
|
| - }
|
| - List<int> defaultArgumentListTextRanges;
|
| - if (json.containsKey("defaultArgumentListTextRanges")) {
|
| - defaultArgumentListTextRanges = jsonDecoder.decodeList(
|
| - jsonPath + ".defaultArgumentListTextRanges",
|
| - json["defaultArgumentListTextRanges"],
|
| - jsonDecoder.decodeInt);
|
| - }
|
| - Element element;
|
| - if (json.containsKey("element")) {
|
| - element = new Element.fromJson(
|
| - jsonDecoder, jsonPath + ".element", json["element"]);
|
| - }
|
| - String returnType;
|
| - if (json.containsKey("returnType")) {
|
| - returnType = jsonDecoder.decodeString(
|
| - jsonPath + ".returnType", json["returnType"]);
|
| - }
|
| - List<String> parameterNames;
|
| - if (json.containsKey("parameterNames")) {
|
| - parameterNames = jsonDecoder.decodeList(jsonPath + ".parameterNames",
|
| - json["parameterNames"], jsonDecoder.decodeString);
|
| - }
|
| - List<String> parameterTypes;
|
| - if (json.containsKey("parameterTypes")) {
|
| - parameterTypes = jsonDecoder.decodeList(jsonPath + ".parameterTypes",
|
| - json["parameterTypes"], jsonDecoder.decodeString);
|
| - }
|
| - int requiredParameterCount;
|
| - if (json.containsKey("requiredParameterCount")) {
|
| - requiredParameterCount = jsonDecoder.decodeInt(
|
| - jsonPath + ".requiredParameterCount",
|
| - json["requiredParameterCount"]);
|
| - }
|
| - bool hasNamedParameters;
|
| - if (json.containsKey("hasNamedParameters")) {
|
| - hasNamedParameters = jsonDecoder.decodeBool(
|
| - jsonPath + ".hasNamedParameters", json["hasNamedParameters"]);
|
| - }
|
| - String parameterName;
|
| - if (json.containsKey("parameterName")) {
|
| - parameterName = jsonDecoder.decodeString(
|
| - jsonPath + ".parameterName", json["parameterName"]);
|
| - }
|
| - String parameterType;
|
| - if (json.containsKey("parameterType")) {
|
| - parameterType = jsonDecoder.decodeString(
|
| - jsonPath + ".parameterType", json["parameterType"]);
|
| - }
|
| - String importUri;
|
| - if (json.containsKey("importUri")) {
|
| - importUri = jsonDecoder.decodeString(
|
| - jsonPath + ".importUri", json["importUri"]);
|
| + throw jsonDecoder.mismatch(jsonPath, "cacheEntryExceptions");
|
| }
|
| - return new CompletionSuggestion(kind, relevance, completion,
|
| - selectionOffset, selectionLength, isDeprecated, isPotential,
|
| - docSummary: docSummary,
|
| - docComplete: docComplete,
|
| - declaringType: declaringType,
|
| - defaultArgumentListString: defaultArgumentListString,
|
| - defaultArgumentListTextRanges: defaultArgumentListTextRanges,
|
| - element: element,
|
| - returnType: returnType,
|
| - parameterNames: parameterNames,
|
| - parameterTypes: parameterTypes,
|
| - requiredParameterCount: requiredParameterCount,
|
| - hasNamedParameters: hasNamedParameters,
|
| - parameterName: parameterName,
|
| - parameterType: parameterType,
|
| - importUri: importUri);
|
| + return new ContextData(name, explicitFileCount, implicitFileCount,
|
| + workItemQueueLength, cacheEntryExceptions);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "CompletionSuggestion", json);
|
| + throw jsonDecoder.mismatch(jsonPath, "ContextData", json);
|
| }
|
| }
|
|
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| - result["kind"] = kind.toJson();
|
| - result["relevance"] = relevance;
|
| - 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 (defaultArgumentListString != null) {
|
| - result["defaultArgumentListString"] = defaultArgumentListString;
|
| - }
|
| - if (defaultArgumentListTextRanges != null) {
|
| - result["defaultArgumentListTextRanges"] = defaultArgumentListTextRanges;
|
| - }
|
| - if (element != null) {
|
| - result["element"] = element.toJson();
|
| - }
|
| - 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 (hasNamedParameters != null) {
|
| - result["hasNamedParameters"] = hasNamedParameters;
|
| - }
|
| - if (parameterName != null) {
|
| - result["parameterName"] = parameterName;
|
| - }
|
| - if (parameterType != null) {
|
| - result["parameterType"] = parameterType;
|
| - }
|
| - if (importUri != null) {
|
| - result["importUri"] = importUri;
|
| - }
|
| + result["name"] = name;
|
| + result["explicitFileCount"] = explicitFileCount;
|
| + result["implicitFileCount"] = implicitFileCount;
|
| + result["workItemQueueLength"] = workItemQueueLength;
|
| + result["cacheEntryExceptions"] = cacheEntryExceptions;
|
| return result;
|
| }
|
|
|
| @@ -5652,31 +4598,13 @@ class CompletionSuggestion implements HasToJson {
|
|
|
| @override
|
| 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 &&
|
| - defaultArgumentListString == other.defaultArgumentListString &&
|
| - listEqual(defaultArgumentListTextRanges,
|
| - other.defaultArgumentListTextRanges, (int a, int b) => a == b) &&
|
| - element == other.element &&
|
| - returnType == other.returnType &&
|
| - listEqual(parameterNames, other.parameterNames,
|
| - (String a, String b) => a == b) &&
|
| - listEqual(parameterTypes, other.parameterTypes,
|
| - (String a, String b) => a == b) &&
|
| - requiredParameterCount == other.requiredParameterCount &&
|
| - hasNamedParameters == other.hasNamedParameters &&
|
| - parameterName == other.parameterName &&
|
| - parameterType == other.parameterType &&
|
| - importUri == other.importUri;
|
| + if (other is ContextData) {
|
| + return name == other.name &&
|
| + explicitFileCount == other.explicitFileCount &&
|
| + implicitFileCount == other.implicitFileCount &&
|
| + workItemQueueLength == other.workItemQueueLength &&
|
| + listEqual(cacheEntryExceptions, other.cacheEntryExceptions,
|
| + (String a, String b) => a == b);
|
| }
|
| return false;
|
| }
|
| @@ -5684,347 +4612,17 @@ class CompletionSuggestion implements HasToJson {
|
| @override
|
| 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, defaultArgumentListString.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, defaultArgumentListTextRanges.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, element.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, hasNamedParameters.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, parameterName.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, parameterType.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, importUri.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, name.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, explicitFileCount.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, implicitFileCount.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, workItemQueueLength.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, cacheEntryExceptions.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * CompletionSuggestionKind
|
| - *
|
| - * enum {
|
| - * ARGUMENT_LIST
|
| - * IMPORT
|
| - * IDENTIFIER
|
| - * INVOCATION
|
| - * KEYWORD
|
| - * NAMED_ARGUMENT
|
| - * OPTIONAL_ARGUMENT
|
| - * PARAMETER
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class CompletionSuggestionKind implements Enum {
|
| - /**
|
| - * A list of arguments for the method or function that is being invoked. For
|
| - * this suggestion kind, the completion field is a textual representation of
|
| - * the invocation and the parameterNames, parameterTypes, and
|
| - * requiredParameterCount attributes are defined.
|
| - */
|
| - static const CompletionSuggestionKind ARGUMENT_LIST =
|
| - const CompletionSuggestionKind._("ARGUMENT_LIST");
|
| -
|
| - static const CompletionSuggestionKind IMPORT =
|
| - const CompletionSuggestionKind._("IMPORT");
|
| -
|
| - /**
|
| - * The element identifier should be inserted at the completion location. For
|
| - * example "someMethod" in import 'myLib.dart' show someMethod; . For
|
| - * suggestions of this kind, the element attribute is defined and the
|
| - * completion field is the element's identifier.
|
| - */
|
| - static const CompletionSuggestionKind IDENTIFIER =
|
| - const CompletionSuggestionKind._("IDENTIFIER");
|
| -
|
| - /**
|
| - * The element is being invoked at the completion location. For example,
|
| - * "someMethod" in x.someMethod(); . For suggestions of this kind, the
|
| - * element attribute is defined and the completion field is the element's
|
| - * identifier.
|
| - */
|
| - static const CompletionSuggestionKind INVOCATION =
|
| - const CompletionSuggestionKind._("INVOCATION");
|
| -
|
| - /**
|
| - * A keyword is being suggested. For suggestions of this kind, the completion
|
| - * is the keyword.
|
| - */
|
| - static const CompletionSuggestionKind KEYWORD =
|
| - const CompletionSuggestionKind._("KEYWORD");
|
| -
|
| - /**
|
| - * A named argument for the current callsite is being suggested. For
|
| - * suggestions of this kind, the completion is the named argument identifier
|
| - * including a trailing ':' and space.
|
| - */
|
| - static const CompletionSuggestionKind NAMED_ARGUMENT =
|
| - const CompletionSuggestionKind._("NAMED_ARGUMENT");
|
| -
|
| - static const CompletionSuggestionKind OPTIONAL_ARGUMENT =
|
| - const CompletionSuggestionKind._("OPTIONAL_ARGUMENT");
|
| -
|
| - static const CompletionSuggestionKind PARAMETER =
|
| - const CompletionSuggestionKind._("PARAMETER");
|
| -
|
| - /**
|
| - * A list containing all of the enum values that are defined.
|
| - */
|
| - static const List<CompletionSuggestionKind> VALUES =
|
| - const <CompletionSuggestionKind>[
|
| - ARGUMENT_LIST,
|
| - IMPORT,
|
| - IDENTIFIER,
|
| - INVOCATION,
|
| - KEYWORD,
|
| - NAMED_ARGUMENT,
|
| - OPTIONAL_ARGUMENT,
|
| - PARAMETER
|
| - ];
|
| -
|
| - @override
|
| - final String name;
|
| -
|
| - const CompletionSuggestionKind._(this.name);
|
| -
|
| - factory CompletionSuggestionKind(String name) {
|
| - switch (name) {
|
| - case "ARGUMENT_LIST":
|
| - return ARGUMENT_LIST;
|
| - case "IMPORT":
|
| - return IMPORT;
|
| - case "IDENTIFIER":
|
| - return IDENTIFIER;
|
| - case "INVOCATION":
|
| - return INVOCATION;
|
| - case "KEYWORD":
|
| - return KEYWORD;
|
| - case "NAMED_ARGUMENT":
|
| - return NAMED_ARGUMENT;
|
| - case "OPTIONAL_ARGUMENT":
|
| - return OPTIONAL_ARGUMENT;
|
| - case "PARAMETER":
|
| - return PARAMETER;
|
| - }
|
| - throw new Exception('Illegal enum value: $name');
|
| - }
|
| -
|
| - factory CompletionSuggestionKind.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json is String) {
|
| - try {
|
| - return new CompletionSuggestionKind(json);
|
| - } catch (_) {
|
| - // Fall through
|
| - }
|
| - }
|
| - throw jsonDecoder.mismatch(jsonPath, "CompletionSuggestionKind", json);
|
| - }
|
| -
|
| - @override
|
| - String toString() => "CompletionSuggestionKind.$name";
|
| -
|
| - String toJson() => name;
|
| -}
|
| -
|
| -/**
|
| - * ContextData
|
| - *
|
| - * {
|
| - * "name": String
|
| - * "explicitFileCount": int
|
| - * "implicitFileCount": int
|
| - * "workItemQueueLength": int
|
| - * "cacheEntryExceptions": List<String>
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class ContextData implements HasToJson {
|
| - String _name;
|
| -
|
| - int _explicitFileCount;
|
| -
|
| - int _implicitFileCount;
|
| -
|
| - int _workItemQueueLength;
|
| -
|
| - List<String> _cacheEntryExceptions;
|
| -
|
| - /**
|
| - * The name of the context.
|
| - */
|
| - String get name => _name;
|
| -
|
| - /**
|
| - * The name of the context.
|
| - */
|
| - void set name(String value) {
|
| - assert(value != null);
|
| - this._name = value;
|
| - }
|
| -
|
| - /**
|
| - * Explicitly analyzed files.
|
| - */
|
| - int get explicitFileCount => _explicitFileCount;
|
| -
|
| - /**
|
| - * Explicitly analyzed files.
|
| - */
|
| - void set explicitFileCount(int value) {
|
| - assert(value != null);
|
| - this._explicitFileCount = value;
|
| - }
|
| -
|
| - /**
|
| - * Implicitly analyzed files.
|
| - */
|
| - int get implicitFileCount => _implicitFileCount;
|
| -
|
| - /**
|
| - * Implicitly analyzed files.
|
| - */
|
| - void set implicitFileCount(int value) {
|
| - assert(value != null);
|
| - this._implicitFileCount = value;
|
| - }
|
| -
|
| - /**
|
| - * The number of work items in the queue.
|
| - */
|
| - int get workItemQueueLength => _workItemQueueLength;
|
| -
|
| - /**
|
| - * The number of work items in the queue.
|
| - */
|
| - void set workItemQueueLength(int value) {
|
| - assert(value != null);
|
| - this._workItemQueueLength = value;
|
| - }
|
| -
|
| - /**
|
| - * Exceptions associated with cache entries.
|
| - */
|
| - List<String> get cacheEntryExceptions => _cacheEntryExceptions;
|
| -
|
| - /**
|
| - * Exceptions associated with cache entries.
|
| - */
|
| - void set cacheEntryExceptions(List<String> value) {
|
| - assert(value != null);
|
| - this._cacheEntryExceptions = value;
|
| - }
|
| -
|
| - ContextData(String name, int explicitFileCount, int implicitFileCount,
|
| - int workItemQueueLength, List<String> cacheEntryExceptions) {
|
| - this.name = name;
|
| - this.explicitFileCount = explicitFileCount;
|
| - this.implicitFileCount = implicitFileCount;
|
| - this.workItemQueueLength = workItemQueueLength;
|
| - this.cacheEntryExceptions = cacheEntryExceptions;
|
| - }
|
| -
|
| - factory ContextData.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - String name;
|
| - if (json.containsKey("name")) {
|
| - name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "name");
|
| - }
|
| - int explicitFileCount;
|
| - if (json.containsKey("explicitFileCount")) {
|
| - explicitFileCount = jsonDecoder.decodeInt(
|
| - jsonPath + ".explicitFileCount", json["explicitFileCount"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "explicitFileCount");
|
| - }
|
| - int implicitFileCount;
|
| - if (json.containsKey("implicitFileCount")) {
|
| - implicitFileCount = jsonDecoder.decodeInt(
|
| - jsonPath + ".implicitFileCount", json["implicitFileCount"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "implicitFileCount");
|
| - }
|
| - int workItemQueueLength;
|
| - if (json.containsKey("workItemQueueLength")) {
|
| - workItemQueueLength = jsonDecoder.decodeInt(
|
| - jsonPath + ".workItemQueueLength", json["workItemQueueLength"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "workItemQueueLength");
|
| - }
|
| - List<String> cacheEntryExceptions;
|
| - if (json.containsKey("cacheEntryExceptions")) {
|
| - cacheEntryExceptions = jsonDecoder.decodeList(
|
| - jsonPath + ".cacheEntryExceptions",
|
| - json["cacheEntryExceptions"],
|
| - jsonDecoder.decodeString);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "cacheEntryExceptions");
|
| - }
|
| - return new ContextData(name, explicitFileCount, implicitFileCount,
|
| - workItemQueueLength, cacheEntryExceptions);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "ContextData", json);
|
| - }
|
| - }
|
| -
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - result["name"] = name;
|
| - result["explicitFileCount"] = explicitFileCount;
|
| - result["implicitFileCount"] = implicitFileCount;
|
| - result["workItemQueueLength"] = workItemQueueLength;
|
| - result["cacheEntryExceptions"] = cacheEntryExceptions;
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is ContextData) {
|
| - return name == other.name &&
|
| - explicitFileCount == other.explicitFileCount &&
|
| - implicitFileCount == other.implicitFileCount &&
|
| - workItemQueueLength == other.workItemQueueLength &&
|
| - listEqual(cacheEntryExceptions, other.cacheEntryExceptions,
|
| - (String a, String b) => a == b);
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, name.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, explicitFileCount.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, implicitFileCount.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, workItemQueueLength.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, cacheEntryExceptions.hashCode);
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * convertGetterToMethod feedback
|
| + * convertGetterToMethod feedback
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| @@ -7798,2687 +6396,120 @@ class EditGetRefactoringResult implements ResponseResult {
|
| feedback == other.feedback &&
|
| change == other.change &&
|
| listEqual(potentialEdits, other.potentialEdits,
|
| - (String a, String b) => a == b);
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, initialProblems.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, optionsProblems.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, finalProblems.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, feedback.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, change.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, potentialEdits.hashCode);
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * edit.getStatementCompletion params
|
| - *
|
| - * {
|
| - * "file": FilePath
|
| - * "offset": int
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class EditGetStatementCompletionParams implements RequestParams {
|
| - String _file;
|
| -
|
| - int _offset;
|
| -
|
| - /**
|
| - * The file containing the statement to be completed.
|
| - */
|
| - String get file => _file;
|
| -
|
| - /**
|
| - * The file containing the statement to be completed.
|
| - */
|
| - void set file(String value) {
|
| - assert(value != null);
|
| - this._file = value;
|
| - }
|
| -
|
| - /**
|
| - * The offset used to identify the statement to be completed.
|
| - */
|
| - int get offset => _offset;
|
| -
|
| - /**
|
| - * The offset used to identify the statement to be completed.
|
| - */
|
| - void set offset(int value) {
|
| - assert(value != null);
|
| - this._offset = value;
|
| - }
|
| -
|
| - EditGetStatementCompletionParams(String file, int offset) {
|
| - this.file = file;
|
| - this.offset = offset;
|
| - }
|
| -
|
| - factory EditGetStatementCompletionParams.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - String file;
|
| - if (json.containsKey("file")) {
|
| - file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "file");
|
| - }
|
| - int offset;
|
| - if (json.containsKey("offset")) {
|
| - offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "offset");
|
| - }
|
| - return new EditGetStatementCompletionParams(file, offset);
|
| - } else {
|
| - throw jsonDecoder.mismatch(
|
| - jsonPath, "edit.getStatementCompletion params", json);
|
| - }
|
| - }
|
| -
|
| - factory EditGetStatementCompletionParams.fromRequest(Request request) {
|
| - return new EditGetStatementCompletionParams.fromJson(
|
| - new RequestDecoder(request), "params", request.params);
|
| - }
|
| -
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - result["file"] = file;
|
| - result["offset"] = offset;
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| - Request toRequest(String id) {
|
| - return new Request(id, "edit.getStatementCompletion", toJson());
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is EditGetStatementCompletionParams) {
|
| - return file == other.file && offset == other.offset;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, file.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, offset.hashCode);
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * edit.getStatementCompletion result
|
| - *
|
| - * {
|
| - * "change": SourceChange
|
| - * "whitespaceOnly": bool
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class EditGetStatementCompletionResult implements ResponseResult {
|
| - SourceChange _change;
|
| -
|
| - bool _whitespaceOnly;
|
| -
|
| - /**
|
| - * The change to be applied in order to complete the statement.
|
| - */
|
| - SourceChange get change => _change;
|
| -
|
| - /**
|
| - * The change to be applied in order to complete the statement.
|
| - */
|
| - void set change(SourceChange value) {
|
| - assert(value != null);
|
| - this._change = value;
|
| - }
|
| -
|
| - /**
|
| - * Will be true if the change contains nothing but whitespace characters, or
|
| - * is empty.
|
| - */
|
| - bool get whitespaceOnly => _whitespaceOnly;
|
| -
|
| - /**
|
| - * Will be true if the change contains nothing but whitespace characters, or
|
| - * is empty.
|
| - */
|
| - void set whitespaceOnly(bool value) {
|
| - assert(value != null);
|
| - this._whitespaceOnly = value;
|
| - }
|
| -
|
| - EditGetStatementCompletionResult(SourceChange change, bool whitespaceOnly) {
|
| - this.change = change;
|
| - this.whitespaceOnly = whitespaceOnly;
|
| - }
|
| -
|
| - factory EditGetStatementCompletionResult.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - SourceChange change;
|
| - if (json.containsKey("change")) {
|
| - change = new SourceChange.fromJson(
|
| - jsonDecoder, jsonPath + ".change", json["change"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "change");
|
| - }
|
| - bool whitespaceOnly;
|
| - if (json.containsKey("whitespaceOnly")) {
|
| - whitespaceOnly = jsonDecoder.decodeBool(
|
| - jsonPath + ".whitespaceOnly", json["whitespaceOnly"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "whitespaceOnly");
|
| - }
|
| - return new EditGetStatementCompletionResult(change, whitespaceOnly);
|
| - } else {
|
| - throw jsonDecoder.mismatch(
|
| - jsonPath, "edit.getStatementCompletion result", json);
|
| - }
|
| - }
|
| -
|
| - factory EditGetStatementCompletionResult.fromResponse(Response response) {
|
| - return new EditGetStatementCompletionResult.fromJson(
|
| - new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)),
|
| - "result",
|
| - response.result);
|
| - }
|
| -
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - result["change"] = change.toJson();
|
| - result["whitespaceOnly"] = whitespaceOnly;
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| - Response toResponse(String id) {
|
| - return new Response(id, result: toJson());
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is EditGetStatementCompletionResult) {
|
| - return change == other.change && whitespaceOnly == other.whitespaceOnly;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, change.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, whitespaceOnly.hashCode);
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * edit.organizeDirectives params
|
| - *
|
| - * {
|
| - * "file": FilePath
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class EditOrganizeDirectivesParams implements RequestParams {
|
| - String _file;
|
| -
|
| - /**
|
| - * The Dart file to organize directives in.
|
| - */
|
| - String get file => _file;
|
| -
|
| - /**
|
| - * The Dart file to organize directives in.
|
| - */
|
| - void set file(String value) {
|
| - assert(value != null);
|
| - this._file = value;
|
| - }
|
| -
|
| - EditOrganizeDirectivesParams(String file) {
|
| - this.file = file;
|
| - }
|
| -
|
| - factory EditOrganizeDirectivesParams.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - String file;
|
| - if (json.containsKey("file")) {
|
| - file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "file");
|
| - }
|
| - return new EditOrganizeDirectivesParams(file);
|
| - } else {
|
| - throw jsonDecoder.mismatch(
|
| - jsonPath, "edit.organizeDirectives params", json);
|
| - }
|
| - }
|
| -
|
| - factory EditOrganizeDirectivesParams.fromRequest(Request request) {
|
| - return new EditOrganizeDirectivesParams.fromJson(
|
| - new RequestDecoder(request), "params", request.params);
|
| - }
|
| -
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - result["file"] = file;
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| - Request toRequest(String id) {
|
| - return new Request(id, "edit.organizeDirectives", toJson());
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is EditOrganizeDirectivesParams) {
|
| - return file == other.file;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, file.hashCode);
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * edit.organizeDirectives result
|
| - *
|
| - * {
|
| - * "edit": SourceFileEdit
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class EditOrganizeDirectivesResult implements ResponseResult {
|
| - SourceFileEdit _edit;
|
| -
|
| - /**
|
| - * The file edit that is to be applied to the given file to effect the
|
| - * organizing.
|
| - */
|
| - SourceFileEdit get edit => _edit;
|
| -
|
| - /**
|
| - * The file edit that is to be applied to the given file to effect the
|
| - * organizing.
|
| - */
|
| - void set edit(SourceFileEdit value) {
|
| - assert(value != null);
|
| - this._edit = value;
|
| - }
|
| -
|
| - EditOrganizeDirectivesResult(SourceFileEdit edit) {
|
| - this.edit = edit;
|
| - }
|
| -
|
| - factory EditOrganizeDirectivesResult.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - SourceFileEdit edit;
|
| - if (json.containsKey("edit")) {
|
| - edit = new SourceFileEdit.fromJson(
|
| - jsonDecoder, jsonPath + ".edit", json["edit"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "edit");
|
| - }
|
| - return new EditOrganizeDirectivesResult(edit);
|
| - } else {
|
| - throw jsonDecoder.mismatch(
|
| - jsonPath, "edit.organizeDirectives result", json);
|
| - }
|
| - }
|
| -
|
| - factory EditOrganizeDirectivesResult.fromResponse(Response response) {
|
| - return new EditOrganizeDirectivesResult.fromJson(
|
| - new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)),
|
| - "result",
|
| - response.result);
|
| - }
|
| -
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - result["edit"] = edit.toJson();
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| - Response toResponse(String id) {
|
| - return new Response(id, result: toJson());
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is EditOrganizeDirectivesResult) {
|
| - return edit == other.edit;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, edit.hashCode);
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * edit.sortMembers params
|
| - *
|
| - * {
|
| - * "file": FilePath
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class EditSortMembersParams implements RequestParams {
|
| - String _file;
|
| -
|
| - /**
|
| - * The Dart file to sort.
|
| - */
|
| - String get file => _file;
|
| -
|
| - /**
|
| - * The Dart file to sort.
|
| - */
|
| - void set file(String value) {
|
| - assert(value != null);
|
| - this._file = value;
|
| - }
|
| -
|
| - EditSortMembersParams(String file) {
|
| - this.file = file;
|
| - }
|
| -
|
| - factory EditSortMembersParams.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - String file;
|
| - if (json.containsKey("file")) {
|
| - file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "file");
|
| - }
|
| - return new EditSortMembersParams(file);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "edit.sortMembers params", json);
|
| - }
|
| - }
|
| -
|
| - factory EditSortMembersParams.fromRequest(Request request) {
|
| - return new EditSortMembersParams.fromJson(
|
| - new RequestDecoder(request), "params", request.params);
|
| - }
|
| -
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - result["file"] = file;
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| - Request toRequest(String id) {
|
| - return new Request(id, "edit.sortMembers", toJson());
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is EditSortMembersParams) {
|
| - return file == other.file;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, file.hashCode);
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * edit.sortMembers result
|
| - *
|
| - * {
|
| - * "edit": SourceFileEdit
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class EditSortMembersResult implements ResponseResult {
|
| - SourceFileEdit _edit;
|
| -
|
| - /**
|
| - * The file edit that is to be applied to the given file to effect the
|
| - * sorting.
|
| - */
|
| - SourceFileEdit get edit => _edit;
|
| -
|
| - /**
|
| - * The file edit that is to be applied to the given file to effect the
|
| - * sorting.
|
| - */
|
| - void set edit(SourceFileEdit value) {
|
| - assert(value != null);
|
| - this._edit = value;
|
| - }
|
| -
|
| - EditSortMembersResult(SourceFileEdit edit) {
|
| - this.edit = edit;
|
| - }
|
| -
|
| - factory EditSortMembersResult.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - SourceFileEdit edit;
|
| - if (json.containsKey("edit")) {
|
| - edit = new SourceFileEdit.fromJson(
|
| - jsonDecoder, jsonPath + ".edit", json["edit"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "edit");
|
| - }
|
| - return new EditSortMembersResult(edit);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "edit.sortMembers result", json);
|
| - }
|
| - }
|
| -
|
| - factory EditSortMembersResult.fromResponse(Response response) {
|
| - return new EditSortMembersResult.fromJson(
|
| - new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)),
|
| - "result",
|
| - response.result);
|
| - }
|
| -
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - result["edit"] = edit.toJson();
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| - Response toResponse(String id) {
|
| - return new Response(id, result: toJson());
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is EditSortMembersResult) {
|
| - return edit == other.edit;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, edit.hashCode);
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * Element
|
| - *
|
| - * {
|
| - * "kind": ElementKind
|
| - * "name": String
|
| - * "location": optional Location
|
| - * "flags": int
|
| - * "parameters": optional String
|
| - * "returnType": optional String
|
| - * "typeParameters": optional String
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class Element implements HasToJson {
|
| - static const int FLAG_ABSTRACT = 0x01;
|
| - static const int FLAG_CONST = 0x02;
|
| - static const int FLAG_FINAL = 0x04;
|
| - static const int FLAG_STATIC = 0x08;
|
| - static const int FLAG_PRIVATE = 0x10;
|
| - static const int FLAG_DEPRECATED = 0x20;
|
| -
|
| - static int makeFlags(
|
| - {isAbstract: false,
|
| - isConst: false,
|
| - isFinal: false,
|
| - isStatic: false,
|
| - isPrivate: false,
|
| - isDeprecated: false}) {
|
| - int flags = 0;
|
| - if (isAbstract) flags |= FLAG_ABSTRACT;
|
| - if (isConst) flags |= FLAG_CONST;
|
| - if (isFinal) flags |= FLAG_FINAL;
|
| - if (isStatic) flags |= FLAG_STATIC;
|
| - if (isPrivate) flags |= FLAG_PRIVATE;
|
| - if (isDeprecated) flags |= FLAG_DEPRECATED;
|
| - return flags;
|
| - }
|
| -
|
| - ElementKind _kind;
|
| -
|
| - String _name;
|
| -
|
| - Location _location;
|
| -
|
| - int _flags;
|
| -
|
| - String _parameters;
|
| -
|
| - String _returnType;
|
| -
|
| - String _typeParameters;
|
| -
|
| - /**
|
| - * The kind of the element.
|
| - */
|
| - ElementKind get kind => _kind;
|
| -
|
| - /**
|
| - * The kind of the element.
|
| - */
|
| - void set kind(ElementKind value) {
|
| - assert(value != null);
|
| - this._kind = value;
|
| - }
|
| -
|
| - /**
|
| - * The name of the element. This is typically used as the label in the
|
| - * outline.
|
| - */
|
| - String get name => _name;
|
| -
|
| - /**
|
| - * The name of the element. This is typically used as the label in the
|
| - * outline.
|
| - */
|
| - void set name(String value) {
|
| - assert(value != null);
|
| - this._name = value;
|
| - }
|
| -
|
| - /**
|
| - * The location of the name in the declaration of the element.
|
| - */
|
| - Location get location => _location;
|
| -
|
| - /**
|
| - * The location of the name in the declaration of the element.
|
| - */
|
| - void set location(Location value) {
|
| - this._location = value;
|
| - }
|
| -
|
| - /**
|
| - * 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
|
| - */
|
| - int get flags => _flags;
|
| -
|
| - /**
|
| - * 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
|
| - */
|
| - void set flags(int value) {
|
| - assert(value != null);
|
| - this._flags = value;
|
| - }
|
| -
|
| - /**
|
| - * The parameter list for the element. If the element is not a method or
|
| - * function this field will not be defined. If the element doesn't have
|
| - * parameters (e.g. getter), this field will not be defined. If the element
|
| - * has zero parameters, this field will have a value of "()".
|
| - */
|
| - String get parameters => _parameters;
|
| -
|
| - /**
|
| - * The parameter list for the element. If the element is not a method or
|
| - * function this field will not be defined. If the element doesn't have
|
| - * parameters (e.g. getter), this field will not be defined. If the element
|
| - * has zero parameters, this field will have a value of "()".
|
| - */
|
| - void set parameters(String value) {
|
| - this._parameters = value;
|
| - }
|
| -
|
| - /**
|
| - * 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.
|
| - */
|
| - String get returnType => _returnType;
|
| -
|
| - /**
|
| - * 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.
|
| - */
|
| - void set returnType(String value) {
|
| - this._returnType = value;
|
| - }
|
| -
|
| - /**
|
| - * The type parameter list for the element. If the element doesn't have type
|
| - * parameters, this field will not be defined.
|
| - */
|
| - String get typeParameters => _typeParameters;
|
| -
|
| - /**
|
| - * The type parameter list for the element. If the element doesn't have type
|
| - * parameters, this field will not be defined.
|
| - */
|
| - void set typeParameters(String value) {
|
| - this._typeParameters = value;
|
| - }
|
| -
|
| - Element(ElementKind kind, String name, int flags,
|
| - {Location location,
|
| - String parameters,
|
| - String returnType,
|
| - String typeParameters}) {
|
| - this.kind = kind;
|
| - this.name = name;
|
| - this.location = location;
|
| - this.flags = flags;
|
| - this.parameters = parameters;
|
| - this.returnType = returnType;
|
| - this.typeParameters = typeParameters;
|
| - }
|
| -
|
| - factory Element.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - ElementKind kind;
|
| - if (json.containsKey("kind")) {
|
| - kind = new ElementKind.fromJson(
|
| - jsonDecoder, jsonPath + ".kind", json["kind"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "kind");
|
| - }
|
| - String name;
|
| - if (json.containsKey("name")) {
|
| - name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "name");
|
| - }
|
| - Location location;
|
| - if (json.containsKey("location")) {
|
| - location = new Location.fromJson(
|
| - jsonDecoder, jsonPath + ".location", json["location"]);
|
| - }
|
| - int flags;
|
| - if (json.containsKey("flags")) {
|
| - flags = jsonDecoder.decodeInt(jsonPath + ".flags", json["flags"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "flags");
|
| - }
|
| - String parameters;
|
| - if (json.containsKey("parameters")) {
|
| - parameters = jsonDecoder.decodeString(
|
| - jsonPath + ".parameters", json["parameters"]);
|
| - }
|
| - String returnType;
|
| - if (json.containsKey("returnType")) {
|
| - returnType = jsonDecoder.decodeString(
|
| - jsonPath + ".returnType", json["returnType"]);
|
| - }
|
| - String typeParameters;
|
| - if (json.containsKey("typeParameters")) {
|
| - typeParameters = jsonDecoder.decodeString(
|
| - jsonPath + ".typeParameters", json["typeParameters"]);
|
| - }
|
| - return new Element(kind, name, flags,
|
| - location: location,
|
| - parameters: parameters,
|
| - returnType: returnType,
|
| - typeParameters: typeParameters);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "Element", json);
|
| - }
|
| - }
|
| -
|
| - bool get isAbstract => (flags & FLAG_ABSTRACT) != 0;
|
| - bool get isConst => (flags & FLAG_CONST) != 0;
|
| - bool get isFinal => (flags & FLAG_FINAL) != 0;
|
| - bool get isStatic => (flags & FLAG_STATIC) != 0;
|
| - bool get isPrivate => (flags & FLAG_PRIVATE) != 0;
|
| - bool get isDeprecated => (flags & FLAG_DEPRECATED) != 0;
|
| -
|
| - @override
|
| - 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;
|
| - }
|
| - if (typeParameters != null) {
|
| - result["typeParameters"] = typeParameters;
|
| - }
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - 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 &&
|
| - typeParameters == other.typeParameters;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - 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);
|
| - hash = JenkinsSmiHash.combine(hash, typeParameters.hashCode);
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * ElementKind
|
| - *
|
| - * enum {
|
| - * CLASS
|
| - * CLASS_TYPE_ALIAS
|
| - * COMPILATION_UNIT
|
| - * CONSTRUCTOR
|
| - * ENUM
|
| - * ENUM_CONSTANT
|
| - * FIELD
|
| - * FILE
|
| - * FUNCTION
|
| - * FUNCTION_TYPE_ALIAS
|
| - * GETTER
|
| - * LABEL
|
| - * LIBRARY
|
| - * LOCAL_VARIABLE
|
| - * METHOD
|
| - * PARAMETER
|
| - * PREFIX
|
| - * SETTER
|
| - * TOP_LEVEL_VARIABLE
|
| - * TYPE_PARAMETER
|
| - * UNIT_TEST_GROUP
|
| - * UNIT_TEST_TEST
|
| - * UNKNOWN
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class ElementKind implements Enum {
|
| - static const ElementKind CLASS = const ElementKind._("CLASS");
|
| -
|
| - static const ElementKind CLASS_TYPE_ALIAS =
|
| - const ElementKind._("CLASS_TYPE_ALIAS");
|
| -
|
| - static const ElementKind COMPILATION_UNIT =
|
| - const ElementKind._("COMPILATION_UNIT");
|
| -
|
| - static const ElementKind CONSTRUCTOR = const ElementKind._("CONSTRUCTOR");
|
| -
|
| - static const ElementKind ENUM = const ElementKind._("ENUM");
|
| -
|
| - static const ElementKind ENUM_CONSTANT = const ElementKind._("ENUM_CONSTANT");
|
| -
|
| - static const ElementKind FIELD = const ElementKind._("FIELD");
|
| -
|
| - static const ElementKind FILE = const ElementKind._("FILE");
|
| -
|
| - static const ElementKind FUNCTION = const ElementKind._("FUNCTION");
|
| -
|
| - static const ElementKind FUNCTION_TYPE_ALIAS =
|
| - const ElementKind._("FUNCTION_TYPE_ALIAS");
|
| -
|
| - static const ElementKind GETTER = const ElementKind._("GETTER");
|
| -
|
| - static const ElementKind LABEL = const ElementKind._("LABEL");
|
| -
|
| - static const ElementKind LIBRARY = const ElementKind._("LIBRARY");
|
| -
|
| - static const ElementKind LOCAL_VARIABLE =
|
| - const ElementKind._("LOCAL_VARIABLE");
|
| -
|
| - static const ElementKind METHOD = const ElementKind._("METHOD");
|
| -
|
| - static const ElementKind PARAMETER = const ElementKind._("PARAMETER");
|
| -
|
| - static const ElementKind PREFIX = const ElementKind._("PREFIX");
|
| -
|
| - static const ElementKind SETTER = const ElementKind._("SETTER");
|
| -
|
| - static const ElementKind TOP_LEVEL_VARIABLE =
|
| - const ElementKind._("TOP_LEVEL_VARIABLE");
|
| -
|
| - static const ElementKind TYPE_PARAMETER =
|
| - const ElementKind._("TYPE_PARAMETER");
|
| -
|
| - /**
|
| - * Deprecated: support for tests was removed.
|
| - */
|
| - static const ElementKind UNIT_TEST_GROUP =
|
| - const ElementKind._("UNIT_TEST_GROUP");
|
| -
|
| - /**
|
| - * Deprecated: support for tests was removed.
|
| - */
|
| - static const ElementKind UNIT_TEST_TEST =
|
| - const ElementKind._("UNIT_TEST_TEST");
|
| -
|
| - static const ElementKind UNKNOWN = const ElementKind._("UNKNOWN");
|
| -
|
| - /**
|
| - * A list containing all of the enum values that are defined.
|
| - */
|
| - static const List<ElementKind> VALUES = const <ElementKind>[
|
| - CLASS,
|
| - CLASS_TYPE_ALIAS,
|
| - COMPILATION_UNIT,
|
| - CONSTRUCTOR,
|
| - ENUM,
|
| - ENUM_CONSTANT,
|
| - FIELD,
|
| - FILE,
|
| - FUNCTION,
|
| - FUNCTION_TYPE_ALIAS,
|
| - GETTER,
|
| - LABEL,
|
| - LIBRARY,
|
| - LOCAL_VARIABLE,
|
| - METHOD,
|
| - PARAMETER,
|
| - PREFIX,
|
| - SETTER,
|
| - TOP_LEVEL_VARIABLE,
|
| - TYPE_PARAMETER,
|
| - UNIT_TEST_GROUP,
|
| - UNIT_TEST_TEST,
|
| - UNKNOWN
|
| - ];
|
| -
|
| - @override
|
| - 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 "ENUM":
|
| - return ENUM;
|
| - case "ENUM_CONSTANT":
|
| - return ENUM_CONSTANT;
|
| - case "FIELD":
|
| - return FIELD;
|
| - case "FILE":
|
| - return FILE;
|
| - case "FUNCTION":
|
| - return FUNCTION;
|
| - case "FUNCTION_TYPE_ALIAS":
|
| - return FUNCTION_TYPE_ALIAS;
|
| - case "GETTER":
|
| - return GETTER;
|
| - case "LABEL":
|
| - return LABEL;
|
| - case "LIBRARY":
|
| - return LIBRARY;
|
| - case "LOCAL_VARIABLE":
|
| - return LOCAL_VARIABLE;
|
| - case "METHOD":
|
| - return METHOD;
|
| - case "PARAMETER":
|
| - return PARAMETER;
|
| - case "PREFIX":
|
| - return PREFIX;
|
| - 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');
|
| - }
|
| -
|
| - factory ElementKind.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json is String) {
|
| - try {
|
| - return new ElementKind(json);
|
| - } catch (_) {
|
| - // Fall through
|
| - }
|
| - }
|
| - throw jsonDecoder.mismatch(jsonPath, "ElementKind", json);
|
| - }
|
| -
|
| - @override
|
| - String toString() => "ElementKind.$name";
|
| -
|
| - String toJson() => name;
|
| -}
|
| -
|
| -/**
|
| - * ExecutableFile
|
| - *
|
| - * {
|
| - * "file": FilePath
|
| - * "kind": ExecutableKind
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class ExecutableFile implements HasToJson {
|
| - String _file;
|
| -
|
| - ExecutableKind _kind;
|
| -
|
| - /**
|
| - * The path of the executable file.
|
| - */
|
| - String get file => _file;
|
| -
|
| - /**
|
| - * The path of the executable file.
|
| - */
|
| - void set file(String value) {
|
| - assert(value != null);
|
| - this._file = value;
|
| - }
|
| -
|
| - /**
|
| - * The kind of the executable file.
|
| - */
|
| - ExecutableKind get kind => _kind;
|
| -
|
| - /**
|
| - * The kind of the executable file.
|
| - */
|
| - void set kind(ExecutableKind value) {
|
| - assert(value != null);
|
| - this._kind = value;
|
| - }
|
| -
|
| - ExecutableFile(String file, ExecutableKind kind) {
|
| - this.file = file;
|
| - this.kind = kind;
|
| - }
|
| -
|
| - factory ExecutableFile.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - String file;
|
| - if (json.containsKey("file")) {
|
| - file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "file");
|
| - }
|
| - ExecutableKind kind;
|
| - if (json.containsKey("kind")) {
|
| - kind = new ExecutableKind.fromJson(
|
| - jsonDecoder, jsonPath + ".kind", json["kind"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "kind");
|
| - }
|
| - return new ExecutableFile(file, kind);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "ExecutableFile", json);
|
| - }
|
| - }
|
| -
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - result["file"] = file;
|
| - result["kind"] = kind.toJson();
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is ExecutableFile) {
|
| - return file == other.file && kind == other.kind;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, file.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, kind.hashCode);
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * ExecutableKind
|
| - *
|
| - * enum {
|
| - * CLIENT
|
| - * EITHER
|
| - * NOT_EXECUTABLE
|
| - * SERVER
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class ExecutableKind implements Enum {
|
| - static const ExecutableKind CLIENT = const ExecutableKind._("CLIENT");
|
| -
|
| - static const ExecutableKind EITHER = const ExecutableKind._("EITHER");
|
| -
|
| - static const ExecutableKind NOT_EXECUTABLE =
|
| - const ExecutableKind._("NOT_EXECUTABLE");
|
| -
|
| - static const ExecutableKind SERVER = const ExecutableKind._("SERVER");
|
| -
|
| - /**
|
| - * A list containing all of the enum values that are defined.
|
| - */
|
| - static const List<ExecutableKind> VALUES = const <ExecutableKind>[
|
| - CLIENT,
|
| - EITHER,
|
| - NOT_EXECUTABLE,
|
| - SERVER
|
| - ];
|
| -
|
| - @override
|
| - final String name;
|
| -
|
| - const ExecutableKind._(this.name);
|
| -
|
| - factory ExecutableKind(String name) {
|
| - switch (name) {
|
| - case "CLIENT":
|
| - return CLIENT;
|
| - case "EITHER":
|
| - return EITHER;
|
| - case "NOT_EXECUTABLE":
|
| - return NOT_EXECUTABLE;
|
| - case "SERVER":
|
| - return SERVER;
|
| - }
|
| - throw new Exception('Illegal enum value: $name');
|
| - }
|
| -
|
| - factory ExecutableKind.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json is String) {
|
| - try {
|
| - return new ExecutableKind(json);
|
| - } catch (_) {
|
| - // Fall through
|
| - }
|
| - }
|
| - throw jsonDecoder.mismatch(jsonPath, "ExecutableKind", json);
|
| - }
|
| -
|
| - @override
|
| - String toString() => "ExecutableKind.$name";
|
| -
|
| - String toJson() => name;
|
| -}
|
| -
|
| -/**
|
| - * execution.createContext params
|
| - *
|
| - * {
|
| - * "contextRoot": FilePath
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class ExecutionCreateContextParams implements RequestParams {
|
| - String _contextRoot;
|
| -
|
| - /**
|
| - * The path of the Dart or HTML file that will be launched, or the path of
|
| - * the directory containing the file.
|
| - */
|
| - String get contextRoot => _contextRoot;
|
| -
|
| - /**
|
| - * The path of the Dart or HTML file that will be launched, or the path of
|
| - * the directory containing the file.
|
| - */
|
| - void set contextRoot(String value) {
|
| - assert(value != null);
|
| - this._contextRoot = value;
|
| - }
|
| -
|
| - ExecutionCreateContextParams(String contextRoot) {
|
| - this.contextRoot = contextRoot;
|
| - }
|
| -
|
| - factory ExecutionCreateContextParams.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - String contextRoot;
|
| - if (json.containsKey("contextRoot")) {
|
| - contextRoot = jsonDecoder.decodeString(
|
| - jsonPath + ".contextRoot", json["contextRoot"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "contextRoot");
|
| - }
|
| - return new ExecutionCreateContextParams(contextRoot);
|
| - } else {
|
| - throw jsonDecoder.mismatch(
|
| - jsonPath, "execution.createContext params", json);
|
| - }
|
| - }
|
| -
|
| - factory ExecutionCreateContextParams.fromRequest(Request request) {
|
| - return new ExecutionCreateContextParams.fromJson(
|
| - new RequestDecoder(request), "params", request.params);
|
| - }
|
| -
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - result["contextRoot"] = contextRoot;
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| - Request toRequest(String id) {
|
| - return new Request(id, "execution.createContext", toJson());
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is ExecutionCreateContextParams) {
|
| - return contextRoot == other.contextRoot;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, contextRoot.hashCode);
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * execution.createContext result
|
| - *
|
| - * {
|
| - * "id": ExecutionContextId
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class ExecutionCreateContextResult implements ResponseResult {
|
| - String _id;
|
| -
|
| - /**
|
| - * The identifier used to refer to the execution context that was created.
|
| - */
|
| - String get id => _id;
|
| -
|
| - /**
|
| - * The identifier used to refer to the execution context that was created.
|
| - */
|
| - void set id(String value) {
|
| - assert(value != null);
|
| - this._id = value;
|
| - }
|
| -
|
| - ExecutionCreateContextResult(String id) {
|
| - this.id = id;
|
| - }
|
| -
|
| - factory ExecutionCreateContextResult.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - String id;
|
| - if (json.containsKey("id")) {
|
| - id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "id");
|
| - }
|
| - return new ExecutionCreateContextResult(id);
|
| - } else {
|
| - throw jsonDecoder.mismatch(
|
| - jsonPath, "execution.createContext result", json);
|
| - }
|
| - }
|
| -
|
| - factory ExecutionCreateContextResult.fromResponse(Response response) {
|
| - return new ExecutionCreateContextResult.fromJson(
|
| - new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)),
|
| - "result",
|
| - response.result);
|
| - }
|
| -
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - result["id"] = id;
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| - Response toResponse(String id) {
|
| - return new Response(id, result: toJson());
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is ExecutionCreateContextResult) {
|
| - return id == other.id;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, id.hashCode);
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * execution.deleteContext params
|
| - *
|
| - * {
|
| - * "id": ExecutionContextId
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class ExecutionDeleteContextParams implements RequestParams {
|
| - String _id;
|
| -
|
| - /**
|
| - * The identifier of the execution context that is to be deleted.
|
| - */
|
| - String get id => _id;
|
| -
|
| - /**
|
| - * The identifier of the execution context that is to be deleted.
|
| - */
|
| - void set id(String value) {
|
| - assert(value != null);
|
| - this._id = value;
|
| - }
|
| -
|
| - ExecutionDeleteContextParams(String id) {
|
| - this.id = id;
|
| - }
|
| -
|
| - factory ExecutionDeleteContextParams.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - String id;
|
| - if (json.containsKey("id")) {
|
| - id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "id");
|
| - }
|
| - return new ExecutionDeleteContextParams(id);
|
| - } else {
|
| - throw jsonDecoder.mismatch(
|
| - jsonPath, "execution.deleteContext params", json);
|
| - }
|
| - }
|
| -
|
| - factory ExecutionDeleteContextParams.fromRequest(Request request) {
|
| - return new ExecutionDeleteContextParams.fromJson(
|
| - new RequestDecoder(request), "params", request.params);
|
| - }
|
| -
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - result["id"] = id;
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| - Request toRequest(String id) {
|
| - return new Request(id, "execution.deleteContext", toJson());
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is ExecutionDeleteContextParams) {
|
| - return id == other.id;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, id.hashCode);
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * execution.deleteContext result
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class ExecutionDeleteContextResult implements ResponseResult {
|
| - @override
|
| - Map<String, dynamic> toJson() => <String, dynamic>{};
|
| -
|
| - @override
|
| - Response toResponse(String id) {
|
| - return new Response(id, result: null);
|
| - }
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is ExecutionDeleteContextResult) {
|
| - return true;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - return 479954425;
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * execution.launchData params
|
| - *
|
| - * {
|
| - * "file": FilePath
|
| - * "kind": optional ExecutableKind
|
| - * "referencedFiles": optional List<FilePath>
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class ExecutionLaunchDataParams implements HasToJson {
|
| - String _file;
|
| -
|
| - ExecutableKind _kind;
|
| -
|
| - List<String> _referencedFiles;
|
| -
|
| - /**
|
| - * The file for which launch data is being provided. This will either be a
|
| - * Dart library or an HTML file.
|
| - */
|
| - String get file => _file;
|
| -
|
| - /**
|
| - * The file for which launch data is being provided. This will either be a
|
| - * Dart library or an HTML file.
|
| - */
|
| - void set file(String value) {
|
| - assert(value != null);
|
| - this._file = value;
|
| - }
|
| -
|
| - /**
|
| - * The kind of the executable file. This field is omitted if the file is not
|
| - * a Dart file.
|
| - */
|
| - ExecutableKind get kind => _kind;
|
| -
|
| - /**
|
| - * The kind of the executable file. This field is omitted if the file is not
|
| - * a Dart file.
|
| - */
|
| - void set kind(ExecutableKind value) {
|
| - this._kind = value;
|
| - }
|
| -
|
| - /**
|
| - * A list of the Dart files that are referenced by the file. This field is
|
| - * omitted if the file is not an HTML file.
|
| - */
|
| - List<String> get referencedFiles => _referencedFiles;
|
| -
|
| - /**
|
| - * A list of the Dart files that are referenced by the file. This field is
|
| - * omitted if the file is not an HTML file.
|
| - */
|
| - void set referencedFiles(List<String> value) {
|
| - this._referencedFiles = value;
|
| - }
|
| -
|
| - ExecutionLaunchDataParams(String file,
|
| - {ExecutableKind kind, List<String> referencedFiles}) {
|
| - this.file = file;
|
| - this.kind = kind;
|
| - this.referencedFiles = referencedFiles;
|
| - }
|
| -
|
| - factory ExecutionLaunchDataParams.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - String file;
|
| - if (json.containsKey("file")) {
|
| - file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "file");
|
| - }
|
| - ExecutableKind kind;
|
| - if (json.containsKey("kind")) {
|
| - kind = new ExecutableKind.fromJson(
|
| - jsonDecoder, jsonPath + ".kind", json["kind"]);
|
| - }
|
| - List<String> referencedFiles;
|
| - if (json.containsKey("referencedFiles")) {
|
| - referencedFiles = jsonDecoder.decodeList(jsonPath + ".referencedFiles",
|
| - json["referencedFiles"], jsonDecoder.decodeString);
|
| - }
|
| - return new ExecutionLaunchDataParams(file,
|
| - kind: kind, referencedFiles: referencedFiles);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "execution.launchData params", json);
|
| - }
|
| - }
|
| -
|
| - factory ExecutionLaunchDataParams.fromNotification(
|
| - Notification notification) {
|
| - return new ExecutionLaunchDataParams.fromJson(
|
| - new ResponseDecoder(null), "params", notification.params);
|
| - }
|
| -
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - result["file"] = file;
|
| - if (kind != null) {
|
| - result["kind"] = kind.toJson();
|
| - }
|
| - if (referencedFiles != null) {
|
| - result["referencedFiles"] = referencedFiles;
|
| - }
|
| - return result;
|
| - }
|
| -
|
| - Notification toNotification() {
|
| - return new Notification("execution.launchData", toJson());
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is ExecutionLaunchDataParams) {
|
| - return file == other.file &&
|
| - kind == other.kind &&
|
| - listEqual(referencedFiles, other.referencedFiles,
|
| - (String a, String b) => a == b);
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, file.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, kind.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, referencedFiles.hashCode);
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * execution.mapUri params
|
| - *
|
| - * {
|
| - * "id": ExecutionContextId
|
| - * "file": optional FilePath
|
| - * "uri": optional String
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class ExecutionMapUriParams implements RequestParams {
|
| - String _id;
|
| -
|
| - String _file;
|
| -
|
| - String _uri;
|
| -
|
| - /**
|
| - * The identifier of the execution context in which the URI is to be mapped.
|
| - */
|
| - String get id => _id;
|
| -
|
| - /**
|
| - * The identifier of the execution context in which the URI is to be mapped.
|
| - */
|
| - void set id(String value) {
|
| - assert(value != null);
|
| - this._id = value;
|
| - }
|
| -
|
| - /**
|
| - * The path of the file to be mapped into a URI.
|
| - */
|
| - String get file => _file;
|
| -
|
| - /**
|
| - * The path of the file to be mapped into a URI.
|
| - */
|
| - void set file(String value) {
|
| - this._file = value;
|
| - }
|
| -
|
| - /**
|
| - * The URI to be mapped into a file path.
|
| - */
|
| - String get uri => _uri;
|
| -
|
| - /**
|
| - * The URI to be mapped into a file path.
|
| - */
|
| - void set uri(String value) {
|
| - this._uri = value;
|
| - }
|
| -
|
| - ExecutionMapUriParams(String id, {String file, String uri}) {
|
| - this.id = id;
|
| - this.file = file;
|
| - this.uri = uri;
|
| - }
|
| -
|
| - factory ExecutionMapUriParams.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - String id;
|
| - if (json.containsKey("id")) {
|
| - id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "id");
|
| - }
|
| - String file;
|
| - if (json.containsKey("file")) {
|
| - file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
|
| - }
|
| - String uri;
|
| - if (json.containsKey("uri")) {
|
| - uri = jsonDecoder.decodeString(jsonPath + ".uri", json["uri"]);
|
| - }
|
| - return new ExecutionMapUriParams(id, file: file, uri: uri);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "execution.mapUri params", json);
|
| - }
|
| - }
|
| -
|
| - factory ExecutionMapUriParams.fromRequest(Request request) {
|
| - return new ExecutionMapUriParams.fromJson(
|
| - new RequestDecoder(request), "params", request.params);
|
| - }
|
| -
|
| - @override
|
| - 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;
|
| - }
|
| -
|
| - @override
|
| - Request toRequest(String id) {
|
| - return new Request(id, "execution.mapUri", toJson());
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is ExecutionMapUriParams) {
|
| - return id == other.id && file == other.file && uri == other.uri;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - 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);
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * execution.mapUri result
|
| - *
|
| - * {
|
| - * "file": optional FilePath
|
| - * "uri": optional String
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class ExecutionMapUriResult implements ResponseResult {
|
| - String _file;
|
| -
|
| - String _uri;
|
| -
|
| - /**
|
| - * The file to which the URI was mapped. This field is omitted if the uri
|
| - * field was not given in the request.
|
| - */
|
| - String get file => _file;
|
| -
|
| - /**
|
| - * The file to which the URI was mapped. This field is omitted if the uri
|
| - * field was not given in the request.
|
| - */
|
| - void set file(String value) {
|
| - this._file = value;
|
| - }
|
| -
|
| - /**
|
| - * The URI to which the file path was mapped. This field is omitted if the
|
| - * file field was not given in the request.
|
| - */
|
| - String get uri => _uri;
|
| -
|
| - /**
|
| - * The URI to which the file path was mapped. This field is omitted if the
|
| - * file field was not given in the request.
|
| - */
|
| - void set uri(String value) {
|
| - this._uri = value;
|
| - }
|
| -
|
| - ExecutionMapUriResult({String file, String uri}) {
|
| - this.file = file;
|
| - this.uri = uri;
|
| - }
|
| -
|
| - factory ExecutionMapUriResult.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - String file;
|
| - if (json.containsKey("file")) {
|
| - file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
|
| - }
|
| - String uri;
|
| - if (json.containsKey("uri")) {
|
| - uri = jsonDecoder.decodeString(jsonPath + ".uri", json["uri"]);
|
| - }
|
| - return new ExecutionMapUriResult(file: file, uri: uri);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "execution.mapUri result", json);
|
| - }
|
| - }
|
| -
|
| - factory ExecutionMapUriResult.fromResponse(Response response) {
|
| - return new ExecutionMapUriResult.fromJson(
|
| - new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)),
|
| - "result",
|
| - response.result);
|
| - }
|
| -
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - if (file != null) {
|
| - result["file"] = file;
|
| - }
|
| - if (uri != null) {
|
| - result["uri"] = uri;
|
| - }
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| - Response toResponse(String id) {
|
| - return new Response(id, result: toJson());
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is ExecutionMapUriResult) {
|
| - return file == other.file && uri == other.uri;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, file.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, uri.hashCode);
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * ExecutionService
|
| - *
|
| - * enum {
|
| - * LAUNCH_DATA
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class ExecutionService implements Enum {
|
| - static const ExecutionService LAUNCH_DATA =
|
| - const ExecutionService._("LAUNCH_DATA");
|
| -
|
| - /**
|
| - * A list containing all of the enum values that are defined.
|
| - */
|
| - static const List<ExecutionService> VALUES = const <ExecutionService>[
|
| - LAUNCH_DATA
|
| - ];
|
| -
|
| - @override
|
| - final String name;
|
| -
|
| - const ExecutionService._(this.name);
|
| -
|
| - factory ExecutionService(String name) {
|
| - switch (name) {
|
| - case "LAUNCH_DATA":
|
| - return LAUNCH_DATA;
|
| - }
|
| - throw new Exception('Illegal enum value: $name');
|
| - }
|
| -
|
| - factory ExecutionService.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json is String) {
|
| - try {
|
| - return new ExecutionService(json);
|
| - } catch (_) {
|
| - // Fall through
|
| - }
|
| - }
|
| - throw jsonDecoder.mismatch(jsonPath, "ExecutionService", json);
|
| - }
|
| -
|
| - @override
|
| - String toString() => "ExecutionService.$name";
|
| -
|
| - String toJson() => name;
|
| -}
|
| -
|
| -/**
|
| - * execution.setSubscriptions params
|
| - *
|
| - * {
|
| - * "subscriptions": List<ExecutionService>
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class ExecutionSetSubscriptionsParams implements RequestParams {
|
| - List<ExecutionService> _subscriptions;
|
| -
|
| - /**
|
| - * A list of the services being subscribed to.
|
| - */
|
| - List<ExecutionService> get subscriptions => _subscriptions;
|
| -
|
| - /**
|
| - * A list of the services being subscribed to.
|
| - */
|
| - void set subscriptions(List<ExecutionService> value) {
|
| - assert(value != null);
|
| - this._subscriptions = value;
|
| - }
|
| -
|
| - ExecutionSetSubscriptionsParams(List<ExecutionService> subscriptions) {
|
| - this.subscriptions = subscriptions;
|
| - }
|
| -
|
| - factory ExecutionSetSubscriptionsParams.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - List<ExecutionService> subscriptions;
|
| - if (json.containsKey("subscriptions")) {
|
| - subscriptions = jsonDecoder.decodeList(
|
| - jsonPath + ".subscriptions",
|
| - json["subscriptions"],
|
| - (String jsonPath, Object json) =>
|
| - new ExecutionService.fromJson(jsonDecoder, jsonPath, json));
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "subscriptions");
|
| - }
|
| - return new ExecutionSetSubscriptionsParams(subscriptions);
|
| - } else {
|
| - throw jsonDecoder.mismatch(
|
| - jsonPath, "execution.setSubscriptions params", json);
|
| - }
|
| - }
|
| -
|
| - factory ExecutionSetSubscriptionsParams.fromRequest(Request request) {
|
| - return new ExecutionSetSubscriptionsParams.fromJson(
|
| - new RequestDecoder(request), "params", request.params);
|
| - }
|
| -
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - result["subscriptions"] =
|
| - subscriptions.map((ExecutionService value) => value.toJson()).toList();
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| - Request toRequest(String id) {
|
| - return new Request(id, "execution.setSubscriptions", toJson());
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is ExecutionSetSubscriptionsParams) {
|
| - return listEqual(subscriptions, other.subscriptions,
|
| - (ExecutionService a, ExecutionService b) => a == b);
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, subscriptions.hashCode);
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * execution.setSubscriptions result
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class ExecutionSetSubscriptionsResult implements ResponseResult {
|
| - @override
|
| - Map<String, dynamic> toJson() => <String, dynamic>{};
|
| -
|
| - @override
|
| - Response toResponse(String id) {
|
| - return new Response(id, result: null);
|
| - }
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is ExecutionSetSubscriptionsResult) {
|
| - return true;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - return 287678780;
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * extractLocalVariable feedback
|
| - *
|
| - * {
|
| - * "coveringExpressionOffsets": optional List<int>
|
| - * "coveringExpressionLengths": optional List<int>
|
| - * "names": List<String>
|
| - * "offsets": List<int>
|
| - * "lengths": List<int>
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class ExtractLocalVariableFeedback extends RefactoringFeedback {
|
| - List<int> _coveringExpressionOffsets;
|
| -
|
| - List<int> _coveringExpressionLengths;
|
| -
|
| - List<String> _names;
|
| -
|
| - List<int> _offsets;
|
| -
|
| - List<int> _lengths;
|
| -
|
| - /**
|
| - * The offsets of the expressions that cover the specified selection, from
|
| - * the down most to the up most.
|
| - */
|
| - List<int> get coveringExpressionOffsets => _coveringExpressionOffsets;
|
| -
|
| - /**
|
| - * The offsets of the expressions that cover the specified selection, from
|
| - * the down most to the up most.
|
| - */
|
| - void set coveringExpressionOffsets(List<int> value) {
|
| - this._coveringExpressionOffsets = value;
|
| - }
|
| -
|
| - /**
|
| - * The lengths of the expressions that cover the specified selection, from
|
| - * the down most to the up most.
|
| - */
|
| - List<int> get coveringExpressionLengths => _coveringExpressionLengths;
|
| -
|
| - /**
|
| - * The lengths of the expressions that cover the specified selection, from
|
| - * the down most to the up most.
|
| - */
|
| - void set coveringExpressionLengths(List<int> value) {
|
| - this._coveringExpressionLengths = value;
|
| - }
|
| -
|
| - /**
|
| - * The proposed names for the local variable.
|
| - */
|
| - List<String> get names => _names;
|
| -
|
| - /**
|
| - * The proposed names for the local variable.
|
| - */
|
| - void set names(List<String> value) {
|
| - assert(value != null);
|
| - this._names = value;
|
| - }
|
| -
|
| - /**
|
| - * The offsets of the expressions that would be replaced by a reference to
|
| - * the variable.
|
| - */
|
| - List<int> get offsets => _offsets;
|
| -
|
| - /**
|
| - * The offsets of the expressions that would be replaced by a reference to
|
| - * the variable.
|
| - */
|
| - void set offsets(List<int> value) {
|
| - assert(value != null);
|
| - this._offsets = value;
|
| - }
|
| -
|
| - /**
|
| - * 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].
|
| - */
|
| - List<int> get lengths => _lengths;
|
| -
|
| - /**
|
| - * 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].
|
| - */
|
| - void set lengths(List<int> value) {
|
| - assert(value != null);
|
| - this._lengths = value;
|
| - }
|
| -
|
| - ExtractLocalVariableFeedback(
|
| - List<String> names, List<int> offsets, List<int> lengths,
|
| - {List<int> coveringExpressionOffsets,
|
| - List<int> coveringExpressionLengths}) {
|
| - this.coveringExpressionOffsets = coveringExpressionOffsets;
|
| - this.coveringExpressionLengths = coveringExpressionLengths;
|
| - this.names = names;
|
| - this.offsets = offsets;
|
| - this.lengths = lengths;
|
| - }
|
| -
|
| - factory ExtractLocalVariableFeedback.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - List<int> coveringExpressionOffsets;
|
| - if (json.containsKey("coveringExpressionOffsets")) {
|
| - coveringExpressionOffsets = jsonDecoder.decodeList(
|
| - jsonPath + ".coveringExpressionOffsets",
|
| - json["coveringExpressionOffsets"],
|
| - jsonDecoder.decodeInt);
|
| - }
|
| - List<int> coveringExpressionLengths;
|
| - if (json.containsKey("coveringExpressionLengths")) {
|
| - coveringExpressionLengths = jsonDecoder.decodeList(
|
| - jsonPath + ".coveringExpressionLengths",
|
| - json["coveringExpressionLengths"],
|
| - jsonDecoder.decodeInt);
|
| - }
|
| - List<String> names;
|
| - if (json.containsKey("names")) {
|
| - names = jsonDecoder.decodeList(
|
| - jsonPath + ".names", json["names"], jsonDecoder.decodeString);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "names");
|
| - }
|
| - List<int> offsets;
|
| - if (json.containsKey("offsets")) {
|
| - offsets = jsonDecoder.decodeList(
|
| - jsonPath + ".offsets", json["offsets"], jsonDecoder.decodeInt);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "offsets");
|
| - }
|
| - List<int> lengths;
|
| - if (json.containsKey("lengths")) {
|
| - lengths = jsonDecoder.decodeList(
|
| - jsonPath + ".lengths", json["lengths"], jsonDecoder.decodeInt);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "lengths");
|
| - }
|
| - return new ExtractLocalVariableFeedback(names, offsets, lengths,
|
| - coveringExpressionOffsets: coveringExpressionOffsets,
|
| - coveringExpressionLengths: coveringExpressionLengths);
|
| - } else {
|
| - throw jsonDecoder.mismatch(
|
| - jsonPath, "extractLocalVariable feedback", json);
|
| - }
|
| - }
|
| -
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - if (coveringExpressionOffsets != null) {
|
| - result["coveringExpressionOffsets"] = coveringExpressionOffsets;
|
| - }
|
| - if (coveringExpressionLengths != null) {
|
| - result["coveringExpressionLengths"] = coveringExpressionLengths;
|
| - }
|
| - result["names"] = names;
|
| - result["offsets"] = offsets;
|
| - result["lengths"] = lengths;
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is ExtractLocalVariableFeedback) {
|
| - return listEqual(coveringExpressionOffsets,
|
| - other.coveringExpressionOffsets, (int a, int b) => a == b) &&
|
| - listEqual(coveringExpressionLengths, other.coveringExpressionLengths,
|
| - (int a, int b) => a == b) &&
|
| - listEqual(names, other.names, (String a, String b) => a == b) &&
|
| - listEqual(offsets, other.offsets, (int a, int b) => a == b) &&
|
| - listEqual(lengths, other.lengths, (int a, int b) => a == b);
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, coveringExpressionOffsets.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, coveringExpressionLengths.hashCode);
|
| - 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
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class ExtractLocalVariableOptions extends RefactoringOptions {
|
| - String _name;
|
| -
|
| - bool _extractAll;
|
| -
|
| - /**
|
| - * The name that the local variable should be given.
|
| - */
|
| - String get name => _name;
|
| -
|
| - /**
|
| - * The name that the local variable should be given.
|
| - */
|
| - void set name(String value) {
|
| - assert(value != null);
|
| - this._name = value;
|
| - }
|
| -
|
| - /**
|
| - * 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.
|
| - */
|
| - bool get extractAll => _extractAll;
|
| -
|
| - /**
|
| - * 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.
|
| - */
|
| - void set extractAll(bool value) {
|
| - assert(value != null);
|
| - this._extractAll = value;
|
| - }
|
| -
|
| - ExtractLocalVariableOptions(String name, bool extractAll) {
|
| - this.name = name;
|
| - this.extractAll = extractAll;
|
| - }
|
| -
|
| - factory ExtractLocalVariableOptions.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - String name;
|
| - if (json.containsKey("name")) {
|
| - name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "name");
|
| - }
|
| - bool extractAll;
|
| - if (json.containsKey("extractAll")) {
|
| - extractAll = jsonDecoder.decodeBool(
|
| - jsonPath + ".extractAll", json["extractAll"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "extractAll");
|
| - }
|
| - return new ExtractLocalVariableOptions(name, extractAll);
|
| - } else {
|
| - throw jsonDecoder.mismatch(
|
| - jsonPath, "extractLocalVariable options", json);
|
| - }
|
| - }
|
| -
|
| - factory ExtractLocalVariableOptions.fromRefactoringParams(
|
| - EditGetRefactoringParams refactoringParams, Request request) {
|
| - return new ExtractLocalVariableOptions.fromJson(
|
| - new RequestDecoder(request), "options", refactoringParams.options);
|
| - }
|
| -
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - result["name"] = name;
|
| - result["extractAll"] = extractAll;
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is ExtractLocalVariableOptions) {
|
| - return name == other.name && extractAll == other.extractAll;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - 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>
|
| - * "offsets": List<int>
|
| - * "lengths": List<int>
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class ExtractMethodFeedback extends RefactoringFeedback {
|
| - int _offset;
|
| -
|
| - int _length;
|
| -
|
| - String _returnType;
|
| -
|
| - List<String> _names;
|
| -
|
| - bool _canCreateGetter;
|
| -
|
| - List<RefactoringMethodParameter> _parameters;
|
| -
|
| - List<int> _offsets;
|
| -
|
| - List<int> _lengths;
|
| -
|
| - /**
|
| - * The offset to the beginning of the expression or statements that will be
|
| - * extracted.
|
| - */
|
| - int get offset => _offset;
|
| -
|
| - /**
|
| - * The offset to the beginning of the expression or statements that will be
|
| - * extracted.
|
| - */
|
| - void set offset(int value) {
|
| - assert(value != null);
|
| - this._offset = value;
|
| - }
|
| -
|
| - /**
|
| - * The length of the expression or statements that will be extracted.
|
| - */
|
| - int get length => _length;
|
| -
|
| - /**
|
| - * The length of the expression or statements that will be extracted.
|
| - */
|
| - void set length(int value) {
|
| - assert(value != null);
|
| - this._length = value;
|
| - }
|
| -
|
| - /**
|
| - * The proposed return type for the method. If the returned element does not
|
| - * have a declared return type, this field will contain an empty string.
|
| - */
|
| - String get returnType => _returnType;
|
| -
|
| - /**
|
| - * The proposed return type for the method. If the returned element does not
|
| - * have a declared return type, this field will contain an empty string.
|
| - */
|
| - void set returnType(String value) {
|
| - assert(value != null);
|
| - this._returnType = value;
|
| - }
|
| -
|
| - /**
|
| - * The proposed names for the method.
|
| - */
|
| - List<String> get names => _names;
|
| -
|
| - /**
|
| - * The proposed names for the method.
|
| - */
|
| - void set names(List<String> value) {
|
| - assert(value != null);
|
| - this._names = value;
|
| - }
|
| -
|
| - /**
|
| - * True if a getter could be created rather than a method.
|
| - */
|
| - bool get canCreateGetter => _canCreateGetter;
|
| + (String a, String b) => a == b);
|
| + }
|
| + return false;
|
| + }
|
|
|
| - /**
|
| - * True if a getter could be created rather than a method.
|
| - */
|
| - void set canCreateGetter(bool value) {
|
| - assert(value != null);
|
| - this._canCreateGetter = value;
|
| + @override
|
| + int get hashCode {
|
| + int hash = 0;
|
| + hash = JenkinsSmiHash.combine(hash, initialProblems.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, optionsProblems.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, finalProblems.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, feedback.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, change.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, potentialEdits.hashCode);
|
| + return JenkinsSmiHash.finish(hash);
|
| }
|
| +}
|
|
|
| - /**
|
| - * The proposed parameters for the method.
|
| - */
|
| - List<RefactoringMethodParameter> get parameters => _parameters;
|
| +/**
|
| + * edit.getStatementCompletion params
|
| + *
|
| + * {
|
| + * "file": FilePath
|
| + * "offset": int
|
| + * }
|
| + *
|
| + * Clients may not extend, implement or mix-in this class.
|
| + */
|
| +class EditGetStatementCompletionParams implements RequestParams {
|
| + String _file;
|
|
|
| - /**
|
| - * The proposed parameters for the method.
|
| - */
|
| - void set parameters(List<RefactoringMethodParameter> value) {
|
| - assert(value != null);
|
| - this._parameters = value;
|
| - }
|
| + int _offset;
|
|
|
| /**
|
| - * The offsets of the expressions or statements that would be replaced by an
|
| - * invocation of the method.
|
| + * The file containing the statement to be completed.
|
| */
|
| - List<int> get offsets => _offsets;
|
| + String get file => _file;
|
|
|
| /**
|
| - * The offsets of the expressions or statements that would be replaced by an
|
| - * invocation of the method.
|
| + * The file containing the statement to be completed.
|
| */
|
| - void set offsets(List<int> value) {
|
| + void set file(String value) {
|
| assert(value != null);
|
| - this._offsets = value;
|
| + this._file = value;
|
| }
|
|
|
| /**
|
| - * 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].
|
| + * The offset used to identify the statement to be completed.
|
| */
|
| - List<int> get lengths => _lengths;
|
| + int get offset => _offset;
|
|
|
| /**
|
| - * 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].
|
| + * The offset used to identify the statement to be completed.
|
| */
|
| - void set lengths(List<int> value) {
|
| + void set offset(int value) {
|
| assert(value != null);
|
| - this._lengths = value;
|
| + this._offset = value;
|
| }
|
|
|
| - ExtractMethodFeedback(
|
| - int offset,
|
| - int length,
|
| - String returnType,
|
| - List<String> names,
|
| - bool canCreateGetter,
|
| - List<RefactoringMethodParameter> parameters,
|
| - List<int> offsets,
|
| - List<int> lengths) {
|
| + EditGetStatementCompletionParams(String file, int offset) {
|
| + this.file = file;
|
| this.offset = offset;
|
| - this.length = length;
|
| - this.returnType = returnType;
|
| - this.names = names;
|
| - this.canCreateGetter = canCreateGetter;
|
| - this.parameters = parameters;
|
| - this.offsets = offsets;
|
| - this.lengths = lengths;
|
| }
|
|
|
| - factory ExtractMethodFeedback.fromJson(
|
| + factory EditGetStatementCompletionParams.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| + String file;
|
| + if (json.containsKey("file")) {
|
| + file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "file");
|
| + }
|
| int offset;
|
| if (json.containsKey("offset")) {
|
| offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
|
| } else {
|
| throw jsonDecoder.mismatch(jsonPath, "offset");
|
| }
|
| - int length;
|
| - if (json.containsKey("length")) {
|
| - length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "length");
|
| - }
|
| - String returnType;
|
| - if (json.containsKey("returnType")) {
|
| - returnType = jsonDecoder.decodeString(
|
| - jsonPath + ".returnType", json["returnType"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "returnType");
|
| - }
|
| - List<String> names;
|
| - if (json.containsKey("names")) {
|
| - names = jsonDecoder.decodeList(
|
| - jsonPath + ".names", json["names"], jsonDecoder.decodeString);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "names");
|
| - }
|
| - bool canCreateGetter;
|
| - if (json.containsKey("canCreateGetter")) {
|
| - canCreateGetter = jsonDecoder.decodeBool(
|
| - jsonPath + ".canCreateGetter", json["canCreateGetter"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "canCreateGetter");
|
| - }
|
| - List<RefactoringMethodParameter> parameters;
|
| - if (json.containsKey("parameters")) {
|
| - parameters = jsonDecoder.decodeList(
|
| - jsonPath + ".parameters",
|
| - json["parameters"],
|
| - (String jsonPath, Object json) =>
|
| - new RefactoringMethodParameter.fromJson(
|
| - jsonDecoder, jsonPath, json));
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "parameters");
|
| - }
|
| - List<int> offsets;
|
| - if (json.containsKey("offsets")) {
|
| - offsets = jsonDecoder.decodeList(
|
| - jsonPath + ".offsets", json["offsets"], jsonDecoder.decodeInt);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "offsets");
|
| - }
|
| - List<int> lengths;
|
| - if (json.containsKey("lengths")) {
|
| - lengths = jsonDecoder.decodeList(
|
| - jsonPath + ".lengths", json["lengths"], jsonDecoder.decodeInt);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "lengths");
|
| - }
|
| - return new ExtractMethodFeedback(offset, length, returnType, names,
|
| - canCreateGetter, parameters, offsets, lengths);
|
| + return new EditGetStatementCompletionParams(file, offset);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "extractMethod feedback", json);
|
| + throw jsonDecoder.mismatch(
|
| + jsonPath, "edit.getStatementCompletion params", json);
|
| }
|
| }
|
|
|
| + factory EditGetStatementCompletionParams.fromRequest(Request request) {
|
| + return new EditGetStatementCompletionParams.fromJson(
|
| + new RequestDecoder(request), "params", request.params);
|
| + }
|
| +
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| + result["file"] = file;
|
| result["offset"] = offset;
|
| - result["length"] = length;
|
| - result["returnType"] = returnType;
|
| - result["names"] = names;
|
| - result["canCreateGetter"] = canCreateGetter;
|
| - result["parameters"] = parameters
|
| - .map((RefactoringMethodParameter value) => value.toJson())
|
| - .toList();
|
| - result["offsets"] = offsets;
|
| - result["lengths"] = lengths;
|
| return result;
|
| }
|
|
|
| @override
|
| + Request toRequest(String id) {
|
| + return new Request(id, "edit.getStatementCompletion", toJson());
|
| + }
|
| +
|
| + @override
|
| String toString() => JSON.encode(toJson());
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is ExtractMethodFeedback) {
|
| - return offset == other.offset &&
|
| - length == other.length &&
|
| - returnType == other.returnType &&
|
| - listEqual(names, other.names, (String a, String b) => a == b) &&
|
| - canCreateGetter == other.canCreateGetter &&
|
| - listEqual(
|
| - parameters,
|
| - other.parameters,
|
| - (RefactoringMethodParameter a, RefactoringMethodParameter b) =>
|
| - a == b) &&
|
| - listEqual(offsets, other.offsets, (int a, int b) => a == b) &&
|
| - listEqual(lengths, other.lengths, (int a, int b) => a == b);
|
| + if (other is EditGetStatementCompletionParams) {
|
| + return file == other.file && offset == other.offset;
|
| }
|
| return false;
|
| }
|
| @@ -10486,225 +6517,114 @@ class ExtractMethodFeedback extends RefactoringFeedback {
|
| @override
|
| 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, returnType.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, names.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, canCreateGetter.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, parameters.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, offsets.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, lengths.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * extractMethod options
|
| + * edit.getStatementCompletion result
|
| *
|
| * {
|
| - * "returnType": String
|
| - * "createGetter": bool
|
| - * "name": String
|
| - * "parameters": List<RefactoringMethodParameter>
|
| - * "extractAll": bool
|
| + * "change": SourceChange
|
| + * "whitespaceOnly": bool
|
| * }
|
| *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class ExtractMethodOptions extends RefactoringOptions {
|
| - String _returnType;
|
| -
|
| - bool _createGetter;
|
| -
|
| - String _name;
|
| -
|
| - List<RefactoringMethodParameter> _parameters;
|
| -
|
| - bool _extractAll;
|
| -
|
| - /**
|
| - * The return type that should be defined for the method.
|
| - */
|
| - String get returnType => _returnType;
|
| -
|
| - /**
|
| - * The return type that should be defined for the method.
|
| - */
|
| - void set returnType(String value) {
|
| - assert(value != null);
|
| - this._returnType = value;
|
| - }
|
| -
|
| - /**
|
| - * 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.
|
| - */
|
| - bool get createGetter => _createGetter;
|
| -
|
| - /**
|
| - * 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.
|
| - */
|
| - void set createGetter(bool value) {
|
| - assert(value != null);
|
| - this._createGetter = value;
|
| - }
|
| -
|
| - /**
|
| - * The name that the method should be given.
|
| - */
|
| - String get name => _name;
|
| + * Clients may not extend, implement or mix-in this class.
|
| + */
|
| +class EditGetStatementCompletionResult implements ResponseResult {
|
| + SourceChange _change;
|
|
|
| - /**
|
| - * The name that the method should be given.
|
| - */
|
| - void set name(String value) {
|
| - assert(value != null);
|
| - this._name = value;
|
| - }
|
| + bool _whitespaceOnly;
|
|
|
| /**
|
| - * 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 parameters, add parameters
|
| - * with the same identifiers as proposed.
|
| - * - To add new parameters, omit their identifier.
|
| - * - To remove some parameters, omit them in this list.
|
| + * The change to be applied in order to complete the statement.
|
| */
|
| - List<RefactoringMethodParameter> get parameters => _parameters;
|
| + SourceChange get change => _change;
|
|
|
| /**
|
| - * 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 parameters, add parameters
|
| - * with the same identifiers as proposed.
|
| - * - To add new parameters, omit their identifier.
|
| - * - To remove some parameters, omit them in this list.
|
| + * The change to be applied in order to complete the statement.
|
| */
|
| - void set parameters(List<RefactoringMethodParameter> value) {
|
| + void set change(SourceChange value) {
|
| assert(value != null);
|
| - this._parameters = value;
|
| + this._change = value;
|
| }
|
|
|
| /**
|
| - * 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.
|
| + * Will be true if the change contains nothing but whitespace characters, or
|
| + * is empty.
|
| */
|
| - bool get extractAll => _extractAll;
|
| + bool get whitespaceOnly => _whitespaceOnly;
|
|
|
| /**
|
| - * 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.
|
| + * Will be true if the change contains nothing but whitespace characters, or
|
| + * is empty.
|
| */
|
| - void set extractAll(bool value) {
|
| + void set whitespaceOnly(bool value) {
|
| assert(value != null);
|
| - this._extractAll = value;
|
| + this._whitespaceOnly = value;
|
| }
|
|
|
| - ExtractMethodOptions(String returnType, bool createGetter, String name,
|
| - List<RefactoringMethodParameter> parameters, bool extractAll) {
|
| - this.returnType = returnType;
|
| - this.createGetter = createGetter;
|
| - this.name = name;
|
| - this.parameters = parameters;
|
| - this.extractAll = extractAll;
|
| + EditGetStatementCompletionResult(SourceChange change, bool whitespaceOnly) {
|
| + this.change = change;
|
| + this.whitespaceOnly = whitespaceOnly;
|
| }
|
|
|
| - factory ExtractMethodOptions.fromJson(
|
| + factory EditGetStatementCompletionResult.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - String returnType;
|
| - if (json.containsKey("returnType")) {
|
| - returnType = jsonDecoder.decodeString(
|
| - jsonPath + ".returnType", json["returnType"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "returnType");
|
| - }
|
| - bool createGetter;
|
| - if (json.containsKey("createGetter")) {
|
| - createGetter = jsonDecoder.decodeBool(
|
| - jsonPath + ".createGetter", json["createGetter"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "createGetter");
|
| - }
|
| - String name;
|
| - if (json.containsKey("name")) {
|
| - name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "name");
|
| - }
|
| - List<RefactoringMethodParameter> parameters;
|
| - if (json.containsKey("parameters")) {
|
| - parameters = jsonDecoder.decodeList(
|
| - jsonPath + ".parameters",
|
| - json["parameters"],
|
| - (String jsonPath, Object json) =>
|
| - new RefactoringMethodParameter.fromJson(
|
| - jsonDecoder, jsonPath, json));
|
| + SourceChange change;
|
| + if (json.containsKey("change")) {
|
| + change = new SourceChange.fromJson(
|
| + jsonDecoder, jsonPath + ".change", json["change"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "parameters");
|
| + throw jsonDecoder.mismatch(jsonPath, "change");
|
| }
|
| - bool extractAll;
|
| - if (json.containsKey("extractAll")) {
|
| - extractAll = jsonDecoder.decodeBool(
|
| - jsonPath + ".extractAll", json["extractAll"]);
|
| + bool whitespaceOnly;
|
| + if (json.containsKey("whitespaceOnly")) {
|
| + whitespaceOnly = jsonDecoder.decodeBool(
|
| + jsonPath + ".whitespaceOnly", json["whitespaceOnly"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "extractAll");
|
| + throw jsonDecoder.mismatch(jsonPath, "whitespaceOnly");
|
| }
|
| - return new ExtractMethodOptions(
|
| - returnType, createGetter, name, parameters, extractAll);
|
| + return new EditGetStatementCompletionResult(change, whitespaceOnly);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "extractMethod options", json);
|
| + throw jsonDecoder.mismatch(
|
| + jsonPath, "edit.getStatementCompletion result", json);
|
| }
|
| }
|
|
|
| - factory ExtractMethodOptions.fromRefactoringParams(
|
| - EditGetRefactoringParams refactoringParams, Request request) {
|
| - return new ExtractMethodOptions.fromJson(
|
| - new RequestDecoder(request), "options", refactoringParams.options);
|
| + factory EditGetStatementCompletionResult.fromResponse(Response response) {
|
| + return new EditGetStatementCompletionResult.fromJson(
|
| + new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)),
|
| + "result",
|
| + response.result);
|
| }
|
|
|
| @override
|
| 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())
|
| - .toList();
|
| - result["extractAll"] = extractAll;
|
| + result["change"] = change.toJson();
|
| + result["whitespaceOnly"] = whitespaceOnly;
|
| return result;
|
| }
|
|
|
| @override
|
| + Response toResponse(String id) {
|
| + return new Response(id, result: toJson());
|
| + }
|
| +
|
| + @override
|
| String toString() => JSON.encode(toJson());
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is ExtractMethodOptions) {
|
| - return returnType == other.returnType &&
|
| - createGetter == other.createGetter &&
|
| - name == other.name &&
|
| - listEqual(
|
| - parameters,
|
| - other.parameters,
|
| - (RefactoringMethodParameter a, RefactoringMethodParameter b) =>
|
| - a == b) &&
|
| - extractAll == other.extractAll;
|
| + if (other is EditGetStatementCompletionResult) {
|
| + return change == other.change && whitespaceOnly == other.whitespaceOnly;
|
| }
|
| return false;
|
| }
|
| @@ -10712,256 +6632,256 @@ class ExtractMethodOptions extends RefactoringOptions {
|
| @override
|
| 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);
|
| + hash = JenkinsSmiHash.combine(hash, change.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, whitespaceOnly.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * FileKind
|
| + * edit.organizeDirectives params
|
| *
|
| - * enum {
|
| - * LIBRARY
|
| - * PART
|
| + * {
|
| + * "file": FilePath
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class FileKind implements Enum {
|
| - static const FileKind LIBRARY = const FileKind._("LIBRARY");
|
| -
|
| - static const FileKind PART = const FileKind._("PART");
|
| +class EditOrganizeDirectivesParams implements RequestParams {
|
| + String _file;
|
|
|
| /**
|
| - * A list containing all of the enum values that are defined.
|
| + * The Dart file to organize directives in.
|
| */
|
| - static const List<FileKind> VALUES = const <FileKind>[LIBRARY, PART];
|
| -
|
| - @override
|
| - final String name;
|
| + String get file => _file;
|
|
|
| - const FileKind._(this.name);
|
| + /**
|
| + * The Dart file to organize directives in.
|
| + */
|
| + void set file(String value) {
|
| + assert(value != null);
|
| + this._file = value;
|
| + }
|
|
|
| - factory FileKind(String name) {
|
| - switch (name) {
|
| - case "LIBRARY":
|
| - return LIBRARY;
|
| - case "PART":
|
| - return PART;
|
| - }
|
| - throw new Exception('Illegal enum value: $name');
|
| + EditOrganizeDirectivesParams(String file) {
|
| + this.file = file;
|
| }
|
|
|
| - factory FileKind.fromJson(
|
| + factory EditOrganizeDirectivesParams.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json is String) {
|
| - try {
|
| - return new FileKind(json);
|
| - } catch (_) {
|
| - // Fall through
|
| + if (json == null) {
|
| + json = {};
|
| + }
|
| + if (json is Map) {
|
| + String file;
|
| + if (json.containsKey("file")) {
|
| + file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "file");
|
| }
|
| + return new EditOrganizeDirectivesParams(file);
|
| + } else {
|
| + throw jsonDecoder.mismatch(
|
| + jsonPath, "edit.organizeDirectives params", json);
|
| }
|
| - throw jsonDecoder.mismatch(jsonPath, "FileKind", json);
|
| + }
|
| +
|
| + factory EditOrganizeDirectivesParams.fromRequest(Request request) {
|
| + return new EditOrganizeDirectivesParams.fromJson(
|
| + new RequestDecoder(request), "params", request.params);
|
| }
|
|
|
| @override
|
| - String toString() => "FileKind.$name";
|
| + Map<String, dynamic> toJson() {
|
| + Map<String, dynamic> result = {};
|
| + result["file"] = file;
|
| + return result;
|
| + }
|
|
|
| - String toJson() => name;
|
| + @override
|
| + Request toRequest(String id) {
|
| + return new Request(id, "edit.organizeDirectives", toJson());
|
| + }
|
| +
|
| + @override
|
| + String toString() => JSON.encode(toJson());
|
| +
|
| + @override
|
| + bool operator ==(other) {
|
| + if (other is EditOrganizeDirectivesParams) {
|
| + return file == other.file;
|
| + }
|
| + return false;
|
| + }
|
| +
|
| + @override
|
| + int get hashCode {
|
| + int hash = 0;
|
| + hash = JenkinsSmiHash.combine(hash, file.hashCode);
|
| + return JenkinsSmiHash.finish(hash);
|
| + }
|
| }
|
|
|
| /**
|
| - * FoldingKind
|
| + * edit.organizeDirectives result
|
| *
|
| - * enum {
|
| - * COMMENT
|
| - * CLASS_MEMBER
|
| - * DIRECTIVES
|
| - * DOCUMENTATION_COMMENT
|
| - * TOP_LEVEL_DECLARATION
|
| + * {
|
| + * "edit": SourceFileEdit
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class FoldingKind implements Enum {
|
| - static const FoldingKind COMMENT = const FoldingKind._("COMMENT");
|
| -
|
| - static const FoldingKind CLASS_MEMBER = const FoldingKind._("CLASS_MEMBER");
|
| -
|
| - static const FoldingKind DIRECTIVES = const FoldingKind._("DIRECTIVES");
|
| -
|
| - static const FoldingKind DOCUMENTATION_COMMENT =
|
| - const FoldingKind._("DOCUMENTATION_COMMENT");
|
| -
|
| - static const FoldingKind TOP_LEVEL_DECLARATION =
|
| - const FoldingKind._("TOP_LEVEL_DECLARATION");
|
| +class EditOrganizeDirectivesResult implements ResponseResult {
|
| + SourceFileEdit _edit;
|
|
|
| /**
|
| - * A list containing all of the enum values that are defined.
|
| + * The file edit that is to be applied to the given file to effect the
|
| + * organizing.
|
| */
|
| - static const List<FoldingKind> VALUES = const <FoldingKind>[
|
| - COMMENT,
|
| - CLASS_MEMBER,
|
| - DIRECTIVES,
|
| - DOCUMENTATION_COMMENT,
|
| - TOP_LEVEL_DECLARATION
|
| - ];
|
| -
|
| - @override
|
| - final String name;
|
| + SourceFileEdit get edit => _edit;
|
|
|
| - const FoldingKind._(this.name);
|
| + /**
|
| + * The file edit that is to be applied to the given file to effect the
|
| + * organizing.
|
| + */
|
| + void set edit(SourceFileEdit value) {
|
| + assert(value != null);
|
| + this._edit = value;
|
| + }
|
|
|
| - 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');
|
| + EditOrganizeDirectivesResult(SourceFileEdit edit) {
|
| + this.edit = edit;
|
| }
|
|
|
| - factory FoldingKind.fromJson(
|
| + factory EditOrganizeDirectivesResult.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json is String) {
|
| - try {
|
| - return new FoldingKind(json);
|
| - } catch (_) {
|
| - // Fall through
|
| + if (json == null) {
|
| + json = {};
|
| + }
|
| + if (json is Map) {
|
| + SourceFileEdit edit;
|
| + if (json.containsKey("edit")) {
|
| + edit = new SourceFileEdit.fromJson(
|
| + jsonDecoder, jsonPath + ".edit", json["edit"]);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "edit");
|
| }
|
| + return new EditOrganizeDirectivesResult(edit);
|
| + } else {
|
| + throw jsonDecoder.mismatch(
|
| + jsonPath, "edit.organizeDirectives result", json);
|
| }
|
| - throw jsonDecoder.mismatch(jsonPath, "FoldingKind", json);
|
| + }
|
| +
|
| + factory EditOrganizeDirectivesResult.fromResponse(Response response) {
|
| + return new EditOrganizeDirectivesResult.fromJson(
|
| + new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)),
|
| + "result",
|
| + response.result);
|
| }
|
|
|
| @override
|
| - String toString() => "FoldingKind.$name";
|
| + Map<String, dynamic> toJson() {
|
| + Map<String, dynamic> result = {};
|
| + result["edit"] = edit.toJson();
|
| + return result;
|
| + }
|
|
|
| - String toJson() => name;
|
| + @override
|
| + Response toResponse(String id) {
|
| + return new Response(id, result: toJson());
|
| + }
|
| +
|
| + @override
|
| + String toString() => JSON.encode(toJson());
|
| +
|
| + @override
|
| + bool operator ==(other) {
|
| + if (other is EditOrganizeDirectivesResult) {
|
| + return edit == other.edit;
|
| + }
|
| + return false;
|
| + }
|
| +
|
| + @override
|
| + int get hashCode {
|
| + int hash = 0;
|
| + hash = JenkinsSmiHash.combine(hash, edit.hashCode);
|
| + return JenkinsSmiHash.finish(hash);
|
| + }
|
| }
|
|
|
| /**
|
| - * FoldingRegion
|
| + * edit.sortMembers params
|
| *
|
| * {
|
| - * "kind": FoldingKind
|
| - * "offset": int
|
| - * "length": int
|
| + * "file": FilePath
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class FoldingRegion implements HasToJson {
|
| - FoldingKind _kind;
|
| -
|
| - int _offset;
|
| -
|
| - int _length;
|
| -
|
| - /**
|
| - * The kind of the region.
|
| - */
|
| - FoldingKind get kind => _kind;
|
| -
|
| - /**
|
| - * The kind of the region.
|
| - */
|
| - void set kind(FoldingKind value) {
|
| - assert(value != null);
|
| - this._kind = value;
|
| - }
|
| -
|
| - /**
|
| - * The offset of the region to be folded.
|
| - */
|
| - int get offset => _offset;
|
| -
|
| - /**
|
| - * The offset of the region to be folded.
|
| - */
|
| - void set offset(int value) {
|
| - assert(value != null);
|
| - this._offset = value;
|
| - }
|
| +class EditSortMembersParams implements RequestParams {
|
| + String _file;
|
|
|
| /**
|
| - * The length of the region to be folded.
|
| + * The Dart file to sort.
|
| */
|
| - int get length => _length;
|
| + String get file => _file;
|
|
|
| /**
|
| - * The length of the region to be folded.
|
| + * The Dart file to sort.
|
| */
|
| - void set length(int value) {
|
| + void set file(String value) {
|
| assert(value != null);
|
| - this._length = value;
|
| + this._file = value;
|
| }
|
|
|
| - FoldingRegion(FoldingKind kind, int offset, int length) {
|
| - this.kind = kind;
|
| - this.offset = offset;
|
| - this.length = length;
|
| + EditSortMembersParams(String file) {
|
| + this.file = file;
|
| }
|
|
|
| - factory FoldingRegion.fromJson(
|
| + factory EditSortMembersParams.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - FoldingKind kind;
|
| - if (json.containsKey("kind")) {
|
| - kind = new FoldingKind.fromJson(
|
| - jsonDecoder, jsonPath + ".kind", json["kind"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "kind");
|
| - }
|
| - int offset;
|
| - if (json.containsKey("offset")) {
|
| - offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "offset");
|
| - }
|
| - int length;
|
| - if (json.containsKey("length")) {
|
| - length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
|
| + String file;
|
| + if (json.containsKey("file")) {
|
| + file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "length");
|
| + throw jsonDecoder.mismatch(jsonPath, "file");
|
| }
|
| - return new FoldingRegion(kind, offset, length);
|
| + return new EditSortMembersParams(file);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "FoldingRegion", json);
|
| + throw jsonDecoder.mismatch(jsonPath, "edit.sortMembers params", json);
|
| }
|
| }
|
|
|
| + factory EditSortMembersParams.fromRequest(Request request) {
|
| + return new EditSortMembersParams.fromJson(
|
| + new RequestDecoder(request), "params", request.params);
|
| + }
|
| +
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| - result["kind"] = kind.toJson();
|
| - result["offset"] = offset;
|
| - result["length"] = length;
|
| + result["file"] = file;
|
| return result;
|
| }
|
|
|
| @override
|
| + Request toRequest(String id) {
|
| + return new Request(id, "edit.sortMembers", toJson());
|
| + }
|
| +
|
| + @override
|
| String toString() => JSON.encode(toJson());
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is FoldingRegion) {
|
| - return kind == other.kind &&
|
| - offset == other.offset &&
|
| - length == other.length;
|
| + if (other is EditSortMembersParams) {
|
| + return file == other.file;
|
| }
|
| return false;
|
| }
|
| @@ -10969,163 +6889,175 @@ class FoldingRegion implements HasToJson {
|
| @override
|
| int get hashCode {
|
| int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, kind.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, offset.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, length.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, file.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * GeneralAnalysisService
|
| + * edit.sortMembers result
|
| *
|
| - * enum {
|
| - * ANALYZED_FILES
|
| + * {
|
| + * "edit": SourceFileEdit
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class GeneralAnalysisService implements Enum {
|
| - static const GeneralAnalysisService ANALYZED_FILES =
|
| - const GeneralAnalysisService._("ANALYZED_FILES");
|
| +class EditSortMembersResult implements ResponseResult {
|
| + SourceFileEdit _edit;
|
|
|
| /**
|
| - * A list containing all of the enum values that are defined.
|
| + * The file edit that is to be applied to the given file to effect the
|
| + * sorting.
|
| */
|
| - static const List<GeneralAnalysisService> VALUES =
|
| - const <GeneralAnalysisService>[ANALYZED_FILES];
|
| -
|
| - @override
|
| - final String name;
|
| + SourceFileEdit get edit => _edit;
|
|
|
| - const GeneralAnalysisService._(this.name);
|
| + /**
|
| + * The file edit that is to be applied to the given file to effect the
|
| + * sorting.
|
| + */
|
| + void set edit(SourceFileEdit value) {
|
| + assert(value != null);
|
| + this._edit = value;
|
| + }
|
|
|
| - factory GeneralAnalysisService(String name) {
|
| - switch (name) {
|
| - case "ANALYZED_FILES":
|
| - return ANALYZED_FILES;
|
| - }
|
| - throw new Exception('Illegal enum value: $name');
|
| + EditSortMembersResult(SourceFileEdit edit) {
|
| + this.edit = edit;
|
| }
|
|
|
| - factory GeneralAnalysisService.fromJson(
|
| + factory EditSortMembersResult.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json is String) {
|
| - try {
|
| - return new GeneralAnalysisService(json);
|
| - } catch (_) {
|
| - // Fall through
|
| + if (json == null) {
|
| + json = {};
|
| + }
|
| + if (json is Map) {
|
| + SourceFileEdit edit;
|
| + if (json.containsKey("edit")) {
|
| + edit = new SourceFileEdit.fromJson(
|
| + jsonDecoder, jsonPath + ".edit", json["edit"]);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "edit");
|
| }
|
| + return new EditSortMembersResult(edit);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "edit.sortMembers result", json);
|
| + }
|
| + }
|
| +
|
| + factory EditSortMembersResult.fromResponse(Response response) {
|
| + return new EditSortMembersResult.fromJson(
|
| + new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)),
|
| + "result",
|
| + response.result);
|
| + }
|
| +
|
| + @override
|
| + Map<String, dynamic> toJson() {
|
| + Map<String, dynamic> result = {};
|
| + result["edit"] = edit.toJson();
|
| + return result;
|
| + }
|
| +
|
| + @override
|
| + Response toResponse(String id) {
|
| + return new Response(id, result: toJson());
|
| + }
|
| +
|
| + @override
|
| + String toString() => JSON.encode(toJson());
|
| +
|
| + @override
|
| + bool operator ==(other) {
|
| + if (other is EditSortMembersResult) {
|
| + return edit == other.edit;
|
| }
|
| - throw jsonDecoder.mismatch(jsonPath, "GeneralAnalysisService", json);
|
| + return false;
|
| }
|
|
|
| @override
|
| - String toString() => "GeneralAnalysisService.$name";
|
| -
|
| - String toJson() => name;
|
| + int get hashCode {
|
| + int hash = 0;
|
| + hash = JenkinsSmiHash.combine(hash, edit.hashCode);
|
| + return JenkinsSmiHash.finish(hash);
|
| + }
|
| }
|
|
|
| /**
|
| - * HighlightRegion
|
| + * ExecutableFile
|
| *
|
| * {
|
| - * "type": HighlightRegionType
|
| - * "offset": int
|
| - * "length": int
|
| + * "file": FilePath
|
| + * "kind": ExecutableKind
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class HighlightRegion implements HasToJson {
|
| - HighlightRegionType _type;
|
| -
|
| - int _offset;
|
| -
|
| - int _length;
|
| -
|
| - /**
|
| - * The type of highlight associated with the region.
|
| - */
|
| - HighlightRegionType get type => _type;
|
| +class ExecutableFile implements HasToJson {
|
| + String _file;
|
|
|
| - /**
|
| - * The type of highlight associated with the region.
|
| - */
|
| - void set type(HighlightRegionType value) {
|
| - assert(value != null);
|
| - this._type = value;
|
| - }
|
| + ExecutableKind _kind;
|
|
|
| /**
|
| - * The offset of the region to be highlighted.
|
| + * The path of the executable file.
|
| */
|
| - int get offset => _offset;
|
| + String get file => _file;
|
|
|
| /**
|
| - * The offset of the region to be highlighted.
|
| + * The path of the executable file.
|
| */
|
| - void set offset(int value) {
|
| + void set file(String value) {
|
| assert(value != null);
|
| - this._offset = value;
|
| + this._file = value;
|
| }
|
|
|
| /**
|
| - * The length of the region to be highlighted.
|
| + * The kind of the executable file.
|
| */
|
| - int get length => _length;
|
| + ExecutableKind get kind => _kind;
|
|
|
| /**
|
| - * The length of the region to be highlighted.
|
| + * The kind of the executable file.
|
| */
|
| - void set length(int value) {
|
| + void set kind(ExecutableKind value) {
|
| assert(value != null);
|
| - this._length = value;
|
| + this._kind = value;
|
| }
|
|
|
| - HighlightRegion(HighlightRegionType type, int offset, int length) {
|
| - this.type = type;
|
| - this.offset = offset;
|
| - this.length = length;
|
| + ExecutableFile(String file, ExecutableKind kind) {
|
| + this.file = file;
|
| + this.kind = kind;
|
| }
|
|
|
| - factory HighlightRegion.fromJson(
|
| + factory ExecutableFile.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - HighlightRegionType type;
|
| - if (json.containsKey("type")) {
|
| - type = new HighlightRegionType.fromJson(
|
| - jsonDecoder, jsonPath + ".type", json["type"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "type");
|
| - }
|
| - int offset;
|
| - if (json.containsKey("offset")) {
|
| - offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
|
| + String file;
|
| + if (json.containsKey("file")) {
|
| + file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "offset");
|
| + throw jsonDecoder.mismatch(jsonPath, "file");
|
| }
|
| - int length;
|
| - if (json.containsKey("length")) {
|
| - length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
|
| + ExecutableKind kind;
|
| + if (json.containsKey("kind")) {
|
| + kind = new ExecutableKind.fromJson(
|
| + jsonDecoder, jsonPath + ".kind", json["kind"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "length");
|
| + throw jsonDecoder.mismatch(jsonPath, "kind");
|
| }
|
| - return new HighlightRegion(type, offset, length);
|
| + return new ExecutableFile(file, kind);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "HighlightRegion", json);
|
| + throw jsonDecoder.mismatch(jsonPath, "ExecutableFile", json);
|
| }
|
| }
|
|
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| - result["type"] = type.toJson();
|
| - result["offset"] = offset;
|
| - result["length"] = length;
|
| + result["file"] = file;
|
| + result["kind"] = kind.toJson();
|
| return result;
|
| }
|
|
|
| @@ -11134,1117 +7066,505 @@ class HighlightRegion implements HasToJson {
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is HighlightRegion) {
|
| - return type == other.type &&
|
| - offset == other.offset &&
|
| - length == other.length;
|
| + if (other is ExecutableFile) {
|
| + return file == other.file && kind == other.kind;
|
| }
|
| return false;
|
| }
|
|
|
| @override
|
| 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
|
| - * DYNAMIC_LOCAL_VARIABLE_DECLARATION
|
| - * DYNAMIC_LOCAL_VARIABLE_REFERENCE
|
| - * DYNAMIC_PARAMETER_DECLARATION
|
| - * DYNAMIC_PARAMETER_REFERENCE
|
| - * ENUM
|
| - * ENUM_CONSTANT
|
| - * FIELD
|
| - * FIELD_STATIC
|
| - * FUNCTION
|
| - * FUNCTION_DECLARATION
|
| - * FUNCTION_TYPE_ALIAS
|
| - * GETTER_DECLARATION
|
| - * IDENTIFIER_DEFAULT
|
| - * IMPORT_PREFIX
|
| - * INSTANCE_FIELD_DECLARATION
|
| - * INSTANCE_FIELD_REFERENCE
|
| - * INSTANCE_GETTER_DECLARATION
|
| - * INSTANCE_GETTER_REFERENCE
|
| - * INSTANCE_METHOD_DECLARATION
|
| - * INSTANCE_METHOD_REFERENCE
|
| - * INSTANCE_SETTER_DECLARATION
|
| - * INSTANCE_SETTER_REFERENCE
|
| - * INVALID_STRING_ESCAPE
|
| - * KEYWORD
|
| - * LABEL
|
| - * LIBRARY_NAME
|
| - * LITERAL_BOOLEAN
|
| - * LITERAL_DOUBLE
|
| - * LITERAL_INTEGER
|
| - * LITERAL_LIST
|
| - * LITERAL_MAP
|
| - * LITERAL_STRING
|
| - * LOCAL_FUNCTION_DECLARATION
|
| - * LOCAL_FUNCTION_REFERENCE
|
| - * LOCAL_VARIABLE
|
| - * LOCAL_VARIABLE_DECLARATION
|
| - * LOCAL_VARIABLE_REFERENCE
|
| - * METHOD
|
| - * METHOD_DECLARATION
|
| - * METHOD_DECLARATION_STATIC
|
| - * METHOD_STATIC
|
| - * PARAMETER
|
| - * SETTER_DECLARATION
|
| - * TOP_LEVEL_VARIABLE
|
| - * PARAMETER_DECLARATION
|
| - * PARAMETER_REFERENCE
|
| - * STATIC_FIELD_DECLARATION
|
| - * STATIC_GETTER_DECLARATION
|
| - * STATIC_GETTER_REFERENCE
|
| - * STATIC_METHOD_DECLARATION
|
| - * STATIC_METHOD_REFERENCE
|
| - * STATIC_SETTER_DECLARATION
|
| - * STATIC_SETTER_REFERENCE
|
| - * TOP_LEVEL_FUNCTION_DECLARATION
|
| - * TOP_LEVEL_FUNCTION_REFERENCE
|
| - * TOP_LEVEL_GETTER_DECLARATION
|
| - * TOP_LEVEL_GETTER_REFERENCE
|
| - * TOP_LEVEL_SETTER_DECLARATION
|
| - * TOP_LEVEL_SETTER_REFERENCE
|
| - * TOP_LEVEL_VARIABLE_DECLARATION
|
| - * TYPE_NAME_DYNAMIC
|
| - * TYPE_PARAMETER
|
| - * UNRESOLVED_INSTANCE_MEMBER_REFERENCE
|
| - * VALID_STRING_ESCAPE
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class HighlightRegionType implements Enum {
|
| - static const HighlightRegionType ANNOTATION =
|
| - const HighlightRegionType._("ANNOTATION");
|
| -
|
| - static const HighlightRegionType BUILT_IN =
|
| - const HighlightRegionType._("BUILT_IN");
|
| -
|
| - static const HighlightRegionType CLASS = const HighlightRegionType._("CLASS");
|
| -
|
| - static const HighlightRegionType COMMENT_BLOCK =
|
| - const HighlightRegionType._("COMMENT_BLOCK");
|
| -
|
| - static const HighlightRegionType COMMENT_DOCUMENTATION =
|
| - const HighlightRegionType._("COMMENT_DOCUMENTATION");
|
| -
|
| - static const HighlightRegionType COMMENT_END_OF_LINE =
|
| - const HighlightRegionType._("COMMENT_END_OF_LINE");
|
| -
|
| - static const HighlightRegionType CONSTRUCTOR =
|
| - const HighlightRegionType._("CONSTRUCTOR");
|
| -
|
| - static const HighlightRegionType DIRECTIVE =
|
| - const HighlightRegionType._("DIRECTIVE");
|
| -
|
| - /**
|
| - * Only for version 1 of highlight.
|
| - */
|
| - static const HighlightRegionType DYNAMIC_TYPE =
|
| - const HighlightRegionType._("DYNAMIC_TYPE");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType DYNAMIC_LOCAL_VARIABLE_DECLARATION =
|
| - const HighlightRegionType._("DYNAMIC_LOCAL_VARIABLE_DECLARATION");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType DYNAMIC_LOCAL_VARIABLE_REFERENCE =
|
| - const HighlightRegionType._("DYNAMIC_LOCAL_VARIABLE_REFERENCE");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType DYNAMIC_PARAMETER_DECLARATION =
|
| - const HighlightRegionType._("DYNAMIC_PARAMETER_DECLARATION");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType DYNAMIC_PARAMETER_REFERENCE =
|
| - const HighlightRegionType._("DYNAMIC_PARAMETER_REFERENCE");
|
| -
|
| - static const HighlightRegionType ENUM = const HighlightRegionType._("ENUM");
|
| -
|
| - static const HighlightRegionType ENUM_CONSTANT =
|
| - const HighlightRegionType._("ENUM_CONSTANT");
|
| -
|
| - /**
|
| - * Only for version 1 of highlight.
|
| - */
|
| - static const HighlightRegionType FIELD = const HighlightRegionType._("FIELD");
|
| -
|
| - /**
|
| - * Only for version 1 of highlight.
|
| - */
|
| - static const HighlightRegionType FIELD_STATIC =
|
| - const HighlightRegionType._("FIELD_STATIC");
|
| -
|
| - /**
|
| - * Only for version 1 of highlight.
|
| - */
|
| - static const HighlightRegionType FUNCTION =
|
| - const HighlightRegionType._("FUNCTION");
|
| -
|
| - /**
|
| - * Only for version 1 of highlight.
|
| - */
|
| - static const HighlightRegionType FUNCTION_DECLARATION =
|
| - const HighlightRegionType._("FUNCTION_DECLARATION");
|
| -
|
| - static const HighlightRegionType FUNCTION_TYPE_ALIAS =
|
| - const HighlightRegionType._("FUNCTION_TYPE_ALIAS");
|
| -
|
| - /**
|
| - * Only for version 1 of highlight.
|
| - */
|
| - static const HighlightRegionType GETTER_DECLARATION =
|
| - const HighlightRegionType._("GETTER_DECLARATION");
|
| -
|
| - static const HighlightRegionType IDENTIFIER_DEFAULT =
|
| - const HighlightRegionType._("IDENTIFIER_DEFAULT");
|
| -
|
| - static const HighlightRegionType IMPORT_PREFIX =
|
| - const HighlightRegionType._("IMPORT_PREFIX");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType INSTANCE_FIELD_DECLARATION =
|
| - const HighlightRegionType._("INSTANCE_FIELD_DECLARATION");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType INSTANCE_FIELD_REFERENCE =
|
| - const HighlightRegionType._("INSTANCE_FIELD_REFERENCE");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType INSTANCE_GETTER_DECLARATION =
|
| - const HighlightRegionType._("INSTANCE_GETTER_DECLARATION");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType INSTANCE_GETTER_REFERENCE =
|
| - const HighlightRegionType._("INSTANCE_GETTER_REFERENCE");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType INSTANCE_METHOD_DECLARATION =
|
| - const HighlightRegionType._("INSTANCE_METHOD_DECLARATION");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType INSTANCE_METHOD_REFERENCE =
|
| - const HighlightRegionType._("INSTANCE_METHOD_REFERENCE");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType INSTANCE_SETTER_DECLARATION =
|
| - const HighlightRegionType._("INSTANCE_SETTER_DECLARATION");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType INSTANCE_SETTER_REFERENCE =
|
| - const HighlightRegionType._("INSTANCE_SETTER_REFERENCE");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType INVALID_STRING_ESCAPE =
|
| - const HighlightRegionType._("INVALID_STRING_ESCAPE");
|
| -
|
| - static const HighlightRegionType KEYWORD =
|
| - const HighlightRegionType._("KEYWORD");
|
| -
|
| - static const HighlightRegionType LABEL = const HighlightRegionType._("LABEL");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType LIBRARY_NAME =
|
| - const HighlightRegionType._("LIBRARY_NAME");
|
| -
|
| - static const HighlightRegionType LITERAL_BOOLEAN =
|
| - const HighlightRegionType._("LITERAL_BOOLEAN");
|
| -
|
| - static const HighlightRegionType LITERAL_DOUBLE =
|
| - const HighlightRegionType._("LITERAL_DOUBLE");
|
| -
|
| - static const HighlightRegionType LITERAL_INTEGER =
|
| - const HighlightRegionType._("LITERAL_INTEGER");
|
| -
|
| - static const HighlightRegionType LITERAL_LIST =
|
| - const HighlightRegionType._("LITERAL_LIST");
|
| -
|
| - static const HighlightRegionType LITERAL_MAP =
|
| - const HighlightRegionType._("LITERAL_MAP");
|
| -
|
| - static const HighlightRegionType LITERAL_STRING =
|
| - const HighlightRegionType._("LITERAL_STRING");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType LOCAL_FUNCTION_DECLARATION =
|
| - const HighlightRegionType._("LOCAL_FUNCTION_DECLARATION");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType LOCAL_FUNCTION_REFERENCE =
|
| - const HighlightRegionType._("LOCAL_FUNCTION_REFERENCE");
|
| -
|
| - /**
|
| - * Only for version 1 of highlight.
|
| - */
|
| - static const HighlightRegionType LOCAL_VARIABLE =
|
| - const HighlightRegionType._("LOCAL_VARIABLE");
|
| -
|
| - static const HighlightRegionType LOCAL_VARIABLE_DECLARATION =
|
| - const HighlightRegionType._("LOCAL_VARIABLE_DECLARATION");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType LOCAL_VARIABLE_REFERENCE =
|
| - const HighlightRegionType._("LOCAL_VARIABLE_REFERENCE");
|
| -
|
| - /**
|
| - * Only for version 1 of highlight.
|
| - */
|
| - static const HighlightRegionType METHOD =
|
| - const HighlightRegionType._("METHOD");
|
| -
|
| - /**
|
| - * Only for version 1 of highlight.
|
| - */
|
| - static const HighlightRegionType METHOD_DECLARATION =
|
| - const HighlightRegionType._("METHOD_DECLARATION");
|
| -
|
| - /**
|
| - * Only for version 1 of highlight.
|
| - */
|
| - static const HighlightRegionType METHOD_DECLARATION_STATIC =
|
| - const HighlightRegionType._("METHOD_DECLARATION_STATIC");
|
| -
|
| - /**
|
| - * Only for version 1 of highlight.
|
| - */
|
| - static const HighlightRegionType METHOD_STATIC =
|
| - const HighlightRegionType._("METHOD_STATIC");
|
| -
|
| - /**
|
| - * Only for version 1 of highlight.
|
| - */
|
| - static const HighlightRegionType PARAMETER =
|
| - const HighlightRegionType._("PARAMETER");
|
| -
|
| - /**
|
| - * Only for version 1 of highlight.
|
| - */
|
| - static const HighlightRegionType SETTER_DECLARATION =
|
| - const HighlightRegionType._("SETTER_DECLARATION");
|
| -
|
| - /**
|
| - * Only for version 1 of highlight.
|
| - */
|
| - static const HighlightRegionType TOP_LEVEL_VARIABLE =
|
| - const HighlightRegionType._("TOP_LEVEL_VARIABLE");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType PARAMETER_DECLARATION =
|
| - const HighlightRegionType._("PARAMETER_DECLARATION");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType PARAMETER_REFERENCE =
|
| - const HighlightRegionType._("PARAMETER_REFERENCE");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType STATIC_FIELD_DECLARATION =
|
| - const HighlightRegionType._("STATIC_FIELD_DECLARATION");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType STATIC_GETTER_DECLARATION =
|
| - const HighlightRegionType._("STATIC_GETTER_DECLARATION");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType STATIC_GETTER_REFERENCE =
|
| - const HighlightRegionType._("STATIC_GETTER_REFERENCE");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType STATIC_METHOD_DECLARATION =
|
| - const HighlightRegionType._("STATIC_METHOD_DECLARATION");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType STATIC_METHOD_REFERENCE =
|
| - const HighlightRegionType._("STATIC_METHOD_REFERENCE");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType STATIC_SETTER_DECLARATION =
|
| - const HighlightRegionType._("STATIC_SETTER_DECLARATION");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType STATIC_SETTER_REFERENCE =
|
| - const HighlightRegionType._("STATIC_SETTER_REFERENCE");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType TOP_LEVEL_FUNCTION_DECLARATION =
|
| - const HighlightRegionType._("TOP_LEVEL_FUNCTION_DECLARATION");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType TOP_LEVEL_FUNCTION_REFERENCE =
|
| - const HighlightRegionType._("TOP_LEVEL_FUNCTION_REFERENCE");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType TOP_LEVEL_GETTER_DECLARATION =
|
| - const HighlightRegionType._("TOP_LEVEL_GETTER_DECLARATION");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType TOP_LEVEL_GETTER_REFERENCE =
|
| - const HighlightRegionType._("TOP_LEVEL_GETTER_REFERENCE");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType TOP_LEVEL_SETTER_DECLARATION =
|
| - const HighlightRegionType._("TOP_LEVEL_SETTER_DECLARATION");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType TOP_LEVEL_SETTER_REFERENCE =
|
| - const HighlightRegionType._("TOP_LEVEL_SETTER_REFERENCE");
|
| -
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType TOP_LEVEL_VARIABLE_DECLARATION =
|
| - const HighlightRegionType._("TOP_LEVEL_VARIABLE_DECLARATION");
|
| + int hash = 0;
|
| + hash = JenkinsSmiHash.combine(hash, file.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, kind.hashCode);
|
| + return JenkinsSmiHash.finish(hash);
|
| + }
|
| +}
|
|
|
| - static const HighlightRegionType TYPE_NAME_DYNAMIC =
|
| - const HighlightRegionType._("TYPE_NAME_DYNAMIC");
|
| +/**
|
| + * ExecutableKind
|
| + *
|
| + * enum {
|
| + * CLIENT
|
| + * EITHER
|
| + * NOT_EXECUTABLE
|
| + * SERVER
|
| + * }
|
| + *
|
| + * Clients may not extend, implement or mix-in this class.
|
| + */
|
| +class ExecutableKind implements Enum {
|
| + static const ExecutableKind CLIENT = const ExecutableKind._("CLIENT");
|
|
|
| - static const HighlightRegionType TYPE_PARAMETER =
|
| - const HighlightRegionType._("TYPE_PARAMETER");
|
| + static const ExecutableKind EITHER = const ExecutableKind._("EITHER");
|
|
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType UNRESOLVED_INSTANCE_MEMBER_REFERENCE =
|
| - const HighlightRegionType._("UNRESOLVED_INSTANCE_MEMBER_REFERENCE");
|
| + static const ExecutableKind NOT_EXECUTABLE =
|
| + const ExecutableKind._("NOT_EXECUTABLE");
|
|
|
| - /**
|
| - * Only for version 2 of highlight.
|
| - */
|
| - static const HighlightRegionType VALID_STRING_ESCAPE =
|
| - const HighlightRegionType._("VALID_STRING_ESCAPE");
|
| + static const ExecutableKind SERVER = const ExecutableKind._("SERVER");
|
|
|
| /**
|
| * A list containing all of the enum values that are defined.
|
| */
|
| - static const List<HighlightRegionType> VALUES = const <HighlightRegionType>[
|
| - ANNOTATION,
|
| - BUILT_IN,
|
| - CLASS,
|
| - COMMENT_BLOCK,
|
| - COMMENT_DOCUMENTATION,
|
| - COMMENT_END_OF_LINE,
|
| - CONSTRUCTOR,
|
| - DIRECTIVE,
|
| - DYNAMIC_TYPE,
|
| - DYNAMIC_LOCAL_VARIABLE_DECLARATION,
|
| - DYNAMIC_LOCAL_VARIABLE_REFERENCE,
|
| - DYNAMIC_PARAMETER_DECLARATION,
|
| - DYNAMIC_PARAMETER_REFERENCE,
|
| - ENUM,
|
| - ENUM_CONSTANT,
|
| - FIELD,
|
| - FIELD_STATIC,
|
| - FUNCTION,
|
| - FUNCTION_DECLARATION,
|
| - FUNCTION_TYPE_ALIAS,
|
| - GETTER_DECLARATION,
|
| - IDENTIFIER_DEFAULT,
|
| - IMPORT_PREFIX,
|
| - INSTANCE_FIELD_DECLARATION,
|
| - INSTANCE_FIELD_REFERENCE,
|
| - INSTANCE_GETTER_DECLARATION,
|
| - INSTANCE_GETTER_REFERENCE,
|
| - INSTANCE_METHOD_DECLARATION,
|
| - INSTANCE_METHOD_REFERENCE,
|
| - INSTANCE_SETTER_DECLARATION,
|
| - INSTANCE_SETTER_REFERENCE,
|
| - INVALID_STRING_ESCAPE,
|
| - KEYWORD,
|
| - LABEL,
|
| - LIBRARY_NAME,
|
| - LITERAL_BOOLEAN,
|
| - LITERAL_DOUBLE,
|
| - LITERAL_INTEGER,
|
| - LITERAL_LIST,
|
| - LITERAL_MAP,
|
| - LITERAL_STRING,
|
| - LOCAL_FUNCTION_DECLARATION,
|
| - LOCAL_FUNCTION_REFERENCE,
|
| - LOCAL_VARIABLE,
|
| - LOCAL_VARIABLE_DECLARATION,
|
| - LOCAL_VARIABLE_REFERENCE,
|
| - METHOD,
|
| - METHOD_DECLARATION,
|
| - METHOD_DECLARATION_STATIC,
|
| - METHOD_STATIC,
|
| - PARAMETER,
|
| - SETTER_DECLARATION,
|
| - TOP_LEVEL_VARIABLE,
|
| - PARAMETER_DECLARATION,
|
| - PARAMETER_REFERENCE,
|
| - STATIC_FIELD_DECLARATION,
|
| - STATIC_GETTER_DECLARATION,
|
| - STATIC_GETTER_REFERENCE,
|
| - STATIC_METHOD_DECLARATION,
|
| - STATIC_METHOD_REFERENCE,
|
| - STATIC_SETTER_DECLARATION,
|
| - STATIC_SETTER_REFERENCE,
|
| - TOP_LEVEL_FUNCTION_DECLARATION,
|
| - TOP_LEVEL_FUNCTION_REFERENCE,
|
| - TOP_LEVEL_GETTER_DECLARATION,
|
| - TOP_LEVEL_GETTER_REFERENCE,
|
| - TOP_LEVEL_SETTER_DECLARATION,
|
| - TOP_LEVEL_SETTER_REFERENCE,
|
| - TOP_LEVEL_VARIABLE_DECLARATION,
|
| - TYPE_NAME_DYNAMIC,
|
| - TYPE_PARAMETER,
|
| - UNRESOLVED_INSTANCE_MEMBER_REFERENCE,
|
| - VALID_STRING_ESCAPE
|
| + static const List<ExecutableKind> VALUES = const <ExecutableKind>[
|
| + CLIENT,
|
| + EITHER,
|
| + NOT_EXECUTABLE,
|
| + SERVER
|
| ];
|
|
|
| @override
|
| final String name;
|
|
|
| - const HighlightRegionType._(this.name);
|
| + const ExecutableKind._(this.name);
|
|
|
| - factory HighlightRegionType(String name) {
|
| + factory ExecutableKind(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 "DYNAMIC_LOCAL_VARIABLE_DECLARATION":
|
| - return DYNAMIC_LOCAL_VARIABLE_DECLARATION;
|
| - case "DYNAMIC_LOCAL_VARIABLE_REFERENCE":
|
| - return DYNAMIC_LOCAL_VARIABLE_REFERENCE;
|
| - case "DYNAMIC_PARAMETER_DECLARATION":
|
| - return DYNAMIC_PARAMETER_DECLARATION;
|
| - case "DYNAMIC_PARAMETER_REFERENCE":
|
| - return DYNAMIC_PARAMETER_REFERENCE;
|
| - case "ENUM":
|
| - return ENUM;
|
| - case "ENUM_CONSTANT":
|
| - return ENUM_CONSTANT;
|
| - 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 "INSTANCE_FIELD_DECLARATION":
|
| - return INSTANCE_FIELD_DECLARATION;
|
| - case "INSTANCE_FIELD_REFERENCE":
|
| - return INSTANCE_FIELD_REFERENCE;
|
| - case "INSTANCE_GETTER_DECLARATION":
|
| - return INSTANCE_GETTER_DECLARATION;
|
| - case "INSTANCE_GETTER_REFERENCE":
|
| - return INSTANCE_GETTER_REFERENCE;
|
| - case "INSTANCE_METHOD_DECLARATION":
|
| - return INSTANCE_METHOD_DECLARATION;
|
| - case "INSTANCE_METHOD_REFERENCE":
|
| - return INSTANCE_METHOD_REFERENCE;
|
| - case "INSTANCE_SETTER_DECLARATION":
|
| - return INSTANCE_SETTER_DECLARATION;
|
| - case "INSTANCE_SETTER_REFERENCE":
|
| - return INSTANCE_SETTER_REFERENCE;
|
| - case "INVALID_STRING_ESCAPE":
|
| - return INVALID_STRING_ESCAPE;
|
| - case "KEYWORD":
|
| - return KEYWORD;
|
| - case "LABEL":
|
| - return LABEL;
|
| - case "LIBRARY_NAME":
|
| - return LIBRARY_NAME;
|
| - 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_FUNCTION_DECLARATION":
|
| - return LOCAL_FUNCTION_DECLARATION;
|
| - case "LOCAL_FUNCTION_REFERENCE":
|
| - return LOCAL_FUNCTION_REFERENCE;
|
| - case "LOCAL_VARIABLE":
|
| - return LOCAL_VARIABLE;
|
| - case "LOCAL_VARIABLE_DECLARATION":
|
| - return LOCAL_VARIABLE_DECLARATION;
|
| - case "LOCAL_VARIABLE_REFERENCE":
|
| - return LOCAL_VARIABLE_REFERENCE;
|
| - 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 "PARAMETER_DECLARATION":
|
| - return PARAMETER_DECLARATION;
|
| - case "PARAMETER_REFERENCE":
|
| - return PARAMETER_REFERENCE;
|
| - case "STATIC_FIELD_DECLARATION":
|
| - return STATIC_FIELD_DECLARATION;
|
| - case "STATIC_GETTER_DECLARATION":
|
| - return STATIC_GETTER_DECLARATION;
|
| - case "STATIC_GETTER_REFERENCE":
|
| - return STATIC_GETTER_REFERENCE;
|
| - case "STATIC_METHOD_DECLARATION":
|
| - return STATIC_METHOD_DECLARATION;
|
| - case "STATIC_METHOD_REFERENCE":
|
| - return STATIC_METHOD_REFERENCE;
|
| - case "STATIC_SETTER_DECLARATION":
|
| - return STATIC_SETTER_DECLARATION;
|
| - case "STATIC_SETTER_REFERENCE":
|
| - return STATIC_SETTER_REFERENCE;
|
| - case "TOP_LEVEL_FUNCTION_DECLARATION":
|
| - return TOP_LEVEL_FUNCTION_DECLARATION;
|
| - case "TOP_LEVEL_FUNCTION_REFERENCE":
|
| - return TOP_LEVEL_FUNCTION_REFERENCE;
|
| - case "TOP_LEVEL_GETTER_DECLARATION":
|
| - return TOP_LEVEL_GETTER_DECLARATION;
|
| - case "TOP_LEVEL_GETTER_REFERENCE":
|
| - return TOP_LEVEL_GETTER_REFERENCE;
|
| - case "TOP_LEVEL_SETTER_DECLARATION":
|
| - return TOP_LEVEL_SETTER_DECLARATION;
|
| - case "TOP_LEVEL_SETTER_REFERENCE":
|
| - return TOP_LEVEL_SETTER_REFERENCE;
|
| - case "TOP_LEVEL_VARIABLE_DECLARATION":
|
| - return TOP_LEVEL_VARIABLE_DECLARATION;
|
| - case "TYPE_NAME_DYNAMIC":
|
| - return TYPE_NAME_DYNAMIC;
|
| - case "TYPE_PARAMETER":
|
| - return TYPE_PARAMETER;
|
| - case "UNRESOLVED_INSTANCE_MEMBER_REFERENCE":
|
| - return UNRESOLVED_INSTANCE_MEMBER_REFERENCE;
|
| - case "VALID_STRING_ESCAPE":
|
| - return VALID_STRING_ESCAPE;
|
| + case "CLIENT":
|
| + return CLIENT;
|
| + case "EITHER":
|
| + return EITHER;
|
| + case "NOT_EXECUTABLE":
|
| + return NOT_EXECUTABLE;
|
| + case "SERVER":
|
| + return SERVER;
|
| }
|
| throw new Exception('Illegal enum value: $name');
|
| }
|
|
|
| - factory HighlightRegionType.fromJson(
|
| + factory ExecutableKind.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json is String) {
|
| try {
|
| - return new HighlightRegionType(json);
|
| + return new ExecutableKind(json);
|
| } catch (_) {
|
| // Fall through
|
| }
|
| }
|
| - throw jsonDecoder.mismatch(jsonPath, "HighlightRegionType", json);
|
| + throw jsonDecoder.mismatch(jsonPath, "ExecutableKind", json);
|
| }
|
|
|
| @override
|
| - String toString() => "HighlightRegionType.$name";
|
| + String toString() => "ExecutableKind.$name";
|
|
|
| String toJson() => name;
|
| }
|
|
|
| /**
|
| - * HoverInformation
|
| + * execution.createContext params
|
| *
|
| * {
|
| - * "offset": int
|
| - * "length": int
|
| - * "containingLibraryPath": optional String
|
| - * "containingLibraryName": optional String
|
| - * "containingClassDescription": optional String
|
| - * "dartdoc": optional String
|
| - * "elementDescription": optional String
|
| - * "elementKind": optional String
|
| - * "isDeprecated": optional bool
|
| - * "parameter": optional String
|
| - * "propagatedType": optional String
|
| - * "staticType": optional String
|
| + * "contextRoot": FilePath
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class HoverInformation implements HasToJson {
|
| - int _offset;
|
| +class ExecutionCreateContextParams implements RequestParams {
|
| + String _contextRoot;
|
|
|
| - int _length;
|
| + /**
|
| + * The path of the Dart or HTML file that will be launched, or the path of
|
| + * the directory containing the file.
|
| + */
|
| + String get contextRoot => _contextRoot;
|
|
|
| - String _containingLibraryPath;
|
| + /**
|
| + * The path of the Dart or HTML file that will be launched, or the path of
|
| + * the directory containing the file.
|
| + */
|
| + void set contextRoot(String value) {
|
| + assert(value != null);
|
| + this._contextRoot = value;
|
| + }
|
|
|
| - String _containingLibraryName;
|
| + ExecutionCreateContextParams(String contextRoot) {
|
| + this.contextRoot = contextRoot;
|
| + }
|
|
|
| - String _containingClassDescription;
|
| + factory ExecutionCreateContextParams.fromJson(
|
| + JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| + if (json == null) {
|
| + json = {};
|
| + }
|
| + if (json is Map) {
|
| + String contextRoot;
|
| + if (json.containsKey("contextRoot")) {
|
| + contextRoot = jsonDecoder.decodeString(
|
| + jsonPath + ".contextRoot", json["contextRoot"]);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "contextRoot");
|
| + }
|
| + return new ExecutionCreateContextParams(contextRoot);
|
| + } else {
|
| + throw jsonDecoder.mismatch(
|
| + jsonPath, "execution.createContext params", json);
|
| + }
|
| + }
|
|
|
| - String _dartdoc;
|
| + factory ExecutionCreateContextParams.fromRequest(Request request) {
|
| + return new ExecutionCreateContextParams.fromJson(
|
| + new RequestDecoder(request), "params", request.params);
|
| + }
|
|
|
| - String _elementDescription;
|
| + @override
|
| + Map<String, dynamic> toJson() {
|
| + Map<String, dynamic> result = {};
|
| + result["contextRoot"] = contextRoot;
|
| + return result;
|
| + }
|
|
|
| - String _elementKind;
|
| + @override
|
| + Request toRequest(String id) {
|
| + return new Request(id, "execution.createContext", toJson());
|
| + }
|
|
|
| - bool _isDeprecated;
|
| + @override
|
| + String toString() => JSON.encode(toJson());
|
|
|
| - String _parameter;
|
| + @override
|
| + bool operator ==(other) {
|
| + if (other is ExecutionCreateContextParams) {
|
| + return contextRoot == other.contextRoot;
|
| + }
|
| + return false;
|
| + }
|
|
|
| - String _propagatedType;
|
| + @override
|
| + int get hashCode {
|
| + int hash = 0;
|
| + hash = JenkinsSmiHash.combine(hash, contextRoot.hashCode);
|
| + return JenkinsSmiHash.finish(hash);
|
| + }
|
| +}
|
|
|
| - String _staticType;
|
| +/**
|
| + * execution.createContext result
|
| + *
|
| + * {
|
| + * "id": ExecutionContextId
|
| + * }
|
| + *
|
| + * Clients may not extend, implement or mix-in this class.
|
| + */
|
| +class ExecutionCreateContextResult implements ResponseResult {
|
| + String _id;
|
|
|
| /**
|
| - * The offset of the range of characters that encompasses the cursor position
|
| - * and has the same hover information as the cursor position.
|
| + * The identifier used to refer to the execution context that was created.
|
| */
|
| - int get offset => _offset;
|
| + String get id => _id;
|
|
|
| /**
|
| - * The offset of the range of characters that encompasses the cursor position
|
| - * and has the same hover information as the cursor position.
|
| + * The identifier used to refer to the execution context that was created.
|
| */
|
| - void set offset(int value) {
|
| + void set id(String value) {
|
| assert(value != null);
|
| - this._offset = value;
|
| + this._id = value;
|
| }
|
|
|
| - /**
|
| - * The length of the range of characters that encompasses the cursor position
|
| - * and has the same hover information as the cursor position.
|
| - */
|
| - int get length => _length;
|
| + ExecutionCreateContextResult(String id) {
|
| + this.id = id;
|
| + }
|
|
|
| - /**
|
| - * The length of the range of characters that encompasses the cursor position
|
| - * and has the same hover information as the cursor position.
|
| - */
|
| - void set length(int value) {
|
| - assert(value != null);
|
| - this._length = value;
|
| + factory ExecutionCreateContextResult.fromJson(
|
| + JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| + if (json == null) {
|
| + json = {};
|
| + }
|
| + if (json is Map) {
|
| + String id;
|
| + if (json.containsKey("id")) {
|
| + id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "id");
|
| + }
|
| + return new ExecutionCreateContextResult(id);
|
| + } else {
|
| + throw jsonDecoder.mismatch(
|
| + jsonPath, "execution.createContext result", json);
|
| + }
|
| }
|
|
|
| - /**
|
| - * 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, or if the element is declared inside an HTML file.
|
| - */
|
| - String get containingLibraryPath => _containingLibraryPath;
|
| + factory ExecutionCreateContextResult.fromResponse(Response response) {
|
| + return new ExecutionCreateContextResult.fromJson(
|
| + new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)),
|
| + "result",
|
| + response.result);
|
| + }
|
|
|
| - /**
|
| - * 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, or if the element is declared inside an HTML file.
|
| - */
|
| - void set containingLibraryPath(String value) {
|
| - this._containingLibraryPath = value;
|
| + @override
|
| + Map<String, dynamic> toJson() {
|
| + Map<String, dynamic> result = {};
|
| + result["id"] = id;
|
| + return result;
|
| + }
|
| +
|
| + @override
|
| + Response toResponse(String id) {
|
| + return new Response(id, result: toJson());
|
| + }
|
| +
|
| + @override
|
| + String toString() => JSON.encode(toJson());
|
| +
|
| + @override
|
| + bool operator ==(other) {
|
| + if (other is ExecutionCreateContextResult) {
|
| + return id == other.id;
|
| + }
|
| + return false;
|
| + }
|
| +
|
| + @override
|
| + int get hashCode {
|
| + int hash = 0;
|
| + hash = JenkinsSmiHash.combine(hash, id.hashCode);
|
| + return JenkinsSmiHash.finish(hash);
|
| }
|
| +}
|
| +
|
| +/**
|
| + * execution.deleteContext params
|
| + *
|
| + * {
|
| + * "id": ExecutionContextId
|
| + * }
|
| + *
|
| + * Clients may not extend, implement or mix-in this class.
|
| + */
|
| +class ExecutionDeleteContextParams implements RequestParams {
|
| + String _id;
|
|
|
| /**
|
| - * The name of the library in which the referenced element is declared. This
|
| - * data is omitted if there is no referenced element, or if the element is
|
| - * declared inside an HTML file.
|
| + * The identifier of the execution context that is to be deleted.
|
| */
|
| - String get containingLibraryName => _containingLibraryName;
|
| + String get id => _id;
|
|
|
| /**
|
| - * The name of the library in which the referenced element is declared. This
|
| - * data is omitted if there is no referenced element, or if the element is
|
| - * declared inside an HTML file.
|
| + * The identifier of the execution context that is to be deleted.
|
| */
|
| - void set containingLibraryName(String value) {
|
| - this._containingLibraryName = value;
|
| + void set id(String value) {
|
| + assert(value != null);
|
| + this._id = value;
|
| }
|
|
|
| - /**
|
| - * A human-readable description of the class declaring the element being
|
| - * referenced. This data is omitted if there is no referenced element, or if
|
| - * the element is not a class member.
|
| - */
|
| - String get containingClassDescription => _containingClassDescription;
|
| + ExecutionDeleteContextParams(String id) {
|
| + this.id = id;
|
| + }
|
|
|
| - /**
|
| - * A human-readable description of the class declaring the element being
|
| - * referenced. This data is omitted if there is no referenced element, or if
|
| - * the element is not a class member.
|
| - */
|
| - void set containingClassDescription(String value) {
|
| - this._containingClassDescription = value;
|
| + factory ExecutionDeleteContextParams.fromJson(
|
| + JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| + if (json == null) {
|
| + json = {};
|
| + }
|
| + if (json is Map) {
|
| + String id;
|
| + if (json.containsKey("id")) {
|
| + id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "id");
|
| + }
|
| + return new ExecutionDeleteContextParams(id);
|
| + } else {
|
| + throw jsonDecoder.mismatch(
|
| + jsonPath, "execution.deleteContext params", json);
|
| + }
|
| }
|
|
|
| - /**
|
| - * 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, or if the element has no dartdoc.
|
| - */
|
| - String get dartdoc => _dartdoc;
|
| + factory ExecutionDeleteContextParams.fromRequest(Request request) {
|
| + return new ExecutionDeleteContextParams.fromJson(
|
| + new RequestDecoder(request), "params", request.params);
|
| + }
|
|
|
| - /**
|
| - * 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, or if the element has no dartdoc.
|
| - */
|
| - void set dartdoc(String value) {
|
| - this._dartdoc = value;
|
| + @override
|
| + Map<String, dynamic> toJson() {
|
| + Map<String, dynamic> result = {};
|
| + result["id"] = id;
|
| + return result;
|
| }
|
|
|
| - /**
|
| - * A human-readable description of the element being referenced. This data is
|
| - * omitted if there is no referenced element.
|
| - */
|
| - String get elementDescription => _elementDescription;
|
| + @override
|
| + Request toRequest(String id) {
|
| + return new Request(id, "execution.deleteContext", toJson());
|
| + }
|
|
|
| - /**
|
| - * A human-readable description of the element being referenced. This data is
|
| - * omitted if there is no referenced element.
|
| - */
|
| - void set elementDescription(String value) {
|
| - this._elementDescription = value;
|
| + @override
|
| + String toString() => JSON.encode(toJson());
|
| +
|
| + @override
|
| + bool operator ==(other) {
|
| + if (other is ExecutionDeleteContextParams) {
|
| + return id == other.id;
|
| + }
|
| + return false;
|
| }
|
|
|
| - /**
|
| - * 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.
|
| - */
|
| - String get elementKind => _elementKind;
|
| + @override
|
| + int get hashCode {
|
| + int hash = 0;
|
| + hash = JenkinsSmiHash.combine(hash, id.hashCode);
|
| + return JenkinsSmiHash.finish(hash);
|
| + }
|
| +}
|
|
|
| - /**
|
| - * 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.
|
| - */
|
| - void set elementKind(String value) {
|
| - this._elementKind = value;
|
| +/**
|
| + * execution.deleteContext result
|
| + *
|
| + * Clients may not extend, implement or mix-in this class.
|
| + */
|
| +class ExecutionDeleteContextResult implements ResponseResult {
|
| + @override
|
| + Map<String, dynamic> toJson() => <String, dynamic>{};
|
| +
|
| + @override
|
| + Response toResponse(String id) {
|
| + return new Response(id, result: null);
|
| }
|
|
|
| - /**
|
| - * True if the referenced element is deprecated.
|
| - */
|
| - bool get isDeprecated => _isDeprecated;
|
| + @override
|
| + bool operator ==(other) {
|
| + if (other is ExecutionDeleteContextResult) {
|
| + return true;
|
| + }
|
| + return false;
|
| + }
|
|
|
| - /**
|
| - * True if the referenced element is deprecated.
|
| - */
|
| - void set isDeprecated(bool value) {
|
| - this._isDeprecated = value;
|
| + @override
|
| + int get hashCode {
|
| + return 479954425;
|
| }
|
| +}
|
| +
|
| +/**
|
| + * execution.launchData params
|
| + *
|
| + * {
|
| + * "file": FilePath
|
| + * "kind": optional ExecutableKind
|
| + * "referencedFiles": optional List<FilePath>
|
| + * }
|
| + *
|
| + * Clients may not extend, implement or mix-in this class.
|
| + */
|
| +class ExecutionLaunchDataParams implements HasToJson {
|
| + String _file;
|
| +
|
| + ExecutableKind _kind;
|
| +
|
| + List<String> _referencedFiles;
|
|
|
| /**
|
| - * 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.
|
| + * The file for which launch data is being provided. This will either be a
|
| + * Dart library or an HTML file.
|
| */
|
| - String get parameter => _parameter;
|
| + String get file => _file;
|
|
|
| /**
|
| - * 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.
|
| + * The file for which launch data is being provided. This will either be a
|
| + * Dart library or an HTML file.
|
| */
|
| - void set parameter(String value) {
|
| - this._parameter = value;
|
| + void set file(String value) {
|
| + assert(value != null);
|
| + this._file = value;
|
| }
|
|
|
| /**
|
| - * 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.
|
| + * The kind of the executable file. This field is omitted if the file is not
|
| + * a Dart file.
|
| */
|
| - String get propagatedType => _propagatedType;
|
| + ExecutableKind get kind => _kind;
|
|
|
| /**
|
| - * 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.
|
| + * The kind of the executable file. This field is omitted if the file is not
|
| + * a Dart file.
|
| */
|
| - void set propagatedType(String value) {
|
| - this._propagatedType = value;
|
| + void set kind(ExecutableKind value) {
|
| + this._kind = value;
|
| }
|
|
|
| /**
|
| - * The name of the static type of the expression. This data is omitted if the
|
| - * location does not correspond to an expression.
|
| + * A list of the Dart files that are referenced by the file. This field is
|
| + * omitted if the file is not an HTML file.
|
| */
|
| - String get staticType => _staticType;
|
| + List<String> get referencedFiles => _referencedFiles;
|
|
|
| /**
|
| - * The name of the static type of the expression. This data is omitted if the
|
| - * location does not correspond to an expression.
|
| + * A list of the Dart files that are referenced by the file. This field is
|
| + * omitted if the file is not an HTML file.
|
| */
|
| - void set staticType(String value) {
|
| - this._staticType = value;
|
| + void set referencedFiles(List<String> value) {
|
| + this._referencedFiles = value;
|
| }
|
|
|
| - HoverInformation(int offset, int length,
|
| - {String containingLibraryPath,
|
| - String containingLibraryName,
|
| - String containingClassDescription,
|
| - String dartdoc,
|
| - String elementDescription,
|
| - String elementKind,
|
| - bool isDeprecated,
|
| - String parameter,
|
| - String propagatedType,
|
| - String staticType}) {
|
| - this.offset = offset;
|
| - this.length = length;
|
| - this.containingLibraryPath = containingLibraryPath;
|
| - this.containingLibraryName = containingLibraryName;
|
| - this.containingClassDescription = containingClassDescription;
|
| - this.dartdoc = dartdoc;
|
| - this.elementDescription = elementDescription;
|
| - this.elementKind = elementKind;
|
| - this.isDeprecated = isDeprecated;
|
| - this.parameter = parameter;
|
| - this.propagatedType = propagatedType;
|
| - this.staticType = staticType;
|
| + ExecutionLaunchDataParams(String file,
|
| + {ExecutableKind kind, List<String> referencedFiles}) {
|
| + this.file = file;
|
| + this.kind = kind;
|
| + this.referencedFiles = referencedFiles;
|
| }
|
|
|
| - factory HoverInformation.fromJson(
|
| + factory ExecutionLaunchDataParams.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - int offset;
|
| - if (json.containsKey("offset")) {
|
| - offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "offset");
|
| - }
|
| - int length;
|
| - if (json.containsKey("length")) {
|
| - length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
|
| + json = {};
|
| + }
|
| + if (json is Map) {
|
| + String file;
|
| + if (json.containsKey("file")) {
|
| + file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "length");
|
| - }
|
| - String containingLibraryPath;
|
| - if (json.containsKey("containingLibraryPath")) {
|
| - containingLibraryPath = jsonDecoder.decodeString(
|
| - jsonPath + ".containingLibraryPath", json["containingLibraryPath"]);
|
| - }
|
| - String containingLibraryName;
|
| - if (json.containsKey("containingLibraryName")) {
|
| - containingLibraryName = jsonDecoder.decodeString(
|
| - jsonPath + ".containingLibraryName", json["containingLibraryName"]);
|
| - }
|
| - String containingClassDescription;
|
| - if (json.containsKey("containingClassDescription")) {
|
| - containingClassDescription = jsonDecoder.decodeString(
|
| - jsonPath + ".containingClassDescription",
|
| - json["containingClassDescription"]);
|
| - }
|
| - String dartdoc;
|
| - if (json.containsKey("dartdoc")) {
|
| - dartdoc =
|
| - jsonDecoder.decodeString(jsonPath + ".dartdoc", json["dartdoc"]);
|
| - }
|
| - String elementDescription;
|
| - if (json.containsKey("elementDescription")) {
|
| - elementDescription = jsonDecoder.decodeString(
|
| - jsonPath + ".elementDescription", json["elementDescription"]);
|
| - }
|
| - String elementKind;
|
| - if (json.containsKey("elementKind")) {
|
| - elementKind = jsonDecoder.decodeString(
|
| - jsonPath + ".elementKind", json["elementKind"]);
|
| - }
|
| - bool isDeprecated;
|
| - if (json.containsKey("isDeprecated")) {
|
| - isDeprecated = jsonDecoder.decodeBool(
|
| - jsonPath + ".isDeprecated", json["isDeprecated"]);
|
| - }
|
| - String parameter;
|
| - if (json.containsKey("parameter")) {
|
| - parameter = jsonDecoder.decodeString(
|
| - jsonPath + ".parameter", json["parameter"]);
|
| + throw jsonDecoder.mismatch(jsonPath, "file");
|
| }
|
| - String propagatedType;
|
| - if (json.containsKey("propagatedType")) {
|
| - propagatedType = jsonDecoder.decodeString(
|
| - jsonPath + ".propagatedType", json["propagatedType"]);
|
| + ExecutableKind kind;
|
| + if (json.containsKey("kind")) {
|
| + kind = new ExecutableKind.fromJson(
|
| + jsonDecoder, jsonPath + ".kind", json["kind"]);
|
| }
|
| - String staticType;
|
| - if (json.containsKey("staticType")) {
|
| - staticType = jsonDecoder.decodeString(
|
| - jsonPath + ".staticType", json["staticType"]);
|
| + List<String> referencedFiles;
|
| + if (json.containsKey("referencedFiles")) {
|
| + referencedFiles = jsonDecoder.decodeList(jsonPath + ".referencedFiles",
|
| + json["referencedFiles"], jsonDecoder.decodeString);
|
| }
|
| - return new HoverInformation(offset, length,
|
| - containingLibraryPath: containingLibraryPath,
|
| - containingLibraryName: containingLibraryName,
|
| - containingClassDescription: containingClassDescription,
|
| - dartdoc: dartdoc,
|
| - elementDescription: elementDescription,
|
| - elementKind: elementKind,
|
| - isDeprecated: isDeprecated,
|
| - parameter: parameter,
|
| - propagatedType: propagatedType,
|
| - staticType: staticType);
|
| + return new ExecutionLaunchDataParams(file,
|
| + kind: kind, referencedFiles: referencedFiles);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "HoverInformation", json);
|
| + throw jsonDecoder.mismatch(jsonPath, "execution.launchData params", json);
|
| }
|
| }
|
|
|
| + factory ExecutionLaunchDataParams.fromNotification(
|
| + Notification notification) {
|
| + return new ExecutionLaunchDataParams.fromJson(
|
| + new ResponseDecoder(null), "params", notification.params);
|
| + }
|
| +
|
| @override
|
| 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 (containingClassDescription != null) {
|
| - result["containingClassDescription"] = containingClassDescription;
|
| - }
|
| - if (dartdoc != null) {
|
| - result["dartdoc"] = dartdoc;
|
| - }
|
| - if (elementDescription != null) {
|
| - result["elementDescription"] = elementDescription;
|
| - }
|
| - if (elementKind != null) {
|
| - result["elementKind"] = elementKind;
|
| - }
|
| - if (isDeprecated != null) {
|
| - result["isDeprecated"] = isDeprecated;
|
| - }
|
| - if (parameter != null) {
|
| - result["parameter"] = parameter;
|
| - }
|
| - if (propagatedType != null) {
|
| - result["propagatedType"] = propagatedType;
|
| + result["file"] = file;
|
| + if (kind != null) {
|
| + result["kind"] = kind.toJson();
|
| }
|
| - if (staticType != null) {
|
| - result["staticType"] = staticType;
|
| + if (referencedFiles != null) {
|
| + result["referencedFiles"] = referencedFiles;
|
| }
|
| return result;
|
| }
|
|
|
| + Notification toNotification() {
|
| + return new Notification("execution.launchData", toJson());
|
| + }
|
| +
|
| @override
|
| String toString() => JSON.encode(toJson());
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is HoverInformation) {
|
| - return offset == other.offset &&
|
| - length == other.length &&
|
| - containingLibraryPath == other.containingLibraryPath &&
|
| - containingLibraryName == other.containingLibraryName &&
|
| - containingClassDescription == other.containingClassDescription &&
|
| - dartdoc == other.dartdoc &&
|
| - elementDescription == other.elementDescription &&
|
| - elementKind == other.elementKind &&
|
| - isDeprecated == other.isDeprecated &&
|
| - parameter == other.parameter &&
|
| - propagatedType == other.propagatedType &&
|
| - staticType == other.staticType;
|
| + if (other is ExecutionLaunchDataParams) {
|
| + return file == other.file &&
|
| + kind == other.kind &&
|
| + listEqual(referencedFiles, other.referencedFiles,
|
| + (String a, String b) => a == b);
|
| }
|
| return false;
|
| }
|
| @@ -12252,107 +7572,130 @@ class HoverInformation implements HasToJson {
|
| @override
|
| 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, containingClassDescription.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, dartdoc.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, elementDescription.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, elementKind.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, isDeprecated.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, parameter.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, propagatedType.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, staticType.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, file.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, kind.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, referencedFiles.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * ImplementedClass
|
| + * execution.mapUri params
|
| *
|
| * {
|
| - * "offset": int
|
| - * "length": int
|
| + * "id": ExecutionContextId
|
| + * "file": optional FilePath
|
| + * "uri": optional String
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class ImplementedClass implements HasToJson {
|
| - int _offset;
|
| +class ExecutionMapUriParams implements RequestParams {
|
| + String _id;
|
|
|
| - int _length;
|
| + String _file;
|
| +
|
| + String _uri;
|
|
|
| /**
|
| - * The offset of the name of the implemented class.
|
| + * The identifier of the execution context in which the URI is to be mapped.
|
| */
|
| - int get offset => _offset;
|
| + String get id => _id;
|
|
|
| /**
|
| - * The offset of the name of the implemented class.
|
| + * The identifier of the execution context in which the URI is to be mapped.
|
| */
|
| - void set offset(int value) {
|
| + void set id(String value) {
|
| assert(value != null);
|
| - this._offset = value;
|
| + this._id = value;
|
| }
|
|
|
| /**
|
| - * The length of the name of the implemented class.
|
| + * The path of the file to be mapped into a URI.
|
| */
|
| - int get length => _length;
|
| + String get file => _file;
|
|
|
| /**
|
| - * The length of the name of the implemented class.
|
| + * The path of the file to be mapped into a URI.
|
| */
|
| - void set length(int value) {
|
| - assert(value != null);
|
| - this._length = value;
|
| + void set file(String value) {
|
| + this._file = value;
|
| }
|
|
|
| - ImplementedClass(int offset, int length) {
|
| - this.offset = offset;
|
| - this.length = length;
|
| + /**
|
| + * The URI to be mapped into a file path.
|
| + */
|
| + String get uri => _uri;
|
| +
|
| + /**
|
| + * The URI to be mapped into a file path.
|
| + */
|
| + void set uri(String value) {
|
| + this._uri = value;
|
| }
|
|
|
| - factory ImplementedClass.fromJson(
|
| + ExecutionMapUriParams(String id, {String file, String uri}) {
|
| + this.id = id;
|
| + this.file = file;
|
| + this.uri = uri;
|
| + }
|
| +
|
| + factory ExecutionMapUriParams.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - int offset;
|
| - if (json.containsKey("offset")) {
|
| - offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
|
| + String id;
|
| + if (json.containsKey("id")) {
|
| + id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "offset");
|
| + throw jsonDecoder.mismatch(jsonPath, "id");
|
| }
|
| - int length;
|
| - if (json.containsKey("length")) {
|
| - length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "length");
|
| + String file;
|
| + if (json.containsKey("file")) {
|
| + file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
|
| }
|
| - return new ImplementedClass(offset, length);
|
| + String uri;
|
| + if (json.containsKey("uri")) {
|
| + uri = jsonDecoder.decodeString(jsonPath + ".uri", json["uri"]);
|
| + }
|
| + return new ExecutionMapUriParams(id, file: file, uri: uri);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "ImplementedClass", json);
|
| + throw jsonDecoder.mismatch(jsonPath, "execution.mapUri params", json);
|
| }
|
| }
|
|
|
| + factory ExecutionMapUriParams.fromRequest(Request request) {
|
| + return new ExecutionMapUriParams.fromJson(
|
| + new RequestDecoder(request), "params", request.params);
|
| + }
|
| +
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| - result["offset"] = offset;
|
| - result["length"] = length;
|
| + result["id"] = id;
|
| + if (file != null) {
|
| + result["file"] = file;
|
| + }
|
| + if (uri != null) {
|
| + result["uri"] = uri;
|
| + }
|
| return result;
|
| }
|
|
|
| @override
|
| + Request toRequest(String id) {
|
| + return new Request(id, "execution.mapUri", toJson());
|
| + }
|
| +
|
| + @override
|
| String toString() => JSON.encode(toJson());
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is ImplementedClass) {
|
| - return offset == other.offset && length == other.length;
|
| + if (other is ExecutionMapUriParams) {
|
| + return id == other.id && file == other.file && uri == other.uri;
|
| }
|
| return false;
|
| }
|
| @@ -12360,97 +7703,112 @@ class ImplementedClass implements HasToJson {
|
| @override
|
| int get hashCode {
|
| int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, offset.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, length.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, id.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, file.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, uri.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * ImplementedMember
|
| + * execution.mapUri result
|
| *
|
| * {
|
| - * "offset": int
|
| - * "length": int
|
| + * "file": optional FilePath
|
| + * "uri": optional String
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class ImplementedMember implements HasToJson {
|
| - int _offset;
|
| +class ExecutionMapUriResult implements ResponseResult {
|
| + String _file;
|
|
|
| - int _length;
|
| + String _uri;
|
|
|
| /**
|
| - * The offset of the name of the implemented member.
|
| + * The file to which the URI was mapped. This field is omitted if the uri
|
| + * field was not given in the request.
|
| */
|
| - int get offset => _offset;
|
| + String get file => _file;
|
|
|
| /**
|
| - * The offset of the name of the implemented member.
|
| + * The file to which the URI was mapped. This field is omitted if the uri
|
| + * field was not given in the request.
|
| */
|
| - void set offset(int value) {
|
| - assert(value != null);
|
| - this._offset = value;
|
| + void set file(String value) {
|
| + this._file = value;
|
| }
|
|
|
| /**
|
| - * The length of the name of the implemented member.
|
| + * The URI to which the file path was mapped. This field is omitted if the
|
| + * file field was not given in the request.
|
| */
|
| - int get length => _length;
|
| + String get uri => _uri;
|
|
|
| /**
|
| - * The length of the name of the implemented member.
|
| + * The URI to which the file path was mapped. This field is omitted if the
|
| + * file field was not given in the request.
|
| */
|
| - void set length(int value) {
|
| - assert(value != null);
|
| - this._length = value;
|
| + void set uri(String value) {
|
| + this._uri = value;
|
| }
|
|
|
| - ImplementedMember(int offset, int length) {
|
| - this.offset = offset;
|
| - this.length = length;
|
| + ExecutionMapUriResult({String file, String uri}) {
|
| + this.file = file;
|
| + this.uri = uri;
|
| }
|
|
|
| - factory ImplementedMember.fromJson(
|
| + factory ExecutionMapUriResult.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - int offset;
|
| - if (json.containsKey("offset")) {
|
| - offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "offset");
|
| + String file;
|
| + if (json.containsKey("file")) {
|
| + file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
|
| }
|
| - int length;
|
| - if (json.containsKey("length")) {
|
| - length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "length");
|
| + String uri;
|
| + if (json.containsKey("uri")) {
|
| + uri = jsonDecoder.decodeString(jsonPath + ".uri", json["uri"]);
|
| }
|
| - return new ImplementedMember(offset, length);
|
| + return new ExecutionMapUriResult(file: file, uri: uri);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "ImplementedMember", json);
|
| + throw jsonDecoder.mismatch(jsonPath, "execution.mapUri result", json);
|
| }
|
| }
|
|
|
| + factory ExecutionMapUriResult.fromResponse(Response response) {
|
| + return new ExecutionMapUriResult.fromJson(
|
| + new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)),
|
| + "result",
|
| + response.result);
|
| + }
|
| +
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| - result["offset"] = offset;
|
| - result["length"] = length;
|
| + if (file != null) {
|
| + result["file"] = file;
|
| + }
|
| + if (uri != null) {
|
| + result["uri"] = uri;
|
| + }
|
| return result;
|
| }
|
|
|
| @override
|
| + Response toResponse(String id) {
|
| + return new Response(id, result: toJson());
|
| + }
|
| +
|
| + @override
|
| String toString() => JSON.encode(toJson());
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is ImplementedMember) {
|
| - return offset == other.offset && length == other.length;
|
| + if (other is ExecutionMapUriResult) {
|
| + return file == other.file && uri == other.uri;
|
| }
|
| return false;
|
| }
|
| @@ -12458,99 +7816,141 @@ class ImplementedMember implements HasToJson {
|
| @override
|
| int get hashCode {
|
| int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, offset.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, length.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, file.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, uri.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * inlineLocalVariable feedback
|
| + * ExecutionService
|
| *
|
| - * {
|
| - * "name": String
|
| - * "occurrences": int
|
| + * enum {
|
| + * LAUNCH_DATA
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class InlineLocalVariableFeedback extends RefactoringFeedback {
|
| - String _name;
|
| -
|
| - int _occurrences;
|
| +class ExecutionService implements Enum {
|
| + static const ExecutionService LAUNCH_DATA =
|
| + const ExecutionService._("LAUNCH_DATA");
|
|
|
| /**
|
| - * The name of the variable being inlined.
|
| + * A list containing all of the enum values that are defined.
|
| */
|
| - String get name => _name;
|
| + static const List<ExecutionService> VALUES = const <ExecutionService>[
|
| + LAUNCH_DATA
|
| + ];
|
|
|
| - /**
|
| - * The name of the variable being inlined.
|
| - */
|
| - void set name(String value) {
|
| - assert(value != null);
|
| - this._name = value;
|
| + @override
|
| + final String name;
|
| +
|
| + const ExecutionService._(this.name);
|
| +
|
| + factory ExecutionService(String name) {
|
| + switch (name) {
|
| + case "LAUNCH_DATA":
|
| + return LAUNCH_DATA;
|
| + }
|
| + throw new Exception('Illegal enum value: $name');
|
| + }
|
| +
|
| + factory ExecutionService.fromJson(
|
| + JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| + if (json is String) {
|
| + try {
|
| + return new ExecutionService(json);
|
| + } catch (_) {
|
| + // Fall through
|
| + }
|
| + }
|
| + throw jsonDecoder.mismatch(jsonPath, "ExecutionService", json);
|
| }
|
|
|
| + @override
|
| + String toString() => "ExecutionService.$name";
|
| +
|
| + String toJson() => name;
|
| +}
|
| +
|
| +/**
|
| + * execution.setSubscriptions params
|
| + *
|
| + * {
|
| + * "subscriptions": List<ExecutionService>
|
| + * }
|
| + *
|
| + * Clients may not extend, implement or mix-in this class.
|
| + */
|
| +class ExecutionSetSubscriptionsParams implements RequestParams {
|
| + List<ExecutionService> _subscriptions;
|
| +
|
| /**
|
| - * The number of times the variable occurs.
|
| + * A list of the services being subscribed to.
|
| */
|
| - int get occurrences => _occurrences;
|
| + List<ExecutionService> get subscriptions => _subscriptions;
|
|
|
| /**
|
| - * The number of times the variable occurs.
|
| + * A list of the services being subscribed to.
|
| */
|
| - void set occurrences(int value) {
|
| + void set subscriptions(List<ExecutionService> value) {
|
| assert(value != null);
|
| - this._occurrences = value;
|
| + this._subscriptions = value;
|
| }
|
|
|
| - InlineLocalVariableFeedback(String name, int occurrences) {
|
| - this.name = name;
|
| - this.occurrences = occurrences;
|
| + ExecutionSetSubscriptionsParams(List<ExecutionService> subscriptions) {
|
| + this.subscriptions = subscriptions;
|
| }
|
|
|
| - factory InlineLocalVariableFeedback.fromJson(
|
| + factory ExecutionSetSubscriptionsParams.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - String name;
|
| - if (json.containsKey("name")) {
|
| - name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "name");
|
| - }
|
| - int occurrences;
|
| - if (json.containsKey("occurrences")) {
|
| - occurrences = jsonDecoder.decodeInt(
|
| - jsonPath + ".occurrences", json["occurrences"]);
|
| + List<ExecutionService> subscriptions;
|
| + if (json.containsKey("subscriptions")) {
|
| + subscriptions = jsonDecoder.decodeList(
|
| + jsonPath + ".subscriptions",
|
| + json["subscriptions"],
|
| + (String jsonPath, Object json) =>
|
| + new ExecutionService.fromJson(jsonDecoder, jsonPath, json));
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "occurrences");
|
| + throw jsonDecoder.mismatch(jsonPath, "subscriptions");
|
| }
|
| - return new InlineLocalVariableFeedback(name, occurrences);
|
| + return new ExecutionSetSubscriptionsParams(subscriptions);
|
| } else {
|
| throw jsonDecoder.mismatch(
|
| - jsonPath, "inlineLocalVariable feedback", json);
|
| + jsonPath, "execution.setSubscriptions params", json);
|
| }
|
| }
|
|
|
| + factory ExecutionSetSubscriptionsParams.fromRequest(Request request) {
|
| + return new ExecutionSetSubscriptionsParams.fromJson(
|
| + new RequestDecoder(request), "params", request.params);
|
| + }
|
| +
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| - result["name"] = name;
|
| - result["occurrences"] = occurrences;
|
| + result["subscriptions"] =
|
| + subscriptions.map((ExecutionService value) => value.toJson()).toList();
|
| return result;
|
| }
|
|
|
| @override
|
| + Request toRequest(String id) {
|
| + return new Request(id, "execution.setSubscriptions", toJson());
|
| + }
|
| +
|
| + @override
|
| String toString() => JSON.encode(toJson());
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is InlineLocalVariableFeedback) {
|
| - return name == other.name && occurrences == other.occurrences;
|
| + if (other is ExecutionSetSubscriptionsParams) {
|
| + return listEqual(subscriptions, other.subscriptions,
|
| + (ExecutionService a, ExecutionService b) => a == b);
|
| }
|
| return false;
|
| }
|
| @@ -12558,22 +7958,28 @@ class InlineLocalVariableFeedback extends RefactoringFeedback {
|
| @override
|
| int get hashCode {
|
| int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, name.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, occurrences.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, subscriptions.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * inlineLocalVariable options
|
| + * execution.setSubscriptions result
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class InlineLocalVariableOptions extends RefactoringOptions
|
| - implements HasToJson {
|
| +class ExecutionSetSubscriptionsResult implements ResponseResult {
|
| + @override
|
| + Map<String, dynamic> toJson() => <String, dynamic>{};
|
| +
|
| + @override
|
| + Response toResponse(String id) {
|
| + return new Response(id, result: null);
|
| + }
|
| +
|
| @override
|
| bool operator ==(other) {
|
| - if (other is InlineLocalVariableOptions) {
|
| + if (other is ExecutionSetSubscriptionsResult) {
|
| return true;
|
| }
|
| return false;
|
| @@ -12581,117 +7987,182 @@ class InlineLocalVariableOptions extends RefactoringOptions
|
|
|
| @override
|
| int get hashCode {
|
| - return 540364977;
|
| + return 287678780;
|
| }
|
| }
|
|
|
| /**
|
| - * inlineMethod feedback
|
| + * extractLocalVariable feedback
|
| *
|
| * {
|
| - * "className": optional String
|
| - * "methodName": String
|
| - * "isDeclaration": bool
|
| + * "coveringExpressionOffsets": optional List<int>
|
| + * "coveringExpressionLengths": optional List<int>
|
| + * "names": List<String>
|
| + * "offsets": List<int>
|
| + * "lengths": List<int>
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class InlineMethodFeedback extends RefactoringFeedback {
|
| - String _className;
|
| +class ExtractLocalVariableFeedback extends RefactoringFeedback {
|
| + List<int> _coveringExpressionOffsets;
|
|
|
| - String _methodName;
|
| + List<int> _coveringExpressionLengths;
|
|
|
| - bool _isDeclaration;
|
| + List<String> _names;
|
| +
|
| + List<int> _offsets;
|
| +
|
| + List<int> _lengths;
|
|
|
| /**
|
| - * The name of the class enclosing the method being inlined. If not a class
|
| - * member is being inlined, this field will be absent.
|
| + * The offsets of the expressions that cover the specified selection, from
|
| + * the down most to the up most.
|
| */
|
| - String get className => _className;
|
| + List<int> get coveringExpressionOffsets => _coveringExpressionOffsets;
|
|
|
| /**
|
| - * The name of the class enclosing the method being inlined. If not a class
|
| - * member is being inlined, this field will be absent.
|
| + * The offsets of the expressions that cover the specified selection, from
|
| + * the down most to the up most.
|
| */
|
| - void set className(String value) {
|
| - this._className = value;
|
| + void set coveringExpressionOffsets(List<int> value) {
|
| + this._coveringExpressionOffsets = value;
|
| }
|
|
|
| /**
|
| - * The name of the method (or function) being inlined.
|
| + * The lengths of the expressions that cover the specified selection, from
|
| + * the down most to the up most.
|
| */
|
| - String get methodName => _methodName;
|
| + List<int> get coveringExpressionLengths => _coveringExpressionLengths;
|
|
|
| /**
|
| - * The name of the method (or function) being inlined.
|
| + * The lengths of the expressions that cover the specified selection, from
|
| + * the down most to the up most.
|
| */
|
| - void set methodName(String value) {
|
| + void set coveringExpressionLengths(List<int> value) {
|
| + this._coveringExpressionLengths = value;
|
| + }
|
| +
|
| + /**
|
| + * The proposed names for the local variable.
|
| + */
|
| + List<String> get names => _names;
|
| +
|
| + /**
|
| + * The proposed names for the local variable.
|
| + */
|
| + void set names(List<String> value) {
|
| assert(value != null);
|
| - this._methodName = value;
|
| + this._names = value;
|
| }
|
|
|
| /**
|
| - * True if the declaration of the method is selected. So all references
|
| - * should be inlined.
|
| + * The offsets of the expressions that would be replaced by a reference to
|
| + * the variable.
|
| */
|
| - bool get isDeclaration => _isDeclaration;
|
| + List<int> get offsets => _offsets;
|
|
|
| /**
|
| - * True if the declaration of the method is selected. So all references
|
| - * should be inlined.
|
| + * The offsets of the expressions that would be replaced by a reference to
|
| + * the variable.
|
| */
|
| - void set isDeclaration(bool value) {
|
| + void set offsets(List<int> value) {
|
| assert(value != null);
|
| - this._isDeclaration = value;
|
| + this._offsets = value;
|
| }
|
|
|
| - InlineMethodFeedback(String methodName, bool isDeclaration,
|
| - {String className}) {
|
| - this.className = className;
|
| - this.methodName = methodName;
|
| - this.isDeclaration = isDeclaration;
|
| + /**
|
| + * 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].
|
| + */
|
| + List<int> get lengths => _lengths;
|
| +
|
| + /**
|
| + * 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].
|
| + */
|
| + void set lengths(List<int> value) {
|
| + assert(value != null);
|
| + this._lengths = value;
|
| }
|
|
|
| - factory InlineMethodFeedback.fromJson(
|
| + ExtractLocalVariableFeedback(
|
| + List<String> names, List<int> offsets, List<int> lengths,
|
| + {List<int> coveringExpressionOffsets,
|
| + List<int> coveringExpressionLengths}) {
|
| + this.coveringExpressionOffsets = coveringExpressionOffsets;
|
| + this.coveringExpressionLengths = coveringExpressionLengths;
|
| + this.names = names;
|
| + this.offsets = offsets;
|
| + this.lengths = lengths;
|
| + }
|
| +
|
| + factory ExtractLocalVariableFeedback.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - String className;
|
| - if (json.containsKey("className")) {
|
| - className = jsonDecoder.decodeString(
|
| - jsonPath + ".className", json["className"]);
|
| + List<int> coveringExpressionOffsets;
|
| + if (json.containsKey("coveringExpressionOffsets")) {
|
| + coveringExpressionOffsets = jsonDecoder.decodeList(
|
| + jsonPath + ".coveringExpressionOffsets",
|
| + json["coveringExpressionOffsets"],
|
| + jsonDecoder.decodeInt);
|
| }
|
| - String methodName;
|
| - if (json.containsKey("methodName")) {
|
| - methodName = jsonDecoder.decodeString(
|
| - jsonPath + ".methodName", json["methodName"]);
|
| + List<int> coveringExpressionLengths;
|
| + if (json.containsKey("coveringExpressionLengths")) {
|
| + coveringExpressionLengths = jsonDecoder.decodeList(
|
| + jsonPath + ".coveringExpressionLengths",
|
| + json["coveringExpressionLengths"],
|
| + jsonDecoder.decodeInt);
|
| + }
|
| + List<String> names;
|
| + if (json.containsKey("names")) {
|
| + names = jsonDecoder.decodeList(
|
| + jsonPath + ".names", json["names"], jsonDecoder.decodeString);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "methodName");
|
| + throw jsonDecoder.mismatch(jsonPath, "names");
|
| }
|
| - bool isDeclaration;
|
| - if (json.containsKey("isDeclaration")) {
|
| - isDeclaration = jsonDecoder.decodeBool(
|
| - jsonPath + ".isDeclaration", json["isDeclaration"]);
|
| + List<int> offsets;
|
| + if (json.containsKey("offsets")) {
|
| + offsets = jsonDecoder.decodeList(
|
| + jsonPath + ".offsets", json["offsets"], jsonDecoder.decodeInt);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "isDeclaration");
|
| + throw jsonDecoder.mismatch(jsonPath, "offsets");
|
| }
|
| - return new InlineMethodFeedback(methodName, isDeclaration,
|
| - className: className);
|
| + List<int> lengths;
|
| + if (json.containsKey("lengths")) {
|
| + lengths = jsonDecoder.decodeList(
|
| + jsonPath + ".lengths", json["lengths"], jsonDecoder.decodeInt);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "lengths");
|
| + }
|
| + return new ExtractLocalVariableFeedback(names, offsets, lengths,
|
| + coveringExpressionOffsets: coveringExpressionOffsets,
|
| + coveringExpressionLengths: coveringExpressionLengths);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "inlineMethod feedback", json);
|
| + throw jsonDecoder.mismatch(
|
| + jsonPath, "extractLocalVariable feedback", json);
|
| }
|
| }
|
|
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| - if (className != null) {
|
| - result["className"] = className;
|
| + if (coveringExpressionOffsets != null) {
|
| + result["coveringExpressionOffsets"] = coveringExpressionOffsets;
|
| }
|
| - result["methodName"] = methodName;
|
| - result["isDeclaration"] = isDeclaration;
|
| + if (coveringExpressionLengths != null) {
|
| + result["coveringExpressionLengths"] = coveringExpressionLengths;
|
| + }
|
| + result["names"] = names;
|
| + result["offsets"] = offsets;
|
| + result["lengths"] = lengths;
|
| return result;
|
| }
|
|
|
| @@ -12700,10 +8171,14 @@ class InlineMethodFeedback extends RefactoringFeedback {
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is InlineMethodFeedback) {
|
| - return className == other.className &&
|
| - methodName == other.methodName &&
|
| - isDeclaration == other.isDeclaration;
|
| + if (other is ExtractLocalVariableFeedback) {
|
| + return listEqual(coveringExpressionOffsets,
|
| + other.coveringExpressionOffsets, (int a, int b) => a == b) &&
|
| + listEqual(coveringExpressionLengths, other.coveringExpressionLengths,
|
| + (int a, int b) => a == b) &&
|
| + listEqual(names, other.names, (String a, String b) => a == b) &&
|
| + listEqual(offsets, other.offsets, (int a, int b) => a == b) &&
|
| + listEqual(lengths, other.lengths, (int a, int b) => a == b);
|
| }
|
| return false;
|
| }
|
| @@ -12711,100 +8186,104 @@ class InlineMethodFeedback extends RefactoringFeedback {
|
| @override
|
| int get hashCode {
|
| int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, className.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, methodName.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, isDeclaration.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, coveringExpressionOffsets.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, coveringExpressionLengths.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, names.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, offsets.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, lengths.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * inlineMethod options
|
| + * extractLocalVariable options
|
| *
|
| * {
|
| - * "deleteSource": bool
|
| - * "inlineAll": bool
|
| + * "name": String
|
| + * "extractAll": bool
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class InlineMethodOptions extends RefactoringOptions {
|
| - bool _deleteSource;
|
| +class ExtractLocalVariableOptions extends RefactoringOptions {
|
| + String _name;
|
|
|
| - bool _inlineAll;
|
| + bool _extractAll;
|
|
|
| /**
|
| - * True if the method being inlined should be removed. It is an error if this
|
| - * field is true and inlineAll is false.
|
| + * The name that the local variable should be given.
|
| */
|
| - bool get deleteSource => _deleteSource;
|
| + String get name => _name;
|
|
|
| /**
|
| - * True if the method being inlined should be removed. It is an error if this
|
| - * field is true and inlineAll is false.
|
| + * The name that the local variable should be given.
|
| */
|
| - void set deleteSource(bool value) {
|
| + void set name(String value) {
|
| assert(value != null);
|
| - this._deleteSource = value;
|
| + this._name = value;
|
| }
|
|
|
| /**
|
| - * 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.
|
| + * 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.
|
| */
|
| - bool get inlineAll => _inlineAll;
|
| + bool get extractAll => _extractAll;
|
|
|
| /**
|
| - * 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.
|
| + * 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.
|
| */
|
| - void set inlineAll(bool value) {
|
| + void set extractAll(bool value) {
|
| assert(value != null);
|
| - this._inlineAll = value;
|
| + this._extractAll = value;
|
| }
|
|
|
| - InlineMethodOptions(bool deleteSource, bool inlineAll) {
|
| - this.deleteSource = deleteSource;
|
| - this.inlineAll = inlineAll;
|
| + ExtractLocalVariableOptions(String name, bool extractAll) {
|
| + this.name = name;
|
| + this.extractAll = extractAll;
|
| }
|
|
|
| - factory InlineMethodOptions.fromJson(
|
| + factory ExtractLocalVariableOptions.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - bool deleteSource;
|
| - if (json.containsKey("deleteSource")) {
|
| - deleteSource = jsonDecoder.decodeBool(
|
| - jsonPath + ".deleteSource", json["deleteSource"]);
|
| + String name;
|
| + if (json.containsKey("name")) {
|
| + name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "deleteSource");
|
| + throw jsonDecoder.mismatch(jsonPath, "name");
|
| }
|
| - bool inlineAll;
|
| - if (json.containsKey("inlineAll")) {
|
| - inlineAll =
|
| - jsonDecoder.decodeBool(jsonPath + ".inlineAll", json["inlineAll"]);
|
| + bool extractAll;
|
| + if (json.containsKey("extractAll")) {
|
| + extractAll = jsonDecoder.decodeBool(
|
| + jsonPath + ".extractAll", json["extractAll"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "inlineAll");
|
| + throw jsonDecoder.mismatch(jsonPath, "extractAll");
|
| }
|
| - return new InlineMethodOptions(deleteSource, inlineAll);
|
| + return new ExtractLocalVariableOptions(name, extractAll);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "inlineMethod options", json);
|
| + throw jsonDecoder.mismatch(
|
| + jsonPath, "extractLocalVariable options", json);
|
| }
|
| }
|
|
|
| - factory InlineMethodOptions.fromRefactoringParams(
|
| + factory ExtractLocalVariableOptions.fromRefactoringParams(
|
| EditGetRefactoringParams refactoringParams, Request request) {
|
| - return new InlineMethodOptions.fromJson(
|
| + return new ExtractLocalVariableOptions.fromJson(
|
| new RequestDecoder(request), "options", refactoringParams.options);
|
| }
|
|
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| - result["deleteSource"] = deleteSource;
|
| - result["inlineAll"] = inlineAll;
|
| + result["name"] = name;
|
| + result["extractAll"] = extractAll;
|
| return result;
|
| }
|
|
|
| @@ -12813,8 +8292,8 @@ class InlineMethodOptions extends RefactoringOptions {
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is InlineMethodOptions) {
|
| - return deleteSource == other.deleteSource && inlineAll == other.inlineAll;
|
| + if (other is ExtractLocalVariableOptions) {
|
| + return name == other.name && extractAll == other.extractAll;
|
| }
|
| return false;
|
| }
|
| @@ -12822,50 +8301,67 @@ class InlineMethodOptions extends RefactoringOptions {
|
| @override
|
| int get hashCode {
|
| int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, deleteSource.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, inlineAll.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, name.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, extractAll.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * LinkedEditGroup
|
| + * extractMethod feedback
|
| *
|
| * {
|
| - * "positions": List<Position>
|
| + * "offset": int
|
| * "length": int
|
| - * "suggestions": List<LinkedEditSuggestion>
|
| + * "returnType": String
|
| + * "names": List<String>
|
| + * "canCreateGetter": bool
|
| + * "parameters": List<RefactoringMethodParameter>
|
| + * "offsets": List<int>
|
| + * "lengths": List<int>
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class LinkedEditGroup implements HasToJson {
|
| - List<Position> _positions;
|
| +class ExtractMethodFeedback extends RefactoringFeedback {
|
| + int _offset;
|
|
|
| int _length;
|
|
|
| - List<LinkedEditSuggestion> _suggestions;
|
| + String _returnType;
|
| +
|
| + List<String> _names;
|
| +
|
| + bool _canCreateGetter;
|
| +
|
| + List<RefactoringMethodParameter> _parameters;
|
| +
|
| + List<int> _offsets;
|
| +
|
| + List<int> _lengths;
|
|
|
| /**
|
| - * The positions of the regions that should be edited simultaneously.
|
| + * The offset to the beginning of the expression or statements that will be
|
| + * extracted.
|
| */
|
| - List<Position> get positions => _positions;
|
| + int get offset => _offset;
|
|
|
| /**
|
| - * The positions of the regions that should be edited simultaneously.
|
| + * The offset to the beginning of the expression or statements that will be
|
| + * extracted.
|
| */
|
| - void set positions(List<Position> value) {
|
| + void set offset(int value) {
|
| assert(value != null);
|
| - this._positions = value;
|
| + this._offset = value;
|
| }
|
|
|
| /**
|
| - * The length of the regions that should be edited simultaneously.
|
| + * The length of the expression or statements that will be extracted.
|
| */
|
| int get length => _length;
|
|
|
| /**
|
| - * The length of the regions that should be edited simultaneously.
|
| + * The length of the expression or statements that will be extracted.
|
| */
|
| void set length(int value) {
|
| assert(value != null);
|
| @@ -12873,198 +8369,198 @@ class LinkedEditGroup implements HasToJson {
|
| }
|
|
|
| /**
|
| - * Pre-computed suggestions for what every region might want to be changed
|
| - * to.
|
| + * The proposed return type for the method. If the returned element does not
|
| + * have a declared return type, this field will contain an empty string.
|
| */
|
| - List<LinkedEditSuggestion> get suggestions => _suggestions;
|
| + String get returnType => _returnType;
|
|
|
| /**
|
| - * Pre-computed suggestions for what every region might want to be changed
|
| - * to.
|
| + * The proposed return type for the method. If the returned element does not
|
| + * have a declared return type, this field will contain an empty string.
|
| */
|
| - void set suggestions(List<LinkedEditSuggestion> value) {
|
| + void set returnType(String value) {
|
| assert(value != null);
|
| - this._suggestions = value;
|
| - }
|
| -
|
| - LinkedEditGroup(List<Position> positions, int length,
|
| - List<LinkedEditSuggestion> suggestions) {
|
| - this.positions = positions;
|
| - this.length = length;
|
| - this.suggestions = suggestions;
|
| - }
|
| -
|
| - factory LinkedEditGroup.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - List<Position> positions;
|
| - if (json.containsKey("positions")) {
|
| - positions = jsonDecoder.decodeList(
|
| - jsonPath + ".positions",
|
| - json["positions"],
|
| - (String jsonPath, Object json) =>
|
| - new Position.fromJson(jsonDecoder, jsonPath, json));
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "positions");
|
| - }
|
| - int length;
|
| - if (json.containsKey("length")) {
|
| - length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "length");
|
| - }
|
| - List<LinkedEditSuggestion> suggestions;
|
| - if (json.containsKey("suggestions")) {
|
| - suggestions = jsonDecoder.decodeList(
|
| - jsonPath + ".suggestions",
|
| - json["suggestions"],
|
| - (String jsonPath, Object json) =>
|
| - new LinkedEditSuggestion.fromJson(jsonDecoder, jsonPath, json));
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "suggestions");
|
| - }
|
| - return new LinkedEditGroup(positions, length, suggestions);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "LinkedEditGroup", json);
|
| - }
|
| + this._returnType = value;
|
| }
|
|
|
| /**
|
| - * Construct an empty LinkedEditGroup.
|
| + * The proposed names for the method.
|
| */
|
| - LinkedEditGroup.empty() : this(<Position>[], 0, <LinkedEditSuggestion>[]);
|
| + List<String> get names => _names;
|
|
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - result["positions"] =
|
| - positions.map((Position value) => value.toJson()).toList();
|
| - result["length"] = length;
|
| - result["suggestions"] = suggestions
|
| - .map((LinkedEditSuggestion value) => value.toJson())
|
| - .toList();
|
| - return result;
|
| + /**
|
| + * The proposed names for the method.
|
| + */
|
| + void set names(List<String> value) {
|
| + assert(value != null);
|
| + this._names = value;
|
| }
|
|
|
| /**
|
| - * Add a new position and change the length.
|
| + * True if a getter could be created rather than a method.
|
| */
|
| - void addPosition(Position position, int length) {
|
| - positions.add(position);
|
| - this.length = length;
|
| - }
|
| + bool get canCreateGetter => _canCreateGetter;
|
|
|
| /**
|
| - * Add a new suggestion.
|
| + * True if a getter could be created rather than a method.
|
| */
|
| - void addSuggestion(LinkedEditSuggestion suggestion) {
|
| - suggestions.add(suggestion);
|
| + void set canCreateGetter(bool value) {
|
| + assert(value != null);
|
| + this._canCreateGetter = value;
|
| }
|
|
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is LinkedEditGroup) {
|
| - return listEqual(
|
| - positions, other.positions, (Position a, Position b) => a == b) &&
|
| - length == other.length &&
|
| - listEqual(suggestions, other.suggestions,
|
| - (LinkedEditSuggestion a, LinkedEditSuggestion b) => a == b);
|
| - }
|
| - return false;
|
| - }
|
| + /**
|
| + * The proposed parameters for the method.
|
| + */
|
| + List<RefactoringMethodParameter> get parameters => _parameters;
|
|
|
| - @override
|
| - 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);
|
| + /**
|
| + * The proposed parameters for the method.
|
| + */
|
| + void set parameters(List<RefactoringMethodParameter> value) {
|
| + assert(value != null);
|
| + this._parameters = value;
|
| }
|
| -}
|
| -
|
| -/**
|
| - * LinkedEditSuggestion
|
| - *
|
| - * {
|
| - * "value": String
|
| - * "kind": LinkedEditSuggestionKind
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class LinkedEditSuggestion implements HasToJson {
|
| - String _value;
|
| -
|
| - LinkedEditSuggestionKind _kind;
|
|
|
| /**
|
| - * The value that could be used to replace all of the linked edit regions.
|
| + * The offsets of the expressions or statements that would be replaced by an
|
| + * invocation of the method.
|
| */
|
| - String get value => _value;
|
| + List<int> get offsets => _offsets;
|
|
|
| /**
|
| - * The value that could be used to replace all of the linked edit regions.
|
| + * The offsets of the expressions or statements that would be replaced by an
|
| + * invocation of the method.
|
| */
|
| - void set value(String value) {
|
| + void set offsets(List<int> value) {
|
| assert(value != null);
|
| - this._value = value;
|
| + this._offsets = value;
|
| }
|
|
|
| /**
|
| - * The kind of value being proposed.
|
| + * 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].
|
| */
|
| - LinkedEditSuggestionKind get kind => _kind;
|
| + List<int> get lengths => _lengths;
|
|
|
| /**
|
| - * The kind of value being proposed.
|
| + * 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].
|
| */
|
| - void set kind(LinkedEditSuggestionKind value) {
|
| + void set lengths(List<int> value) {
|
| assert(value != null);
|
| - this._kind = value;
|
| + this._lengths = value;
|
| }
|
|
|
| - LinkedEditSuggestion(String value, LinkedEditSuggestionKind kind) {
|
| - this.value = value;
|
| - this.kind = kind;
|
| + ExtractMethodFeedback(
|
| + int offset,
|
| + int length,
|
| + String returnType,
|
| + List<String> names,
|
| + bool canCreateGetter,
|
| + List<RefactoringMethodParameter> parameters,
|
| + List<int> offsets,
|
| + List<int> lengths) {
|
| + this.offset = offset;
|
| + this.length = length;
|
| + this.returnType = returnType;
|
| + this.names = names;
|
| + this.canCreateGetter = canCreateGetter;
|
| + this.parameters = parameters;
|
| + this.offsets = offsets;
|
| + this.lengths = lengths;
|
| }
|
|
|
| - factory LinkedEditSuggestion.fromJson(
|
| + factory ExtractMethodFeedback.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - String value;
|
| - if (json.containsKey("value")) {
|
| - value = jsonDecoder.decodeString(jsonPath + ".value", json["value"]);
|
| + int offset;
|
| + if (json.containsKey("offset")) {
|
| + offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "value");
|
| + throw jsonDecoder.mismatch(jsonPath, "offset");
|
| }
|
| - LinkedEditSuggestionKind kind;
|
| - if (json.containsKey("kind")) {
|
| - kind = new LinkedEditSuggestionKind.fromJson(
|
| - jsonDecoder, jsonPath + ".kind", json["kind"]);
|
| + int length;
|
| + if (json.containsKey("length")) {
|
| + length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "kind");
|
| + throw jsonDecoder.mismatch(jsonPath, "length");
|
| + }
|
| + String returnType;
|
| + if (json.containsKey("returnType")) {
|
| + returnType = jsonDecoder.decodeString(
|
| + jsonPath + ".returnType", json["returnType"]);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "returnType");
|
| + }
|
| + List<String> names;
|
| + if (json.containsKey("names")) {
|
| + names = jsonDecoder.decodeList(
|
| + jsonPath + ".names", json["names"], jsonDecoder.decodeString);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "names");
|
| + }
|
| + bool canCreateGetter;
|
| + if (json.containsKey("canCreateGetter")) {
|
| + canCreateGetter = jsonDecoder.decodeBool(
|
| + jsonPath + ".canCreateGetter", json["canCreateGetter"]);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "canCreateGetter");
|
| + }
|
| + List<RefactoringMethodParameter> parameters;
|
| + if (json.containsKey("parameters")) {
|
| + parameters = jsonDecoder.decodeList(
|
| + jsonPath + ".parameters",
|
| + json["parameters"],
|
| + (String jsonPath, Object json) =>
|
| + new RefactoringMethodParameter.fromJson(
|
| + jsonDecoder, jsonPath, json));
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "parameters");
|
| + }
|
| + List<int> offsets;
|
| + if (json.containsKey("offsets")) {
|
| + offsets = jsonDecoder.decodeList(
|
| + jsonPath + ".offsets", json["offsets"], jsonDecoder.decodeInt);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "offsets");
|
| + }
|
| + List<int> lengths;
|
| + if (json.containsKey("lengths")) {
|
| + lengths = jsonDecoder.decodeList(
|
| + jsonPath + ".lengths", json["lengths"], jsonDecoder.decodeInt);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "lengths");
|
| }
|
| - return new LinkedEditSuggestion(value, kind);
|
| + return new ExtractMethodFeedback(offset, length, returnType, names,
|
| + canCreateGetter, parameters, offsets, lengths);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "LinkedEditSuggestion", json);
|
| + throw jsonDecoder.mismatch(jsonPath, "extractMethod feedback", json);
|
| }
|
| }
|
|
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| - result["value"] = value;
|
| - result["kind"] = kind.toJson();
|
| + result["offset"] = offset;
|
| + result["length"] = length;
|
| + result["returnType"] = returnType;
|
| + result["names"] = names;
|
| + result["canCreateGetter"] = canCreateGetter;
|
| + result["parameters"] = parameters
|
| + .map((RefactoringMethodParameter value) => value.toJson())
|
| + .toList();
|
| + result["offsets"] = offsets;
|
| + result["lengths"] = lengths;
|
| return result;
|
| }
|
|
|
| @@ -13073,8 +8569,19 @@ class LinkedEditSuggestion implements HasToJson {
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is LinkedEditSuggestion) {
|
| - return value == other.value && kind == other.kind;
|
| + if (other is ExtractMethodFeedback) {
|
| + return offset == other.offset &&
|
| + length == other.length &&
|
| + returnType == other.returnType &&
|
| + listEqual(names, other.names, (String a, String b) => a == b) &&
|
| + canCreateGetter == other.canCreateGetter &&
|
| + listEqual(
|
| + parameters,
|
| + other.parameters,
|
| + (RefactoringMethodParameter a, RefactoringMethodParameter b) =>
|
| + a == b) &&
|
| + listEqual(offsets, other.offsets, (int a, int b) => a == b) &&
|
| + listEqual(lengths, other.lengths, (int a, int b) => a == b);
|
| }
|
| return false;
|
| }
|
| @@ -13082,234 +8589,207 @@ class LinkedEditSuggestion implements HasToJson {
|
| @override
|
| int get hashCode {
|
| int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, value.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, kind.hashCode);
|
| + 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, offsets.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, lengths.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * LinkedEditSuggestionKind
|
| - *
|
| - * enum {
|
| - * METHOD
|
| - * PARAMETER
|
| - * TYPE
|
| - * VARIABLE
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class LinkedEditSuggestionKind implements Enum {
|
| - static const LinkedEditSuggestionKind METHOD =
|
| - const LinkedEditSuggestionKind._("METHOD");
|
| -
|
| - static const LinkedEditSuggestionKind PARAMETER =
|
| - const LinkedEditSuggestionKind._("PARAMETER");
|
| -
|
| - static const LinkedEditSuggestionKind TYPE =
|
| - const LinkedEditSuggestionKind._("TYPE");
|
| -
|
| - static const LinkedEditSuggestionKind VARIABLE =
|
| - const LinkedEditSuggestionKind._("VARIABLE");
|
| -
|
| - /**
|
| - * A list containing all of the enum values that are defined.
|
| - */
|
| - static const List<LinkedEditSuggestionKind> VALUES =
|
| - const <LinkedEditSuggestionKind>[METHOD, PARAMETER, TYPE, VARIABLE];
|
| -
|
| - @override
|
| - 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');
|
| - }
|
| -
|
| - factory LinkedEditSuggestionKind.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json is String) {
|
| - try {
|
| - return new LinkedEditSuggestionKind(json);
|
| - } catch (_) {
|
| - // Fall through
|
| - }
|
| - }
|
| - throw jsonDecoder.mismatch(jsonPath, "LinkedEditSuggestionKind", json);
|
| - }
|
| -
|
| - @override
|
| - String toString() => "LinkedEditSuggestionKind.$name";
|
| -
|
| - String toJson() => name;
|
| -}
|
| -
|
| -/**
|
| - * Location
|
| + * extractMethod options
|
| *
|
| * {
|
| - * "file": FilePath
|
| - * "offset": int
|
| - * "length": int
|
| - * "startLine": int
|
| - * "startColumn": int
|
| + * "returnType": String
|
| + * "createGetter": bool
|
| + * "name": String
|
| + * "parameters": List<RefactoringMethodParameter>
|
| + * "extractAll": bool
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class Location implements HasToJson {
|
| - String _file;
|
| +class ExtractMethodOptions extends RefactoringOptions {
|
| + String _returnType;
|
|
|
| - int _offset;
|
| + bool _createGetter;
|
|
|
| - int _length;
|
| + String _name;
|
|
|
| - int _startLine;
|
| + List<RefactoringMethodParameter> _parameters;
|
|
|
| - int _startColumn;
|
| + bool _extractAll;
|
|
|
| /**
|
| - * The file containing the range.
|
| + * The return type that should be defined for the method.
|
| */
|
| - String get file => _file;
|
| + String get returnType => _returnType;
|
|
|
| /**
|
| - * The file containing the range.
|
| + * The return type that should be defined for the method.
|
| */
|
| - void set file(String value) {
|
| + void set returnType(String value) {
|
| assert(value != null);
|
| - this._file = value;
|
| + this._returnType = value;
|
| }
|
|
|
| /**
|
| - * The offset of the range.
|
| + * 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.
|
| */
|
| - int get offset => _offset;
|
| + bool get createGetter => _createGetter;
|
|
|
| /**
|
| - * The offset of the range.
|
| + * 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.
|
| */
|
| - void set offset(int value) {
|
| + void set createGetter(bool value) {
|
| assert(value != null);
|
| - this._offset = value;
|
| + this._createGetter = value;
|
| }
|
|
|
| /**
|
| - * The length of the range.
|
| + * The name that the method should be given.
|
| */
|
| - int get length => _length;
|
| + String get name => _name;
|
|
|
| /**
|
| - * The length of the range.
|
| + * The name that the method should be given.
|
| */
|
| - void set length(int value) {
|
| + void set name(String value) {
|
| assert(value != null);
|
| - this._length = value;
|
| + this._name = value;
|
| }
|
|
|
| /**
|
| - * The one-based index of the line containing the first character of the
|
| - * range.
|
| + * 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 parameters, add parameters
|
| + * with the same identifiers as proposed.
|
| + * - To add new parameters, omit their identifier.
|
| + * - To remove some parameters, omit them in this list.
|
| */
|
| - int get startLine => _startLine;
|
| + List<RefactoringMethodParameter> get parameters => _parameters;
|
|
|
| /**
|
| - * The one-based index of the line containing the first character of the
|
| - * range.
|
| + * 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 parameters, add parameters
|
| + * with the same identifiers as proposed.
|
| + * - To add new parameters, omit their identifier.
|
| + * - To remove some parameters, omit them in this list.
|
| */
|
| - void set startLine(int value) {
|
| + void set parameters(List<RefactoringMethodParameter> value) {
|
| assert(value != null);
|
| - this._startLine = value;
|
| + this._parameters = value;
|
| }
|
|
|
| /**
|
| - * The one-based index of the column containing the first character of the
|
| - * range.
|
| + * 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.
|
| */
|
| - int get startColumn => _startColumn;
|
| + bool get extractAll => _extractAll;
|
|
|
| /**
|
| - * The one-based index of the column containing the first character of the
|
| - * range.
|
| + * 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.
|
| */
|
| - void set startColumn(int value) {
|
| + void set extractAll(bool value) {
|
| assert(value != null);
|
| - this._startColumn = value;
|
| + this._extractAll = value;
|
| }
|
|
|
| - Location(
|
| - String file, int offset, int length, int startLine, int startColumn) {
|
| - this.file = file;
|
| - this.offset = offset;
|
| - this.length = length;
|
| - this.startLine = startLine;
|
| - this.startColumn = startColumn;
|
| + ExtractMethodOptions(String returnType, bool createGetter, String name,
|
| + List<RefactoringMethodParameter> parameters, bool extractAll) {
|
| + this.returnType = returnType;
|
| + this.createGetter = createGetter;
|
| + this.name = name;
|
| + this.parameters = parameters;
|
| + this.extractAll = extractAll;
|
| }
|
|
|
| - factory Location.fromJson(
|
| + factory ExtractMethodOptions.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - String file;
|
| - if (json.containsKey("file")) {
|
| - file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
|
| + String returnType;
|
| + if (json.containsKey("returnType")) {
|
| + returnType = jsonDecoder.decodeString(
|
| + jsonPath + ".returnType", json["returnType"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "file");
|
| + throw jsonDecoder.mismatch(jsonPath, "returnType");
|
| }
|
| - int offset;
|
| - if (json.containsKey("offset")) {
|
| - offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
|
| + bool createGetter;
|
| + if (json.containsKey("createGetter")) {
|
| + createGetter = jsonDecoder.decodeBool(
|
| + jsonPath + ".createGetter", json["createGetter"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "offset");
|
| + throw jsonDecoder.mismatch(jsonPath, "createGetter");
|
| }
|
| - int length;
|
| - if (json.containsKey("length")) {
|
| - length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
|
| + String name;
|
| + if (json.containsKey("name")) {
|
| + name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "length");
|
| + throw jsonDecoder.mismatch(jsonPath, "name");
|
| }
|
| - int startLine;
|
| - if (json.containsKey("startLine")) {
|
| - startLine =
|
| - jsonDecoder.decodeInt(jsonPath + ".startLine", json["startLine"]);
|
| + List<RefactoringMethodParameter> parameters;
|
| + if (json.containsKey("parameters")) {
|
| + parameters = jsonDecoder.decodeList(
|
| + jsonPath + ".parameters",
|
| + json["parameters"],
|
| + (String jsonPath, Object json) =>
|
| + new RefactoringMethodParameter.fromJson(
|
| + jsonDecoder, jsonPath, json));
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "startLine");
|
| + throw jsonDecoder.mismatch(jsonPath, "parameters");
|
| }
|
| - int startColumn;
|
| - if (json.containsKey("startColumn")) {
|
| - startColumn = jsonDecoder.decodeInt(
|
| - jsonPath + ".startColumn", json["startColumn"]);
|
| + bool extractAll;
|
| + if (json.containsKey("extractAll")) {
|
| + extractAll = jsonDecoder.decodeBool(
|
| + jsonPath + ".extractAll", json["extractAll"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "startColumn");
|
| + throw jsonDecoder.mismatch(jsonPath, "extractAll");
|
| }
|
| - return new Location(file, offset, length, startLine, startColumn);
|
| + return new ExtractMethodOptions(
|
| + returnType, createGetter, name, parameters, extractAll);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "Location", json);
|
| + throw jsonDecoder.mismatch(jsonPath, "extractMethod options", json);
|
| }
|
| }
|
|
|
| + factory ExtractMethodOptions.fromRefactoringParams(
|
| + EditGetRefactoringParams refactoringParams, Request request) {
|
| + return new ExtractMethodOptions.fromJson(
|
| + new RequestDecoder(request), "options", refactoringParams.options);
|
| + }
|
| +
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| - result["file"] = file;
|
| - result["offset"] = offset;
|
| - result["length"] = length;
|
| - result["startLine"] = startLine;
|
| - result["startColumn"] = startColumn;
|
| + result["returnType"] = returnType;
|
| + result["createGetter"] = createGetter;
|
| + result["name"] = name;
|
| + result["parameters"] = parameters
|
| + .map((RefactoringMethodParameter value) => value.toJson())
|
| + .toList();
|
| + result["extractAll"] = extractAll;
|
| return result;
|
| }
|
|
|
| @@ -13318,12 +8798,16 @@ class Location implements HasToJson {
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is Location) {
|
| - return file == other.file &&
|
| - offset == other.offset &&
|
| - length == other.length &&
|
| - startLine == other.startLine &&
|
| - startColumn == other.startColumn;
|
| + if (other is ExtractMethodOptions) {
|
| + return returnType == other.returnType &&
|
| + createGetter == other.createGetter &&
|
| + name == other.name &&
|
| + listEqual(
|
| + parameters,
|
| + other.parameters,
|
| + (RefactoringMethodParameter a, RefactoringMethodParameter b) =>
|
| + a == b) &&
|
| + extractAll == other.extractAll;
|
| }
|
| return false;
|
| }
|
| @@ -13331,140 +8815,172 @@ class Location implements HasToJson {
|
| @override
|
| 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);
|
| + 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);
|
| }
|
| }
|
|
|
| /**
|
| - * moveFile feedback
|
| + * FileKind
|
| + *
|
| + * enum {
|
| + * LIBRARY
|
| + * PART
|
| + * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class MoveFileFeedback extends RefactoringFeedback implements HasToJson {
|
| +class FileKind implements Enum {
|
| + static const FileKind LIBRARY = const FileKind._("LIBRARY");
|
| +
|
| + static const FileKind PART = const FileKind._("PART");
|
| +
|
| + /**
|
| + * A list containing all of the enum values that are defined.
|
| + */
|
| + static const List<FileKind> VALUES = const <FileKind>[LIBRARY, PART];
|
| +
|
| @override
|
| - bool operator ==(other) {
|
| - if (other is MoveFileFeedback) {
|
| - return true;
|
| + final String name;
|
| +
|
| + const FileKind._(this.name);
|
| +
|
| + factory FileKind(String name) {
|
| + switch (name) {
|
| + case "LIBRARY":
|
| + return LIBRARY;
|
| + case "PART":
|
| + return PART;
|
| + }
|
| + throw new Exception('Illegal enum value: $name');
|
| + }
|
| +
|
| + factory FileKind.fromJson(
|
| + JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| + if (json is String) {
|
| + try {
|
| + return new FileKind(json);
|
| + } catch (_) {
|
| + // Fall through
|
| + }
|
| }
|
| - return false;
|
| + throw jsonDecoder.mismatch(jsonPath, "FileKind", json);
|
| }
|
|
|
| @override
|
| - int get hashCode {
|
| - return 438975893;
|
| - }
|
| + String toString() => "FileKind.$name";
|
| +
|
| + String toJson() => name;
|
| }
|
|
|
| /**
|
| - * moveFile options
|
| + * GeneralAnalysisService
|
| *
|
| - * {
|
| - * "newFile": FilePath
|
| + * enum {
|
| + * ANALYZED_FILES
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class MoveFileOptions extends RefactoringOptions {
|
| - String _newFile;
|
| +class GeneralAnalysisService implements Enum {
|
| + static const GeneralAnalysisService ANALYZED_FILES =
|
| + const GeneralAnalysisService._("ANALYZED_FILES");
|
|
|
| /**
|
| - * The new file path to which the given file is being moved.
|
| + * A list containing all of the enum values that are defined.
|
| */
|
| - String get newFile => _newFile;
|
| + static const List<GeneralAnalysisService> VALUES =
|
| + const <GeneralAnalysisService>[ANALYZED_FILES];
|
|
|
| - /**
|
| - * The new file path to which the given file is being moved.
|
| - */
|
| - void set newFile(String value) {
|
| - assert(value != null);
|
| - this._newFile = value;
|
| - }
|
| + @override
|
| + final String name;
|
|
|
| - MoveFileOptions(String newFile) {
|
| - this.newFile = newFile;
|
| + const GeneralAnalysisService._(this.name);
|
| +
|
| + factory GeneralAnalysisService(String name) {
|
| + switch (name) {
|
| + case "ANALYZED_FILES":
|
| + return ANALYZED_FILES;
|
| + }
|
| + throw new Exception('Illegal enum value: $name');
|
| }
|
|
|
| - factory MoveFileOptions.fromJson(
|
| + factory GeneralAnalysisService.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - String newFile;
|
| - if (json.containsKey("newFile")) {
|
| - newFile =
|
| - jsonDecoder.decodeString(jsonPath + ".newFile", json["newFile"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "newFile");
|
| + if (json is String) {
|
| + try {
|
| + return new GeneralAnalysisService(json);
|
| + } catch (_) {
|
| + // Fall through
|
| }
|
| - return new MoveFileOptions(newFile);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "moveFile options", json);
|
| }
|
| + throw jsonDecoder.mismatch(jsonPath, "GeneralAnalysisService", json);
|
| }
|
|
|
| - factory MoveFileOptions.fromRefactoringParams(
|
| - EditGetRefactoringParams refactoringParams, Request request) {
|
| - return new MoveFileOptions.fromJson(
|
| - new RequestDecoder(request), "options", refactoringParams.options);
|
| - }
|
| -
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - result["newFile"] = newFile;
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| @override
|
| - bool operator ==(other) {
|
| - if (other is MoveFileOptions) {
|
| - return newFile == other.newFile;
|
| - }
|
| - return false;
|
| - }
|
| + String toString() => "GeneralAnalysisService.$name";
|
|
|
| - @override
|
| - int get hashCode {
|
| - int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, newFile.hashCode);
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| + String toJson() => name;
|
| }
|
|
|
| /**
|
| - * NavigationRegion
|
| + * HoverInformation
|
| *
|
| * {
|
| * "offset": int
|
| * "length": int
|
| - * "targets": List<int>
|
| + * "containingLibraryPath": optional String
|
| + * "containingLibraryName": optional String
|
| + * "containingClassDescription": optional String
|
| + * "dartdoc": optional String
|
| + * "elementDescription": optional String
|
| + * "elementKind": optional String
|
| + * "isDeprecated": optional bool
|
| + * "parameter": optional String
|
| + * "propagatedType": optional String
|
| + * "staticType": optional String
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class NavigationRegion implements HasToJson {
|
| +class HoverInformation implements HasToJson {
|
| int _offset;
|
|
|
| int _length;
|
|
|
| - List<int> _targets;
|
| + String _containingLibraryPath;
|
| +
|
| + String _containingLibraryName;
|
| +
|
| + String _containingClassDescription;
|
| +
|
| + String _dartdoc;
|
| +
|
| + String _elementDescription;
|
| +
|
| + String _elementKind;
|
| +
|
| + bool _isDeprecated;
|
| +
|
| + String _parameter;
|
| +
|
| + String _propagatedType;
|
| +
|
| + String _staticType;
|
|
|
| /**
|
| - * The offset of the region from which the user can navigate.
|
| + * The offset of the range of characters that encompasses the cursor position
|
| + * and has the same hover information as the cursor position.
|
| */
|
| int get offset => _offset;
|
|
|
| /**
|
| - * The offset of the region from which the user can navigate.
|
| + * The offset of the range of characters that encompasses the cursor position
|
| + * and has the same hover information as the cursor position.
|
| */
|
| void set offset(int value) {
|
| assert(value != null);
|
| @@ -13472,12 +8988,14 @@ class NavigationRegion implements HasToJson {
|
| }
|
|
|
| /**
|
| - * The length of the region from which the user can navigate.
|
| + * The length of the range of characters that encompasses the cursor position
|
| + * and has the same hover information as the cursor position.
|
| */
|
| int get length => _length;
|
|
|
| /**
|
| - * The length of the region from which the user can navigate.
|
| + * The length of the range of characters that encompasses the cursor position
|
| + * and has the same hover information as the cursor position.
|
| */
|
| void set length(int value) {
|
| assert(value != null);
|
| @@ -13485,232 +9003,190 @@ class NavigationRegion implements HasToJson {
|
| }
|
|
|
| /**
|
| - * The indexes of the targets (in the enclosing navigation response) to which
|
| - * the given region is bound. By opening the target, clients can implement
|
| - * one form of navigation. This list cannot be empty.
|
| + * 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, or if the element is declared inside an HTML file.
|
| */
|
| - List<int> get targets => _targets;
|
| + String get containingLibraryPath => _containingLibraryPath;
|
|
|
| /**
|
| - * The indexes of the targets (in the enclosing navigation response) to which
|
| - * the given region is bound. By opening the target, clients can implement
|
| - * one form of navigation. This list cannot be empty.
|
| + * 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, or if the element is declared inside an HTML file.
|
| */
|
| - void set targets(List<int> value) {
|
| - assert(value != null);
|
| - this._targets = value;
|
| - }
|
| -
|
| - NavigationRegion(int offset, int length, List<int> targets) {
|
| - this.offset = offset;
|
| - this.length = length;
|
| - this.targets = targets;
|
| + void set containingLibraryPath(String value) {
|
| + this._containingLibraryPath = value;
|
| }
|
|
|
| - factory NavigationRegion.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - int offset;
|
| - if (json.containsKey("offset")) {
|
| - offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "offset");
|
| - }
|
| - int length;
|
| - if (json.containsKey("length")) {
|
| - length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "length");
|
| - }
|
| - List<int> targets;
|
| - if (json.containsKey("targets")) {
|
| - targets = jsonDecoder.decodeList(
|
| - jsonPath + ".targets", json["targets"], jsonDecoder.decodeInt);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "targets");
|
| - }
|
| - return new NavigationRegion(offset, length, targets);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "NavigationRegion", json);
|
| - }
|
| - }
|
| + /**
|
| + * The name of the library in which the referenced element is declared. This
|
| + * data is omitted if there is no referenced element, or if the element is
|
| + * declared inside an HTML file.
|
| + */
|
| + String get containingLibraryName => _containingLibraryName;
|
|
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - result["offset"] = offset;
|
| - result["length"] = length;
|
| - result["targets"] = targets;
|
| - return result;
|
| + /**
|
| + * The name of the library in which the referenced element is declared. This
|
| + * data is omitted if there is no referenced element, or if the element is
|
| + * declared inside an HTML file.
|
| + */
|
| + void set containingLibraryName(String value) {
|
| + this._containingLibraryName = value;
|
| }
|
|
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is NavigationRegion) {
|
| - return offset == other.offset &&
|
| - length == other.length &&
|
| - listEqual(targets, other.targets, (int a, int b) => a == b);
|
| - }
|
| - return false;
|
| - }
|
| + /**
|
| + * A human-readable description of the class declaring the element being
|
| + * referenced. This data is omitted if there is no referenced element, or if
|
| + * the element is not a class member.
|
| + */
|
| + String get containingClassDescription => _containingClassDescription;
|
|
|
| - @override
|
| - 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);
|
| + /**
|
| + * A human-readable description of the class declaring the element being
|
| + * referenced. This data is omitted if there is no referenced element, or if
|
| + * the element is not a class member.
|
| + */
|
| + void set containingClassDescription(String value) {
|
| + this._containingClassDescription = value;
|
| }
|
| -}
|
| -
|
| -/**
|
| - * NavigationTarget
|
| - *
|
| - * {
|
| - * "kind": ElementKind
|
| - * "fileIndex": int
|
| - * "offset": int
|
| - * "length": int
|
| - * "startLine": int
|
| - * "startColumn": int
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class NavigationTarget implements HasToJson {
|
| - ElementKind _kind;
|
| -
|
| - int _fileIndex;
|
| -
|
| - int _offset;
|
| -
|
| - int _length;
|
|
|
| - int _startLine;
|
| + /**
|
| + * 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, or if the element has no dartdoc.
|
| + */
|
| + String get dartdoc => _dartdoc;
|
|
|
| - int _startColumn;
|
| + /**
|
| + * 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, or if the element has no dartdoc.
|
| + */
|
| + void set dartdoc(String value) {
|
| + this._dartdoc = value;
|
| + }
|
|
|
| /**
|
| - * The kind of the element.
|
| + * A human-readable description of the element being referenced. This data is
|
| + * omitted if there is no referenced element.
|
| */
|
| - ElementKind get kind => _kind;
|
| + String get elementDescription => _elementDescription;
|
|
|
| /**
|
| - * The kind of the element.
|
| + * A human-readable description of the element being referenced. This data is
|
| + * omitted if there is no referenced element.
|
| */
|
| - void set kind(ElementKind value) {
|
| - assert(value != null);
|
| - this._kind = value;
|
| + void set elementDescription(String value) {
|
| + this._elementDescription = value;
|
| }
|
|
|
| /**
|
| - * The index of the file (in the enclosing navigation response) to navigate
|
| - * to.
|
| + * 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.
|
| */
|
| - int get fileIndex => _fileIndex;
|
| + String get elementKind => _elementKind;
|
|
|
| /**
|
| - * The index of the file (in the enclosing navigation response) to navigate
|
| - * to.
|
| + * 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.
|
| */
|
| - void set fileIndex(int value) {
|
| - assert(value != null);
|
| - this._fileIndex = value;
|
| + void set elementKind(String value) {
|
| + this._elementKind = value;
|
| }
|
|
|
| /**
|
| - * The offset of the region to which the user can navigate.
|
| + * True if the referenced element is deprecated.
|
| */
|
| - int get offset => _offset;
|
| + bool get isDeprecated => _isDeprecated;
|
|
|
| /**
|
| - * The offset of the region to which the user can navigate.
|
| + * True if the referenced element is deprecated.
|
| */
|
| - void set offset(int value) {
|
| - assert(value != null);
|
| - this._offset = value;
|
| + void set isDeprecated(bool value) {
|
| + this._isDeprecated = value;
|
| }
|
|
|
| /**
|
| - * The length of the region to which the user can navigate.
|
| + * 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.
|
| */
|
| - int get length => _length;
|
| + String get parameter => _parameter;
|
|
|
| /**
|
| - * The length of the region to which the user can navigate.
|
| + * 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.
|
| */
|
| - void set length(int value) {
|
| - assert(value != null);
|
| - this._length = value;
|
| + void set parameter(String value) {
|
| + this._parameter = value;
|
| }
|
|
|
| /**
|
| - * The one-based index of the line containing the first character of the
|
| - * region.
|
| + * 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.
|
| */
|
| - int get startLine => _startLine;
|
| + String get propagatedType => _propagatedType;
|
|
|
| /**
|
| - * The one-based index of the line containing the first character of the
|
| - * region.
|
| + * 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.
|
| */
|
| - void set startLine(int value) {
|
| - assert(value != null);
|
| - this._startLine = value;
|
| + void set propagatedType(String value) {
|
| + this._propagatedType = value;
|
| }
|
|
|
| /**
|
| - * The one-based index of the column containing the first character of the
|
| - * region.
|
| + * The name of the static type of the expression. This data is omitted if the
|
| + * location does not correspond to an expression.
|
| */
|
| - int get startColumn => _startColumn;
|
| + String get staticType => _staticType;
|
|
|
| /**
|
| - * The one-based index of the column containing the first character of the
|
| - * region.
|
| + * The name of the static type of the expression. This data is omitted if the
|
| + * location does not correspond to an expression.
|
| */
|
| - void set startColumn(int value) {
|
| - assert(value != null);
|
| - this._startColumn = value;
|
| + void set staticType(String value) {
|
| + this._staticType = value;
|
| }
|
|
|
| - NavigationTarget(ElementKind kind, int fileIndex, int offset, int length,
|
| - int startLine, int startColumn) {
|
| - this.kind = kind;
|
| - this.fileIndex = fileIndex;
|
| + HoverInformation(int offset, int length,
|
| + {String containingLibraryPath,
|
| + String containingLibraryName,
|
| + String containingClassDescription,
|
| + String dartdoc,
|
| + String elementDescription,
|
| + String elementKind,
|
| + bool isDeprecated,
|
| + String parameter,
|
| + String propagatedType,
|
| + String staticType}) {
|
| this.offset = offset;
|
| this.length = length;
|
| - this.startLine = startLine;
|
| - this.startColumn = startColumn;
|
| + this.containingLibraryPath = containingLibraryPath;
|
| + this.containingLibraryName = containingLibraryName;
|
| + this.containingClassDescription = containingClassDescription;
|
| + this.dartdoc = dartdoc;
|
| + this.elementDescription = elementDescription;
|
| + this.elementKind = elementKind;
|
| + this.isDeprecated = isDeprecated;
|
| + this.parameter = parameter;
|
| + this.propagatedType = propagatedType;
|
| + this.staticType = staticType;
|
| }
|
|
|
| - factory NavigationTarget.fromJson(
|
| + factory HoverInformation.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - ElementKind kind;
|
| - if (json.containsKey("kind")) {
|
| - kind = new ElementKind.fromJson(
|
| - jsonDecoder, jsonPath + ".kind", json["kind"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "kind");
|
| - }
|
| - int fileIndex;
|
| - if (json.containsKey("fileIndex")) {
|
| - fileIndex =
|
| - jsonDecoder.decodeInt(jsonPath + ".fileIndex", json["fileIndex"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "fileIndex");
|
| - }
|
| int offset;
|
| if (json.containsKey("offset")) {
|
| offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
|
| @@ -13723,169 +9199,108 @@ class NavigationTarget implements HasToJson {
|
| } else {
|
| throw jsonDecoder.mismatch(jsonPath, "length");
|
| }
|
| - int startLine;
|
| - if (json.containsKey("startLine")) {
|
| - startLine =
|
| - jsonDecoder.decodeInt(jsonPath + ".startLine", json["startLine"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "startLine");
|
| + String containingLibraryPath;
|
| + if (json.containsKey("containingLibraryPath")) {
|
| + containingLibraryPath = jsonDecoder.decodeString(
|
| + jsonPath + ".containingLibraryPath", json["containingLibraryPath"]);
|
| }
|
| - int startColumn;
|
| - if (json.containsKey("startColumn")) {
|
| - startColumn = jsonDecoder.decodeInt(
|
| - jsonPath + ".startColumn", json["startColumn"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "startColumn");
|
| + String containingLibraryName;
|
| + if (json.containsKey("containingLibraryName")) {
|
| + containingLibraryName = jsonDecoder.decodeString(
|
| + jsonPath + ".containingLibraryName", json["containingLibraryName"]);
|
| }
|
| - return new NavigationTarget(
|
| - kind, fileIndex, offset, length, startLine, startColumn);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "NavigationTarget", json);
|
| - }
|
| - }
|
| -
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - result["kind"] = kind.toJson();
|
| - result["fileIndex"] = fileIndex;
|
| - result["offset"] = offset;
|
| - result["length"] = length;
|
| - result["startLine"] = startLine;
|
| - result["startColumn"] = startColumn;
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is NavigationTarget) {
|
| - return kind == other.kind &&
|
| - fileIndex == other.fileIndex &&
|
| - offset == other.offset &&
|
| - length == other.length &&
|
| - startLine == other.startLine &&
|
| - startColumn == other.startColumn;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, kind.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, fileIndex.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);
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * Occurrences
|
| - *
|
| - * {
|
| - * "element": Element
|
| - * "offsets": List<int>
|
| - * "length": int
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class Occurrences implements HasToJson {
|
| - Element _element;
|
| -
|
| - List<int> _offsets;
|
| -
|
| - int _length;
|
| -
|
| - /**
|
| - * The element that was referenced.
|
| - */
|
| - Element get element => _element;
|
| -
|
| - /**
|
| - * The element that was referenced.
|
| - */
|
| - void set element(Element value) {
|
| - assert(value != null);
|
| - this._element = value;
|
| - }
|
| -
|
| - /**
|
| - * The offsets of the name of the referenced element within the file.
|
| - */
|
| - List<int> get offsets => _offsets;
|
| -
|
| - /**
|
| - * The offsets of the name of the referenced element within the file.
|
| - */
|
| - void set offsets(List<int> value) {
|
| - assert(value != null);
|
| - this._offsets = value;
|
| - }
|
| -
|
| - /**
|
| - * The length of the name of the referenced element.
|
| - */
|
| - int get length => _length;
|
| -
|
| - /**
|
| - * The length of the name of the referenced element.
|
| - */
|
| - void set length(int value) {
|
| - assert(value != null);
|
| - this._length = value;
|
| - }
|
| -
|
| - Occurrences(Element element, List<int> offsets, int length) {
|
| - this.element = element;
|
| - this.offsets = offsets;
|
| - this.length = length;
|
| - }
|
| -
|
| - factory Occurrences.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - Element element;
|
| - if (json.containsKey("element")) {
|
| - element = new Element.fromJson(
|
| - jsonDecoder, jsonPath + ".element", json["element"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "element");
|
| + String containingClassDescription;
|
| + if (json.containsKey("containingClassDescription")) {
|
| + containingClassDescription = jsonDecoder.decodeString(
|
| + jsonPath + ".containingClassDescription",
|
| + json["containingClassDescription"]);
|
| }
|
| - List<int> offsets;
|
| - if (json.containsKey("offsets")) {
|
| - offsets = jsonDecoder.decodeList(
|
| - jsonPath + ".offsets", json["offsets"], jsonDecoder.decodeInt);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "offsets");
|
| + String dartdoc;
|
| + if (json.containsKey("dartdoc")) {
|
| + dartdoc =
|
| + jsonDecoder.decodeString(jsonPath + ".dartdoc", json["dartdoc"]);
|
| }
|
| - int length;
|
| - if (json.containsKey("length")) {
|
| - length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "length");
|
| + String elementDescription;
|
| + if (json.containsKey("elementDescription")) {
|
| + elementDescription = jsonDecoder.decodeString(
|
| + jsonPath + ".elementDescription", json["elementDescription"]);
|
| + }
|
| + String elementKind;
|
| + if (json.containsKey("elementKind")) {
|
| + elementKind = jsonDecoder.decodeString(
|
| + jsonPath + ".elementKind", json["elementKind"]);
|
| + }
|
| + bool isDeprecated;
|
| + if (json.containsKey("isDeprecated")) {
|
| + isDeprecated = jsonDecoder.decodeBool(
|
| + jsonPath + ".isDeprecated", json["isDeprecated"]);
|
| + }
|
| + String parameter;
|
| + if (json.containsKey("parameter")) {
|
| + parameter = jsonDecoder.decodeString(
|
| + jsonPath + ".parameter", json["parameter"]);
|
| + }
|
| + String propagatedType;
|
| + if (json.containsKey("propagatedType")) {
|
| + propagatedType = jsonDecoder.decodeString(
|
| + jsonPath + ".propagatedType", json["propagatedType"]);
|
| + }
|
| + String staticType;
|
| + if (json.containsKey("staticType")) {
|
| + staticType = jsonDecoder.decodeString(
|
| + jsonPath + ".staticType", json["staticType"]);
|
| }
|
| - return new Occurrences(element, offsets, length);
|
| + return new HoverInformation(offset, length,
|
| + containingLibraryPath: containingLibraryPath,
|
| + containingLibraryName: containingLibraryName,
|
| + containingClassDescription: containingClassDescription,
|
| + dartdoc: dartdoc,
|
| + elementDescription: elementDescription,
|
| + elementKind: elementKind,
|
| + isDeprecated: isDeprecated,
|
| + parameter: parameter,
|
| + propagatedType: propagatedType,
|
| + staticType: staticType);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "Occurrences", json);
|
| + throw jsonDecoder.mismatch(jsonPath, "HoverInformation", json);
|
| }
|
| }
|
|
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| - result["element"] = element.toJson();
|
| - result["offsets"] = offsets;
|
| + result["offset"] = offset;
|
| result["length"] = length;
|
| + if (containingLibraryPath != null) {
|
| + result["containingLibraryPath"] = containingLibraryPath;
|
| + }
|
| + if (containingLibraryName != null) {
|
| + result["containingLibraryName"] = containingLibraryName;
|
| + }
|
| + if (containingClassDescription != null) {
|
| + result["containingClassDescription"] = containingClassDescription;
|
| + }
|
| + if (dartdoc != null) {
|
| + result["dartdoc"] = dartdoc;
|
| + }
|
| + if (elementDescription != null) {
|
| + result["elementDescription"] = elementDescription;
|
| + }
|
| + if (elementKind != null) {
|
| + result["elementKind"] = elementKind;
|
| + }
|
| + if (isDeprecated != null) {
|
| + result["isDeprecated"] = isDeprecated;
|
| + }
|
| + if (parameter != null) {
|
| + result["parameter"] = parameter;
|
| + }
|
| + if (propagatedType != null) {
|
| + result["propagatedType"] = propagatedType;
|
| + }
|
| + if (staticType != null) {
|
| + result["staticType"] = staticType;
|
| + }
|
| return result;
|
| }
|
|
|
| @@ -13894,10 +9309,19 @@ class Occurrences implements HasToJson {
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is Occurrences) {
|
| - return element == other.element &&
|
| - listEqual(offsets, other.offsets, (int a, int b) => a == b) &&
|
| - length == other.length;
|
| + if (other is HoverInformation) {
|
| + return offset == other.offset &&
|
| + length == other.length &&
|
| + containingLibraryPath == other.containingLibraryPath &&
|
| + containingLibraryName == other.containingLibraryName &&
|
| + containingClassDescription == other.containingClassDescription &&
|
| + dartdoc == other.dartdoc &&
|
| + elementDescription == other.elementDescription &&
|
| + elementKind == other.elementKind &&
|
| + isDeprecated == other.isDeprecated &&
|
| + parameter == other.parameter &&
|
| + propagatedType == other.propagatedType &&
|
| + staticType == other.staticType;
|
| }
|
| return false;
|
| }
|
| @@ -13905,60 +9329,44 @@ class Occurrences implements HasToJson {
|
| @override
|
| int get hashCode {
|
| int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, element.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, offsets.hashCode);
|
| + 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, containingClassDescription.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, dartdoc.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, elementDescription.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, elementKind.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, isDeprecated.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, parameter.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, propagatedType.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, staticType.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * Outline
|
| + * ImplementedClass
|
| *
|
| * {
|
| - * "element": Element
|
| * "offset": int
|
| * "length": int
|
| - * "children": optional List<Outline>
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class Outline implements HasToJson {
|
| - Element _element;
|
| -
|
| +class ImplementedClass implements HasToJson {
|
| int _offset;
|
|
|
| int _length;
|
|
|
| - List<Outline> _children;
|
| -
|
| - /**
|
| - * A description of the element represented by this node.
|
| - */
|
| - Element get element => _element;
|
| -
|
| - /**
|
| - * A description of the element represented by this node.
|
| - */
|
| - void set element(Element value) {
|
| - assert(value != null);
|
| - this._element = value;
|
| - }
|
| -
|
| /**
|
| - * 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.
|
| + * The offset of the name of the implemented class.
|
| */
|
| int get offset => _offset;
|
|
|
| /**
|
| - * 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.
|
| + * The offset of the name of the implemented class.
|
| */
|
| void set offset(int value) {
|
| assert(value != null);
|
| @@ -13966,52 +9374,29 @@ class Outline implements HasToJson {
|
| }
|
|
|
| /**
|
| - * The length of the element.
|
| + * The length of the name of the implemented class.
|
| */
|
| int get length => _length;
|
|
|
| /**
|
| - * The length of the element.
|
| + * The length of the name of the implemented class.
|
| */
|
| void set length(int value) {
|
| assert(value != null);
|
| this._length = value;
|
| }
|
|
|
| - /**
|
| - * The children of the node. The field will be omitted if the node has no
|
| - * children.
|
| - */
|
| - List<Outline> get children => _children;
|
| -
|
| - /**
|
| - * The children of the node. The field will be omitted if the node has no
|
| - * children.
|
| - */
|
| - void set children(List<Outline> value) {
|
| - this._children = value;
|
| - }
|
| -
|
| - Outline(Element element, int offset, int length, {List<Outline> children}) {
|
| - this.element = element;
|
| + ImplementedClass(int offset, int length) {
|
| this.offset = offset;
|
| this.length = length;
|
| - this.children = children;
|
| }
|
|
|
| - factory Outline.fromJson(
|
| + factory ImplementedClass.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - Element element;
|
| - if (json.containsKey("element")) {
|
| - element = new Element.fromJson(
|
| - jsonDecoder, jsonPath + ".element", json["element"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "element");
|
| - }
|
| int offset;
|
| if (json.containsKey("offset")) {
|
| offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
|
| @@ -14024,30 +9409,17 @@ class Outline implements HasToJson {
|
| } else {
|
| throw jsonDecoder.mismatch(jsonPath, "length");
|
| }
|
| - List<Outline> children;
|
| - if (json.containsKey("children")) {
|
| - children = jsonDecoder.decodeList(
|
| - jsonPath + ".children",
|
| - json["children"],
|
| - (String jsonPath, Object json) =>
|
| - new Outline.fromJson(jsonDecoder, jsonPath, json));
|
| - }
|
| - return new Outline(element, offset, length, children: children);
|
| + return new ImplementedClass(offset, length);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "Outline", json);
|
| + throw jsonDecoder.mismatch(jsonPath, "ImplementedClass", json);
|
| }
|
| }
|
|
|
| @override
|
| 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()).toList();
|
| - }
|
| return result;
|
| }
|
|
|
| @@ -14056,11 +9428,8 @@ class Outline implements HasToJson {
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is Outline) {
|
| - return element == other.element &&
|
| - offset == other.offset &&
|
| - length == other.length &&
|
| - listEqual(children, other.children, (Outline a, Outline b) => a == b);
|
| + if (other is ImplementedClass) {
|
| + return offset == other.offset && length == other.length;
|
| }
|
| return false;
|
| }
|
| @@ -14068,91 +9437,87 @@ class Outline implements HasToJson {
|
| @override
|
| 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);
|
| }
|
| }
|
|
|
| /**
|
| - * OverriddenMember
|
| + * ImplementedMember
|
| *
|
| * {
|
| - * "element": Element
|
| - * "className": String
|
| + * "offset": int
|
| + * "length": int
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class OverriddenMember implements HasToJson {
|
| - Element _element;
|
| +class ImplementedMember implements HasToJson {
|
| + int _offset;
|
|
|
| - String _className;
|
| + int _length;
|
|
|
| /**
|
| - * The element that is being overridden.
|
| + * The offset of the name of the implemented member.
|
| */
|
| - Element get element => _element;
|
| + int get offset => _offset;
|
|
|
| /**
|
| - * The element that is being overridden.
|
| + * The offset of the name of the implemented member.
|
| */
|
| - void set element(Element value) {
|
| + void set offset(int value) {
|
| assert(value != null);
|
| - this._element = value;
|
| + this._offset = value;
|
| }
|
|
|
| /**
|
| - * The name of the class in which the member is defined.
|
| + * The length of the name of the implemented member.
|
| */
|
| - String get className => _className;
|
| + int get length => _length;
|
|
|
| /**
|
| - * The name of the class in which the member is defined.
|
| + * The length of the name of the implemented member.
|
| */
|
| - void set className(String value) {
|
| + void set length(int value) {
|
| assert(value != null);
|
| - this._className = value;
|
| + this._length = value;
|
| }
|
|
|
| - OverriddenMember(Element element, String className) {
|
| - this.element = element;
|
| - this.className = className;
|
| + ImplementedMember(int offset, int length) {
|
| + this.offset = offset;
|
| + this.length = length;
|
| }
|
|
|
| - factory OverriddenMember.fromJson(
|
| + factory ImplementedMember.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - Element element;
|
| - if (json.containsKey("element")) {
|
| - element = new Element.fromJson(
|
| - jsonDecoder, jsonPath + ".element", json["element"]);
|
| + int offset;
|
| + if (json.containsKey("offset")) {
|
| + offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "element");
|
| + throw jsonDecoder.mismatch(jsonPath, "offset");
|
| }
|
| - String className;
|
| - if (json.containsKey("className")) {
|
| - className = jsonDecoder.decodeString(
|
| - jsonPath + ".className", json["className"]);
|
| + int length;
|
| + if (json.containsKey("length")) {
|
| + length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "className");
|
| + throw jsonDecoder.mismatch(jsonPath, "length");
|
| }
|
| - return new OverriddenMember(element, className);
|
| + return new ImplementedMember(offset, length);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "OverriddenMember", json);
|
| + throw jsonDecoder.mismatch(jsonPath, "ImplementedMember", json);
|
| }
|
| }
|
|
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| - result["element"] = element.toJson();
|
| - result["className"] = className;
|
| + result["offset"] = offset;
|
| + result["length"] = length;
|
| return result;
|
| }
|
|
|
| @@ -14161,8 +9526,8 @@ class OverriddenMember implements HasToJson {
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is OverriddenMember) {
|
| - return element == other.element && className == other.className;
|
| + if (other is ImplementedMember) {
|
| + return offset == other.offset && length == other.length;
|
| }
|
| return false;
|
| }
|
| @@ -14170,152 +9535,89 @@ class OverriddenMember implements HasToJson {
|
| @override
|
| int get hashCode {
|
| int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, element.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, className.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, offset.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, length.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * Override
|
| + * inlineLocalVariable feedback
|
| *
|
| * {
|
| - * "offset": int
|
| - * "length": int
|
| - * "superclassMember": optional OverriddenMember
|
| - * "interfaceMembers": optional List<OverriddenMember>
|
| + * "name": String
|
| + * "occurrences": int
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class Override implements HasToJson {
|
| - int _offset;
|
| -
|
| - int _length;
|
| -
|
| - OverriddenMember _superclassMember;
|
| -
|
| - List<OverriddenMember> _interfaceMembers;
|
| -
|
| - /**
|
| - * The offset of the name of the overriding member.
|
| - */
|
| - int get offset => _offset;
|
| +class InlineLocalVariableFeedback extends RefactoringFeedback {
|
| + String _name;
|
|
|
| - /**
|
| - * The offset of the name of the overriding member.
|
| - */
|
| - void set offset(int value) {
|
| - assert(value != null);
|
| - this._offset = value;
|
| - }
|
| + int _occurrences;
|
|
|
| /**
|
| - * The length of the name of the overriding member.
|
| + * The name of the variable being inlined.
|
| */
|
| - int get length => _length;
|
| + String get name => _name;
|
|
|
| /**
|
| - * The length of the name of the overriding member.
|
| + * The name of the variable being inlined.
|
| */
|
| - void set length(int value) {
|
| + void set name(String value) {
|
| assert(value != null);
|
| - this._length = value;
|
| - }
|
| -
|
| - /**
|
| - * 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.
|
| - */
|
| - OverriddenMember get superclassMember => _superclassMember;
|
| -
|
| - /**
|
| - * 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.
|
| - */
|
| - void set superclassMember(OverriddenMember value) {
|
| - this._superclassMember = value;
|
| + this._name = value;
|
| }
|
|
|
| /**
|
| - * 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.
|
| + * The number of times the variable occurs.
|
| */
|
| - List<OverriddenMember> get interfaceMembers => _interfaceMembers;
|
| + int get occurrences => _occurrences;
|
|
|
| /**
|
| - * 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.
|
| + * The number of times the variable occurs.
|
| */
|
| - void set interfaceMembers(List<OverriddenMember> value) {
|
| - this._interfaceMembers = value;
|
| + void set occurrences(int value) {
|
| + assert(value != null);
|
| + this._occurrences = value;
|
| }
|
|
|
| - Override(int offset, int length,
|
| - {OverriddenMember superclassMember,
|
| - List<OverriddenMember> interfaceMembers}) {
|
| - this.offset = offset;
|
| - this.length = length;
|
| - this.superclassMember = superclassMember;
|
| - this.interfaceMembers = interfaceMembers;
|
| + InlineLocalVariableFeedback(String name, int occurrences) {
|
| + this.name = name;
|
| + this.occurrences = occurrences;
|
| }
|
|
|
| - factory Override.fromJson(
|
| + factory InlineLocalVariableFeedback.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - int offset;
|
| - if (json.containsKey("offset")) {
|
| - offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
|
| + String name;
|
| + if (json.containsKey("name")) {
|
| + name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "offset");
|
| + throw jsonDecoder.mismatch(jsonPath, "name");
|
| }
|
| - int length;
|
| - if (json.containsKey("length")) {
|
| - length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
|
| + int occurrences;
|
| + if (json.containsKey("occurrences")) {
|
| + occurrences = jsonDecoder.decodeInt(
|
| + jsonPath + ".occurrences", json["occurrences"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "length");
|
| - }
|
| - OverriddenMember superclassMember;
|
| - if (json.containsKey("superclassMember")) {
|
| - superclassMember = new OverriddenMember.fromJson(jsonDecoder,
|
| - jsonPath + ".superclassMember", json["superclassMember"]);
|
| - }
|
| - List<OverriddenMember> interfaceMembers;
|
| - if (json.containsKey("interfaceMembers")) {
|
| - interfaceMembers = jsonDecoder.decodeList(
|
| - jsonPath + ".interfaceMembers",
|
| - json["interfaceMembers"],
|
| - (String jsonPath, Object json) =>
|
| - new OverriddenMember.fromJson(jsonDecoder, jsonPath, json));
|
| + throw jsonDecoder.mismatch(jsonPath, "occurrences");
|
| }
|
| - return new Override(offset, length,
|
| - superclassMember: superclassMember,
|
| - interfaceMembers: interfaceMembers);
|
| + return new InlineLocalVariableFeedback(name, occurrences);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "Override", json);
|
| + throw jsonDecoder.mismatch(
|
| + jsonPath, "inlineLocalVariable feedback", json);
|
| }
|
| }
|
|
|
| @override
|
| 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())
|
| - .toList();
|
| - }
|
| + result["name"] = name;
|
| + result["occurrences"] = occurrences;
|
| return result;
|
| }
|
|
|
| @@ -14324,12 +9626,8 @@ class Override implements HasToJson {
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is Override) {
|
| - return offset == other.offset &&
|
| - length == other.length &&
|
| - superclassMember == other.superclassMember &&
|
| - listEqual(interfaceMembers, other.interfaceMembers,
|
| - (OverriddenMember a, OverriddenMember b) => a == b);
|
| + if (other is InlineLocalVariableFeedback) {
|
| + return name == other.name && occurrences == other.occurrences;
|
| }
|
| return false;
|
| }
|
| @@ -14337,89 +9635,140 @@ class Override implements HasToJson {
|
| @override
|
| 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);
|
| + hash = JenkinsSmiHash.combine(hash, name.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, occurrences.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * Position
|
| + * inlineLocalVariable options
|
| + *
|
| + * Clients may not extend, implement or mix-in this class.
|
| + */
|
| +class InlineLocalVariableOptions extends RefactoringOptions
|
| + implements HasToJson {
|
| + @override
|
| + bool operator ==(other) {
|
| + if (other is InlineLocalVariableOptions) {
|
| + return true;
|
| + }
|
| + return false;
|
| + }
|
| +
|
| + @override
|
| + int get hashCode {
|
| + return 540364977;
|
| + }
|
| +}
|
| +
|
| +/**
|
| + * inlineMethod feedback
|
| *
|
| * {
|
| - * "file": FilePath
|
| - * "offset": int
|
| + * "className": optional String
|
| + * "methodName": String
|
| + * "isDeclaration": bool
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class Position implements HasToJson {
|
| - String _file;
|
| +class InlineMethodFeedback extends RefactoringFeedback {
|
| + String _className;
|
|
|
| - int _offset;
|
| + String _methodName;
|
| +
|
| + bool _isDeclaration;
|
|
|
| /**
|
| - * The file containing the position.
|
| + * The name of the class enclosing the method being inlined. If not a class
|
| + * member is being inlined, this field will be absent.
|
| */
|
| - String get file => _file;
|
| + String get className => _className;
|
|
|
| /**
|
| - * The file containing the position.
|
| + * The name of the class enclosing the method being inlined. If not a class
|
| + * member is being inlined, this field will be absent.
|
| */
|
| - void set file(String value) {
|
| + void set className(String value) {
|
| + this._className = value;
|
| + }
|
| +
|
| + /**
|
| + * The name of the method (or function) being inlined.
|
| + */
|
| + String get methodName => _methodName;
|
| +
|
| + /**
|
| + * The name of the method (or function) being inlined.
|
| + */
|
| + void set methodName(String value) {
|
| assert(value != null);
|
| - this._file = value;
|
| + this._methodName = value;
|
| }
|
|
|
| /**
|
| - * The offset of the position.
|
| + * True if the declaration of the method is selected. So all references
|
| + * should be inlined.
|
| */
|
| - int get offset => _offset;
|
| + bool get isDeclaration => _isDeclaration;
|
|
|
| /**
|
| - * The offset of the position.
|
| + * True if the declaration of the method is selected. So all references
|
| + * should be inlined.
|
| */
|
| - void set offset(int value) {
|
| + void set isDeclaration(bool value) {
|
| assert(value != null);
|
| - this._offset = value;
|
| + this._isDeclaration = value;
|
| }
|
|
|
| - Position(String file, int offset) {
|
| - this.file = file;
|
| - this.offset = offset;
|
| + InlineMethodFeedback(String methodName, bool isDeclaration,
|
| + {String className}) {
|
| + this.className = className;
|
| + this.methodName = methodName;
|
| + this.isDeclaration = isDeclaration;
|
| }
|
|
|
| - factory Position.fromJson(
|
| + factory InlineMethodFeedback.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - String file;
|
| - if (json.containsKey("file")) {
|
| - file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
|
| + String className;
|
| + if (json.containsKey("className")) {
|
| + className = jsonDecoder.decodeString(
|
| + jsonPath + ".className", json["className"]);
|
| + }
|
| + String methodName;
|
| + if (json.containsKey("methodName")) {
|
| + methodName = jsonDecoder.decodeString(
|
| + jsonPath + ".methodName", json["methodName"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "file");
|
| + throw jsonDecoder.mismatch(jsonPath, "methodName");
|
| }
|
| - int offset;
|
| - if (json.containsKey("offset")) {
|
| - offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
|
| + bool isDeclaration;
|
| + if (json.containsKey("isDeclaration")) {
|
| + isDeclaration = jsonDecoder.decodeBool(
|
| + jsonPath + ".isDeclaration", json["isDeclaration"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "offset");
|
| + throw jsonDecoder.mismatch(jsonPath, "isDeclaration");
|
| }
|
| - return new Position(file, offset);
|
| + return new InlineMethodFeedback(methodName, isDeclaration,
|
| + className: className);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "Position", json);
|
| + throw jsonDecoder.mismatch(jsonPath, "inlineMethod feedback", json);
|
| }
|
| }
|
|
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| - result["file"] = file;
|
| - result["offset"] = offset;
|
| + if (className != null) {
|
| + result["className"] = className;
|
| + }
|
| + result["methodName"] = methodName;
|
| + result["isDeclaration"] = isDeclaration;
|
| return result;
|
| }
|
|
|
| @@ -14428,8 +9777,10 @@ class Position implements HasToJson {
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is Position) {
|
| - return file == other.file && offset == other.offset;
|
| + if (other is InlineMethodFeedback) {
|
| + return className == other.className &&
|
| + methodName == other.methodName &&
|
| + isDeclaration == other.isDeclaration;
|
| }
|
| return false;
|
| }
|
| @@ -14437,66 +9788,100 @@ class Position implements HasToJson {
|
| @override
|
| int get hashCode {
|
| int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, file.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, offset.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, className.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, methodName.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, isDeclaration.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * PubStatus
|
| + * inlineMethod options
|
| *
|
| * {
|
| - * "isListingPackageDirs": bool
|
| + * "deleteSource": bool
|
| + * "inlineAll": bool
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class PubStatus implements HasToJson {
|
| - bool _isListingPackageDirs;
|
| +class InlineMethodOptions extends RefactoringOptions {
|
| + bool _deleteSource;
|
| +
|
| + bool _inlineAll;
|
|
|
| /**
|
| - * True if the server is currently running pub to produce a list of package
|
| - * directories.
|
| + * True if the method being inlined should be removed. It is an error if this
|
| + * field is true and inlineAll is false.
|
| */
|
| - bool get isListingPackageDirs => _isListingPackageDirs;
|
| + bool get deleteSource => _deleteSource;
|
|
|
| /**
|
| - * True if the server is currently running pub to produce a list of package
|
| - * directories.
|
| + * True if the method being inlined should be removed. It is an error if this
|
| + * field is true and inlineAll is false.
|
| */
|
| - void set isListingPackageDirs(bool value) {
|
| + void set deleteSource(bool value) {
|
| assert(value != null);
|
| - this._isListingPackageDirs = value;
|
| + this._deleteSource = value;
|
| }
|
|
|
| - PubStatus(bool isListingPackageDirs) {
|
| - this.isListingPackageDirs = isListingPackageDirs;
|
| + /**
|
| + * 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.
|
| + */
|
| + bool get inlineAll => _inlineAll;
|
| +
|
| + /**
|
| + * 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.
|
| + */
|
| + void set inlineAll(bool value) {
|
| + assert(value != null);
|
| + this._inlineAll = value;
|
| }
|
|
|
| - factory PubStatus.fromJson(
|
| + InlineMethodOptions(bool deleteSource, bool inlineAll) {
|
| + this.deleteSource = deleteSource;
|
| + this.inlineAll = inlineAll;
|
| + }
|
| +
|
| + factory InlineMethodOptions.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - bool isListingPackageDirs;
|
| - if (json.containsKey("isListingPackageDirs")) {
|
| - isListingPackageDirs = jsonDecoder.decodeBool(
|
| - jsonPath + ".isListingPackageDirs", json["isListingPackageDirs"]);
|
| + bool deleteSource;
|
| + if (json.containsKey("deleteSource")) {
|
| + deleteSource = jsonDecoder.decodeBool(
|
| + jsonPath + ".deleteSource", json["deleteSource"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "isListingPackageDirs");
|
| + throw jsonDecoder.mismatch(jsonPath, "deleteSource");
|
| }
|
| - return new PubStatus(isListingPackageDirs);
|
| + bool inlineAll;
|
| + if (json.containsKey("inlineAll")) {
|
| + inlineAll =
|
| + jsonDecoder.decodeBool(jsonPath + ".inlineAll", json["inlineAll"]);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "inlineAll");
|
| + }
|
| + return new InlineMethodOptions(deleteSource, inlineAll);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "PubStatus", json);
|
| + throw jsonDecoder.mismatch(jsonPath, "inlineMethod options", json);
|
| }
|
| }
|
|
|
| + factory InlineMethodOptions.fromRefactoringParams(
|
| + EditGetRefactoringParams refactoringParams, Request request) {
|
| + return new InlineMethodOptions.fromJson(
|
| + new RequestDecoder(request), "options", refactoringParams.options);
|
| + }
|
| +
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| - result["isListingPackageDirs"] = isListingPackageDirs;
|
| + result["deleteSource"] = deleteSource;
|
| + result["inlineAll"] = inlineAll;
|
| return result;
|
| }
|
|
|
| @@ -14505,8 +9890,8 @@ class PubStatus implements HasToJson {
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is PubStatus) {
|
| - return isListingPackageDirs == other.isListingPackageDirs;
|
| + if (other is InlineMethodOptions) {
|
| + return deleteSource == other.deleteSource && inlineAll == other.inlineAll;
|
| }
|
| return false;
|
| }
|
| @@ -14514,40 +9899,21 @@ class PubStatus implements HasToJson {
|
| @override
|
| int get hashCode {
|
| int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, isListingPackageDirs.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, deleteSource.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, inlineAll.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * RefactoringFeedback
|
| - *
|
| - * {
|
| - * }
|
| + * moveFile feedback
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class RefactoringFeedback implements HasToJson {
|
| - RefactoringFeedback();
|
| -
|
| - factory RefactoringFeedback.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json, Map responseJson) {
|
| - return refactoringFeedbackFromJson(
|
| - jsonDecoder, jsonPath, json, responseJson);
|
| - }
|
| -
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| +class MoveFileFeedback extends RefactoringFeedback implements HasToJson {
|
| @override
|
| bool operator ==(other) {
|
| - if (other is RefactoringFeedback) {
|
| + if (other is MoveFileFeedback) {
|
| return true;
|
| }
|
| return false;
|
| @@ -14555,274 +9921,68 @@ class RefactoringFeedback implements HasToJson {
|
|
|
| @override
|
| int get hashCode {
|
| - int hash = 0;
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * RefactoringKind
|
| - *
|
| - * enum {
|
| - * CONVERT_GETTER_TO_METHOD
|
| - * CONVERT_METHOD_TO_GETTER
|
| - * EXTRACT_LOCAL_VARIABLE
|
| - * EXTRACT_METHOD
|
| - * INLINE_LOCAL_VARIABLE
|
| - * INLINE_METHOD
|
| - * MOVE_FILE
|
| - * RENAME
|
| - * SORT_MEMBERS
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class RefactoringKind implements Enum {
|
| - static const RefactoringKind CONVERT_GETTER_TO_METHOD =
|
| - const RefactoringKind._("CONVERT_GETTER_TO_METHOD");
|
| -
|
| - static const RefactoringKind CONVERT_METHOD_TO_GETTER =
|
| - const RefactoringKind._("CONVERT_METHOD_TO_GETTER");
|
| -
|
| - static const RefactoringKind EXTRACT_LOCAL_VARIABLE =
|
| - const RefactoringKind._("EXTRACT_LOCAL_VARIABLE");
|
| -
|
| - static const RefactoringKind EXTRACT_METHOD =
|
| - const RefactoringKind._("EXTRACT_METHOD");
|
| -
|
| - static const RefactoringKind INLINE_LOCAL_VARIABLE =
|
| - const RefactoringKind._("INLINE_LOCAL_VARIABLE");
|
| -
|
| - static const RefactoringKind INLINE_METHOD =
|
| - const RefactoringKind._("INLINE_METHOD");
|
| -
|
| - static const RefactoringKind MOVE_FILE = const RefactoringKind._("MOVE_FILE");
|
| -
|
| - static const RefactoringKind RENAME = const RefactoringKind._("RENAME");
|
| -
|
| - static const RefactoringKind SORT_MEMBERS =
|
| - const RefactoringKind._("SORT_MEMBERS");
|
| -
|
| - /**
|
| - * A list containing all of the enum values that are defined.
|
| - */
|
| - static const List<RefactoringKind> VALUES = const <RefactoringKind>[
|
| - CONVERT_GETTER_TO_METHOD,
|
| - CONVERT_METHOD_TO_GETTER,
|
| - EXTRACT_LOCAL_VARIABLE,
|
| - EXTRACT_METHOD,
|
| - INLINE_LOCAL_VARIABLE,
|
| - INLINE_METHOD,
|
| - MOVE_FILE,
|
| - RENAME,
|
| - SORT_MEMBERS
|
| - ];
|
| -
|
| - @override
|
| - 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 "MOVE_FILE":
|
| - return MOVE_FILE;
|
| - case "RENAME":
|
| - return RENAME;
|
| - case "SORT_MEMBERS":
|
| - return SORT_MEMBERS;
|
| - }
|
| - throw new Exception('Illegal enum value: $name');
|
| - }
|
| -
|
| - factory RefactoringKind.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json is String) {
|
| - try {
|
| - return new RefactoringKind(json);
|
| - } catch (_) {
|
| - // Fall through
|
| - }
|
| - }
|
| - throw jsonDecoder.mismatch(jsonPath, "RefactoringKind", json);
|
| + return 438975893;
|
| }
|
| -
|
| - @override
|
| - String toString() => "RefactoringKind.$name";
|
| -
|
| - String toJson() => name;
|
| }
|
|
|
| /**
|
| - * RefactoringMethodParameter
|
| + * moveFile options
|
| *
|
| * {
|
| - * "id": optional String
|
| - * "kind": RefactoringMethodParameterKind
|
| - * "type": String
|
| - * "name": String
|
| - * "parameters": optional String
|
| + * "newFile": FilePath
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class RefactoringMethodParameter implements HasToJson {
|
| - String _id;
|
| -
|
| - RefactoringMethodParameterKind _kind;
|
| -
|
| - String _type;
|
| -
|
| - String _name;
|
| -
|
| - String _parameters;
|
| -
|
| - /**
|
| - * The unique identifier of the parameter. Clients may omit this field for
|
| - * the parameters they want to add.
|
| - */
|
| - String get id => _id;
|
| -
|
| - /**
|
| - * The unique identifier of the parameter. Clients may omit this field for
|
| - * the parameters they want to add.
|
| - */
|
| - void set id(String value) {
|
| - this._id = value;
|
| - }
|
| -
|
| - /**
|
| - * The kind of the parameter.
|
| - */
|
| - RefactoringMethodParameterKind get kind => _kind;
|
| -
|
| - /**
|
| - * The kind of the parameter.
|
| - */
|
| - void set kind(RefactoringMethodParameterKind value) {
|
| - assert(value != null);
|
| - this._kind = value;
|
| - }
|
| -
|
| - /**
|
| - * The type that should be given to the parameter, or the return type of the
|
| - * parameter's function type.
|
| - */
|
| - String get type => _type;
|
| -
|
| - /**
|
| - * The type that should be given to the parameter, or the return type of the
|
| - * parameter's function type.
|
| - */
|
| - void set type(String value) {
|
| - assert(value != null);
|
| - this._type = value;
|
| - }
|
| +class MoveFileOptions extends RefactoringOptions {
|
| + String _newFile;
|
|
|
| /**
|
| - * The name that should be given to the parameter.
|
| + * The new file path to which the given file is being moved.
|
| */
|
| - String get name => _name;
|
| + String get newFile => _newFile;
|
|
|
| /**
|
| - * The name that should be given to the parameter.
|
| + * The new file path to which the given file is being moved.
|
| */
|
| - void set name(String value) {
|
| + void set newFile(String value) {
|
| assert(value != null);
|
| - this._name = value;
|
| - }
|
| -
|
| - /**
|
| - * 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 "()".
|
| - */
|
| - String get parameters => _parameters;
|
| -
|
| - /**
|
| - * 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 "()".
|
| - */
|
| - void set parameters(String value) {
|
| - this._parameters = value;
|
| + this._newFile = value;
|
| }
|
|
|
| - RefactoringMethodParameter(
|
| - RefactoringMethodParameterKind kind, String type, String name,
|
| - {String id, String parameters}) {
|
| - this.id = id;
|
| - this.kind = kind;
|
| - this.type = type;
|
| - this.name = name;
|
| - this.parameters = parameters;
|
| + MoveFileOptions(String newFile) {
|
| + this.newFile = newFile;
|
| }
|
|
|
| - factory RefactoringMethodParameter.fromJson(
|
| + factory MoveFileOptions.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - String id;
|
| - if (json.containsKey("id")) {
|
| - id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
|
| - }
|
| - RefactoringMethodParameterKind kind;
|
| - if (json.containsKey("kind")) {
|
| - kind = new RefactoringMethodParameterKind.fromJson(
|
| - jsonDecoder, jsonPath + ".kind", json["kind"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "kind");
|
| - }
|
| - String type;
|
| - if (json.containsKey("type")) {
|
| - type = jsonDecoder.decodeString(jsonPath + ".type", json["type"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "type");
|
| - }
|
| - String name;
|
| - if (json.containsKey("name")) {
|
| - name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]);
|
| + String newFile;
|
| + if (json.containsKey("newFile")) {
|
| + newFile =
|
| + jsonDecoder.decodeString(jsonPath + ".newFile", json["newFile"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "name");
|
| - }
|
| - String parameters;
|
| - if (json.containsKey("parameters")) {
|
| - parameters = jsonDecoder.decodeString(
|
| - jsonPath + ".parameters", json["parameters"]);
|
| + throw jsonDecoder.mismatch(jsonPath, "newFile");
|
| }
|
| - return new RefactoringMethodParameter(kind, type, name,
|
| - id: id, parameters: parameters);
|
| + return new MoveFileOptions(newFile);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "RefactoringMethodParameter", json);
|
| + throw jsonDecoder.mismatch(jsonPath, "moveFile options", json);
|
| }
|
| }
|
|
|
| + factory MoveFileOptions.fromRefactoringParams(
|
| + EditGetRefactoringParams refactoringParams, Request request) {
|
| + return new MoveFileOptions.fromJson(
|
| + new RequestDecoder(request), "options", refactoringParams.options);
|
| + }
|
| +
|
| @override
|
| 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;
|
| - }
|
| + result["newFile"] = newFile;
|
| return result;
|
| }
|
|
|
| @@ -14831,12 +9991,8 @@ class RefactoringMethodParameter implements HasToJson {
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is RefactoringMethodParameter) {
|
| - return id == other.id &&
|
| - kind == other.kind &&
|
| - type == other.type &&
|
| - name == other.name &&
|
| - parameters == other.parameters;
|
| + if (other is MoveFileOptions) {
|
| + return newFile == other.newFile;
|
| }
|
| return false;
|
| }
|
| @@ -14844,97 +10000,88 @@ class RefactoringMethodParameter implements HasToJson {
|
| @override
|
| 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);
|
| + hash = JenkinsSmiHash.combine(hash, newFile.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * RefactoringMethodParameterKind
|
| + * OverriddenMember
|
| *
|
| - * enum {
|
| - * REQUIRED
|
| - * POSITIONAL
|
| - * NAMED
|
| + * {
|
| + * "element": Element
|
| + * "className": String
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class RefactoringMethodParameterKind implements Enum {
|
| - static const RefactoringMethodParameterKind REQUIRED =
|
| - const RefactoringMethodParameterKind._("REQUIRED");
|
| +class OverriddenMember implements HasToJson {
|
| + Element _element;
|
|
|
| - static const RefactoringMethodParameterKind POSITIONAL =
|
| - const RefactoringMethodParameterKind._("POSITIONAL");
|
| + String _className;
|
|
|
| - static const RefactoringMethodParameterKind NAMED =
|
| - const RefactoringMethodParameterKind._("NAMED");
|
| + /**
|
| + * The element that is being overridden.
|
| + */
|
| + Element get element => _element;
|
|
|
| /**
|
| - * A list containing all of the enum values that are defined.
|
| + * The element that is being overridden.
|
| */
|
| - static const List<RefactoringMethodParameterKind> VALUES =
|
| - const <RefactoringMethodParameterKind>[REQUIRED, POSITIONAL, NAMED];
|
| + void set element(Element value) {
|
| + assert(value != null);
|
| + this._element = value;
|
| + }
|
|
|
| - @override
|
| - final String name;
|
| + /**
|
| + * The name of the class in which the member is defined.
|
| + */
|
| + String get className => _className;
|
|
|
| - const RefactoringMethodParameterKind._(this.name);
|
| + /**
|
| + * The name of the class in which the member is defined.
|
| + */
|
| + void set className(String value) {
|
| + assert(value != null);
|
| + this._className = value;
|
| + }
|
|
|
| - 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');
|
| + OverriddenMember(Element element, String className) {
|
| + this.element = element;
|
| + this.className = className;
|
| }
|
|
|
| - factory RefactoringMethodParameterKind.fromJson(
|
| + factory OverriddenMember.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json is String) {
|
| - try {
|
| - return new RefactoringMethodParameterKind(json);
|
| - } catch (_) {
|
| - // Fall through
|
| + if (json == null) {
|
| + json = {};
|
| + }
|
| + if (json is Map) {
|
| + Element element;
|
| + if (json.containsKey("element")) {
|
| + element = new Element.fromJson(
|
| + jsonDecoder, jsonPath + ".element", json["element"]);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "element");
|
| + }
|
| + String className;
|
| + if (json.containsKey("className")) {
|
| + className = jsonDecoder.decodeString(
|
| + jsonPath + ".className", json["className"]);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "className");
|
| }
|
| + return new OverriddenMember(element, className);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "OverriddenMember", json);
|
| }
|
| - throw jsonDecoder.mismatch(
|
| - jsonPath, "RefactoringMethodParameterKind", json);
|
| - }
|
| -
|
| - @override
|
| - String toString() => "RefactoringMethodParameterKind.$name";
|
| -
|
| - String toJson() => name;
|
| -}
|
| -
|
| -/**
|
| - * RefactoringOptions
|
| - *
|
| - * {
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class RefactoringOptions implements HasToJson {
|
| - RefactoringOptions();
|
| -
|
| - factory RefactoringOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath,
|
| - Object json, RefactoringKind kind) {
|
| - return refactoringOptionsFromJson(jsonDecoder, jsonPath, json, kind);
|
| }
|
|
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| + result["element"] = element.toJson();
|
| + result["className"] = className;
|
| return result;
|
| }
|
|
|
| @@ -14943,8 +10090,8 @@ class RefactoringOptions implements HasToJson {
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is RefactoringOptions) {
|
| - return true;
|
| + if (other is OverriddenMember) {
|
| + return element == other.element && className == other.className;
|
| }
|
| return false;
|
| }
|
| @@ -14952,115 +10099,151 @@ class RefactoringOptions implements HasToJson {
|
| @override
|
| int get hashCode {
|
| int hash = 0;
|
| + hash = JenkinsSmiHash.combine(hash, element.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, className.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * RefactoringProblem
|
| + * Override
|
| *
|
| * {
|
| - * "severity": RefactoringProblemSeverity
|
| - * "message": String
|
| - * "location": optional Location
|
| + * "offset": int
|
| + * "length": int
|
| + * "superclassMember": optional OverriddenMember
|
| + * "interfaceMembers": optional List<OverriddenMember>
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class RefactoringProblem implements HasToJson {
|
| - RefactoringProblemSeverity _severity;
|
| +class Override implements HasToJson {
|
| + int _offset;
|
|
|
| - String _message;
|
| + int _length;
|
|
|
| - Location _location;
|
| + OverriddenMember _superclassMember;
|
| +
|
| + List<OverriddenMember> _interfaceMembers;
|
|
|
| /**
|
| - * The severity of the problem being represented.
|
| + * The offset of the name of the overriding member.
|
| */
|
| - RefactoringProblemSeverity get severity => _severity;
|
| + int get offset => _offset;
|
|
|
| /**
|
| - * The severity of the problem being represented.
|
| + * The offset of the name of the overriding member.
|
| */
|
| - void set severity(RefactoringProblemSeverity value) {
|
| + void set offset(int value) {
|
| assert(value != null);
|
| - this._severity = value;
|
| + this._offset = value;
|
| }
|
|
|
| /**
|
| - * A human-readable description of the problem being represented.
|
| + * The length of the name of the overriding member.
|
| */
|
| - String get message => _message;
|
| + int get length => _length;
|
|
|
| /**
|
| - * A human-readable description of the problem being represented.
|
| + * The length of the name of the overriding member.
|
| */
|
| - void set message(String value) {
|
| + void set length(int value) {
|
| assert(value != null);
|
| - this._message = value;
|
| + this._length = value;
|
| }
|
|
|
| /**
|
| - * The location of the problem being represented. This field is omitted
|
| - * unless there is a specific location associated with the problem (such as a
|
| - * location where an element being renamed will be shadowed).
|
| + * 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.
|
| */
|
| - Location get location => _location;
|
| + OverriddenMember get superclassMember => _superclassMember;
|
|
|
| /**
|
| - * The location of the problem being represented. This field is omitted
|
| - * unless there is a specific location associated with the problem (such as a
|
| - * location where an element being renamed will be shadowed).
|
| + * 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.
|
| */
|
| - void set location(Location value) {
|
| - this._location = value;
|
| + void set superclassMember(OverriddenMember value) {
|
| + this._superclassMember = value;
|
| }
|
|
|
| - RefactoringProblem(RefactoringProblemSeverity severity, String message,
|
| - {Location location}) {
|
| - this.severity = severity;
|
| - this.message = message;
|
| - this.location = location;
|
| + /**
|
| + * 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.
|
| + */
|
| + List<OverriddenMember> get interfaceMembers => _interfaceMembers;
|
| +
|
| + /**
|
| + * 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.
|
| + */
|
| + void set interfaceMembers(List<OverriddenMember> value) {
|
| + this._interfaceMembers = value;
|
| + }
|
| +
|
| + Override(int offset, int length,
|
| + {OverriddenMember superclassMember,
|
| + List<OverriddenMember> interfaceMembers}) {
|
| + this.offset = offset;
|
| + this.length = length;
|
| + this.superclassMember = superclassMember;
|
| + this.interfaceMembers = interfaceMembers;
|
| }
|
|
|
| - factory RefactoringProblem.fromJson(
|
| + factory Override.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - RefactoringProblemSeverity severity;
|
| - if (json.containsKey("severity")) {
|
| - severity = new RefactoringProblemSeverity.fromJson(
|
| - jsonDecoder, jsonPath + ".severity", json["severity"]);
|
| + int offset;
|
| + if (json.containsKey("offset")) {
|
| + offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "severity");
|
| + throw jsonDecoder.mismatch(jsonPath, "offset");
|
| }
|
| - String message;
|
| - if (json.containsKey("message")) {
|
| - message =
|
| - jsonDecoder.decodeString(jsonPath + ".message", json["message"]);
|
| + int length;
|
| + if (json.containsKey("length")) {
|
| + length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "message");
|
| + throw jsonDecoder.mismatch(jsonPath, "length");
|
| }
|
| - Location location;
|
| - if (json.containsKey("location")) {
|
| - location = new Location.fromJson(
|
| - jsonDecoder, jsonPath + ".location", json["location"]);
|
| + OverriddenMember superclassMember;
|
| + if (json.containsKey("superclassMember")) {
|
| + superclassMember = new OverriddenMember.fromJson(jsonDecoder,
|
| + jsonPath + ".superclassMember", json["superclassMember"]);
|
| + }
|
| + List<OverriddenMember> interfaceMembers;
|
| + if (json.containsKey("interfaceMembers")) {
|
| + interfaceMembers = jsonDecoder.decodeList(
|
| + jsonPath + ".interfaceMembers",
|
| + json["interfaceMembers"],
|
| + (String jsonPath, Object json) =>
|
| + new OverriddenMember.fromJson(jsonDecoder, jsonPath, json));
|
| }
|
| - return new RefactoringProblem(severity, message, location: location);
|
| + return new Override(offset, length,
|
| + superclassMember: superclassMember,
|
| + interfaceMembers: interfaceMembers);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "RefactoringProblem", json);
|
| + throw jsonDecoder.mismatch(jsonPath, "Override", json);
|
| }
|
| }
|
|
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| - result["severity"] = severity.toJson();
|
| - result["message"] = message;
|
| - if (location != null) {
|
| - result["location"] = location.toJson();
|
| + result["offset"] = offset;
|
| + result["length"] = length;
|
| + if (superclassMember != null) {
|
| + result["superclassMember"] = superclassMember.toJson();
|
| + }
|
| + if (interfaceMembers != null) {
|
| + result["interfaceMembers"] = interfaceMembers
|
| + .map((OverriddenMember value) => value.toJson())
|
| + .toList();
|
| }
|
| return result;
|
| }
|
| @@ -15070,10 +10253,12 @@ class RefactoringProblem implements HasToJson {
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is RefactoringProblem) {
|
| - return severity == other.severity &&
|
| - message == other.message &&
|
| - location == other.location;
|
| + if (other is Override) {
|
| + return offset == other.offset &&
|
| + length == other.length &&
|
| + superclassMember == other.superclassMember &&
|
| + listEqual(interfaceMembers, other.interfaceMembers,
|
| + (OverriddenMember a, OverriddenMember b) => a == b);
|
| }
|
| return false;
|
| }
|
| @@ -15081,144 +10266,150 @@ class RefactoringProblem implements HasToJson {
|
| @override
|
| int get hashCode {
|
| int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, severity.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, message.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, location.hashCode);
|
| + 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);
|
| }
|
| }
|
|
|
| /**
|
| - * RefactoringProblemSeverity
|
| + * PubStatus
|
| *
|
| - * enum {
|
| - * INFO
|
| - * WARNING
|
| - * ERROR
|
| - * FATAL
|
| + * {
|
| + * "isListingPackageDirs": bool
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class RefactoringProblemSeverity implements Enum {
|
| - /**
|
| - * A minor code problem. No example, because it is not used yet.
|
| - */
|
| - static const RefactoringProblemSeverity INFO =
|
| - const RefactoringProblemSeverity._("INFO");
|
| +class PubStatus implements HasToJson {
|
| + bool _isListingPackageDirs;
|
|
|
| /**
|
| - * A minor code problem. For example names of local variables should be camel
|
| - * case and start with a lower case letter. Staring the name of a variable
|
| - * with an upper case is OK from the language point of view, but it is nice
|
| - * to warn the user.
|
| + * True if the server is currently running pub to produce a list of package
|
| + * directories.
|
| */
|
| - static const RefactoringProblemSeverity WARNING =
|
| - const RefactoringProblemSeverity._("WARNING");
|
| + bool get isListingPackageDirs => _isListingPackageDirs;
|
|
|
| /**
|
| - * The refactoring technically can be performed, but there is a logical
|
| - * problem. For example the name of a local variable being extracted
|
| - * conflicts with another name in the scope, or duplicate parameter names in
|
| - * the method being extracted, or a conflict between a parameter name and a
|
| - * local variable, etc. In some cases the location of the problem is also
|
| - * provided, so the IDE can show user the location and the problem, and let
|
| - * the user decide whether she wants to perform the refactoring. For example
|
| - * the name conflict might be expected, and the user wants to fix it
|
| - * afterwards.
|
| + * True if the server is currently running pub to produce a list of package
|
| + * directories.
|
| */
|
| - static const RefactoringProblemSeverity ERROR =
|
| - const RefactoringProblemSeverity._("ERROR");
|
| + void set isListingPackageDirs(bool value) {
|
| + assert(value != null);
|
| + this._isListingPackageDirs = value;
|
| + }
|
|
|
| - /**
|
| - * A fatal error, which prevents performing the refactoring. For example the
|
| - * name of a local variable being extracted is not a valid identifier, or
|
| - * selection is not a valid expression.
|
| - */
|
| - static const RefactoringProblemSeverity FATAL =
|
| - const RefactoringProblemSeverity._("FATAL");
|
| + PubStatus(bool isListingPackageDirs) {
|
| + this.isListingPackageDirs = isListingPackageDirs;
|
| + }
|
|
|
| - /**
|
| - * A list containing all of the enum values that are defined.
|
| - */
|
| - static const List<RefactoringProblemSeverity> VALUES =
|
| - const <RefactoringProblemSeverity>[INFO, WARNING, ERROR, FATAL];
|
| + factory PubStatus.fromJson(
|
| + JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| + if (json == null) {
|
| + json = {};
|
| + }
|
| + if (json is Map) {
|
| + bool isListingPackageDirs;
|
| + if (json.containsKey("isListingPackageDirs")) {
|
| + isListingPackageDirs = jsonDecoder.decodeBool(
|
| + jsonPath + ".isListingPackageDirs", json["isListingPackageDirs"]);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "isListingPackageDirs");
|
| + }
|
| + return new PubStatus(isListingPackageDirs);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "PubStatus", json);
|
| + }
|
| + }
|
|
|
| @override
|
| - final String name;
|
| + Map<String, dynamic> toJson() {
|
| + Map<String, dynamic> result = {};
|
| + result["isListingPackageDirs"] = isListingPackageDirs;
|
| + return result;
|
| + }
|
|
|
| - const RefactoringProblemSeverity._(this.name);
|
| + @override
|
| + String toString() => JSON.encode(toJson());
|
|
|
| - factory RefactoringProblemSeverity(String name) {
|
| - switch (name) {
|
| - case "INFO":
|
| - return INFO;
|
| - case "WARNING":
|
| - return WARNING;
|
| - case "ERROR":
|
| - return ERROR;
|
| - case "FATAL":
|
| - return FATAL;
|
| + @override
|
| + bool operator ==(other) {
|
| + if (other is PubStatus) {
|
| + return isListingPackageDirs == other.isListingPackageDirs;
|
| }
|
| - throw new Exception('Illegal enum value: $name');
|
| + return false;
|
| + }
|
| +
|
| + @override
|
| + int get hashCode {
|
| + int hash = 0;
|
| + hash = JenkinsSmiHash.combine(hash, isListingPackageDirs.hashCode);
|
| + return JenkinsSmiHash.finish(hash);
|
| + }
|
| +}
|
| +
|
| +/**
|
| + * RefactoringFeedback
|
| + *
|
| + * {
|
| + * }
|
| + *
|
| + * Clients may not extend, implement or mix-in this class.
|
| + */
|
| +class RefactoringFeedback implements HasToJson {
|
| + RefactoringFeedback();
|
| +
|
| + factory RefactoringFeedback.fromJson(
|
| + JsonDecoder jsonDecoder, String jsonPath, Object json, Map responseJson) {
|
| + return refactoringFeedbackFromJson(
|
| + jsonDecoder, jsonPath, json, responseJson);
|
| + }
|
| +
|
| + @override
|
| + Map<String, dynamic> toJson() {
|
| + Map<String, dynamic> result = {};
|
| + return result;
|
| }
|
|
|
| - factory RefactoringProblemSeverity.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json is String) {
|
| - try {
|
| - return new RefactoringProblemSeverity(json);
|
| - } catch (_) {
|
| - // Fall through
|
| - }
|
| + @override
|
| + String toString() => JSON.encode(toJson());
|
| +
|
| + @override
|
| + bool operator ==(other) {
|
| + if (other is RefactoringFeedback) {
|
| + return true;
|
| }
|
| - throw jsonDecoder.mismatch(jsonPath, "RefactoringProblemSeverity", json);
|
| + return false;
|
| }
|
|
|
| - /**
|
| - * Returns the [RefactoringProblemSeverity] with the maximal severity.
|
| - */
|
| - static RefactoringProblemSeverity max(
|
| - RefactoringProblemSeverity a, RefactoringProblemSeverity b) =>
|
| - maxRefactoringProblemSeverity(a, b);
|
| -
|
| @override
|
| - String toString() => "RefactoringProblemSeverity.$name";
|
| -
|
| - String toJson() => name;
|
| + int get hashCode {
|
| + int hash = 0;
|
| + return JenkinsSmiHash.finish(hash);
|
| + }
|
| }
|
|
|
| /**
|
| - * RemoveContentOverlay
|
| + * RefactoringOptions
|
| *
|
| * {
|
| - * "type": "remove"
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class RemoveContentOverlay implements HasToJson {
|
| - RemoveContentOverlay();
|
| +class RefactoringOptions implements HasToJson {
|
| + RefactoringOptions();
|
|
|
| - factory RemoveContentOverlay.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - if (json["type"] != "remove") {
|
| - throw jsonDecoder.mismatch(jsonPath, "equal " + "remove", json);
|
| - }
|
| - return new RemoveContentOverlay();
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "RemoveContentOverlay", json);
|
| - }
|
| + factory RefactoringOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath,
|
| + Object json, RefactoringKind kind) {
|
| + return refactoringOptionsFromJson(jsonDecoder, jsonPath, json, kind);
|
| }
|
|
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| - result["type"] = "remove";
|
| return result;
|
| }
|
|
|
| @@ -15227,7 +10418,7 @@ class RemoveContentOverlay implements HasToJson {
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is RemoveContentOverlay) {
|
| + if (other is RefactoringOptions) {
|
| return true;
|
| }
|
| return false;
|
| @@ -15236,7 +10427,6 @@ class RemoveContentOverlay implements HasToJson {
|
| @override
|
| int get hashCode {
|
| int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, 114870849);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
| @@ -16527,293 +11717,70 @@ class SearchFindMemberReferencesResult implements ResponseResult {
|
|
|
| /**
|
| * search.findTopLevelDeclarations params
|
| - *
|
| - * {
|
| - * "pattern": String
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class SearchFindTopLevelDeclarationsParams implements RequestParams {
|
| - String _pattern;
|
| -
|
| - /**
|
| - * The regular expression used to match the names of the declarations to be
|
| - * found.
|
| - */
|
| - String get pattern => _pattern;
|
| -
|
| - /**
|
| - * The regular expression used to match the names of the declarations to be
|
| - * found.
|
| - */
|
| - void set pattern(String value) {
|
| - assert(value != null);
|
| - this._pattern = value;
|
| - }
|
| -
|
| - SearchFindTopLevelDeclarationsParams(String pattern) {
|
| - this.pattern = pattern;
|
| - }
|
| -
|
| - factory SearchFindTopLevelDeclarationsParams.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - String pattern;
|
| - if (json.containsKey("pattern")) {
|
| - pattern =
|
| - jsonDecoder.decodeString(jsonPath + ".pattern", json["pattern"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "pattern");
|
| - }
|
| - return new SearchFindTopLevelDeclarationsParams(pattern);
|
| - } else {
|
| - throw jsonDecoder.mismatch(
|
| - jsonPath, "search.findTopLevelDeclarations params", json);
|
| - }
|
| - }
|
| -
|
| - factory SearchFindTopLevelDeclarationsParams.fromRequest(Request request) {
|
| - return new SearchFindTopLevelDeclarationsParams.fromJson(
|
| - new RequestDecoder(request), "params", request.params);
|
| - }
|
| -
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - result["pattern"] = pattern;
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| - Request toRequest(String id) {
|
| - return new Request(id, "search.findTopLevelDeclarations", toJson());
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is SearchFindTopLevelDeclarationsParams) {
|
| - return pattern == other.pattern;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, pattern.hashCode);
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * search.findTopLevelDeclarations result
|
| - *
|
| - * {
|
| - * "id": SearchId
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class SearchFindTopLevelDeclarationsResult implements ResponseResult {
|
| - String _id;
|
| -
|
| - /**
|
| - * The identifier used to associate results with this search request.
|
| - */
|
| - String get id => _id;
|
| -
|
| - /**
|
| - * The identifier used to associate results with this search request.
|
| - */
|
| - void set id(String value) {
|
| - assert(value != null);
|
| - this._id = value;
|
| - }
|
| -
|
| - SearchFindTopLevelDeclarationsResult(String id) {
|
| - this.id = id;
|
| - }
|
| -
|
| - factory SearchFindTopLevelDeclarationsResult.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - String id;
|
| - if (json.containsKey("id")) {
|
| - id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "id");
|
| - }
|
| - return new SearchFindTopLevelDeclarationsResult(id);
|
| - } else {
|
| - throw jsonDecoder.mismatch(
|
| - jsonPath, "search.findTopLevelDeclarations result", json);
|
| - }
|
| - }
|
| -
|
| - factory SearchFindTopLevelDeclarationsResult.fromResponse(Response response) {
|
| - return new SearchFindTopLevelDeclarationsResult.fromJson(
|
| - new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)),
|
| - "result",
|
| - response.result);
|
| - }
|
| -
|
| - @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - result["id"] = id;
|
| - return result;
|
| - }
|
| -
|
| - @override
|
| - Response toResponse(String id) {
|
| - return new Response(id, result: toJson());
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is SearchFindTopLevelDeclarationsResult) {
|
| - return id == other.id;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, id.hashCode);
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * search.getTypeHierarchy params
|
| - *
|
| - * {
|
| - * "file": FilePath
|
| - * "offset": int
|
| - * "superOnly": optional bool
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class SearchGetTypeHierarchyParams implements RequestParams {
|
| - String _file;
|
| -
|
| - int _offset;
|
| -
|
| - bool _superOnly;
|
| -
|
| - /**
|
| - * The file containing the declaration or reference to the type for which a
|
| - * hierarchy is being requested.
|
| - */
|
| - String get file => _file;
|
| -
|
| - /**
|
| - * The file containing the declaration or reference to the type for which a
|
| - * hierarchy is being requested.
|
| - */
|
| - void set file(String value) {
|
| - assert(value != null);
|
| - this._file = value;
|
| - }
|
| -
|
| - /**
|
| - * The offset of the name of the type within the file.
|
| - */
|
| - int get offset => _offset;
|
| -
|
| - /**
|
| - * The offset of the name of the type within the file.
|
| - */
|
| - void set offset(int value) {
|
| - assert(value != null);
|
| - this._offset = value;
|
| - }
|
| + *
|
| + * {
|
| + * "pattern": String
|
| + * }
|
| + *
|
| + * Clients may not extend, implement or mix-in this class.
|
| + */
|
| +class SearchFindTopLevelDeclarationsParams implements RequestParams {
|
| + String _pattern;
|
|
|
| /**
|
| - * True if the client is only requesting superclasses and interfaces
|
| - * hierarchy.
|
| + * The regular expression used to match the names of the declarations to be
|
| + * found.
|
| */
|
| - bool get superOnly => _superOnly;
|
| + String get pattern => _pattern;
|
|
|
| /**
|
| - * True if the client is only requesting superclasses and interfaces
|
| - * hierarchy.
|
| + * The regular expression used to match the names of the declarations to be
|
| + * found.
|
| */
|
| - void set superOnly(bool value) {
|
| - this._superOnly = value;
|
| + void set pattern(String value) {
|
| + assert(value != null);
|
| + this._pattern = value;
|
| }
|
|
|
| - SearchGetTypeHierarchyParams(String file, int offset, {bool superOnly}) {
|
| - this.file = file;
|
| - this.offset = offset;
|
| - this.superOnly = superOnly;
|
| + SearchFindTopLevelDeclarationsParams(String pattern) {
|
| + this.pattern = pattern;
|
| }
|
|
|
| - factory SearchGetTypeHierarchyParams.fromJson(
|
| + factory SearchFindTopLevelDeclarationsParams.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - String file;
|
| - if (json.containsKey("file")) {
|
| - file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "file");
|
| - }
|
| - int offset;
|
| - if (json.containsKey("offset")) {
|
| - offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
|
| + String pattern;
|
| + if (json.containsKey("pattern")) {
|
| + pattern =
|
| + jsonDecoder.decodeString(jsonPath + ".pattern", json["pattern"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "offset");
|
| - }
|
| - bool superOnly;
|
| - if (json.containsKey("superOnly")) {
|
| - superOnly =
|
| - jsonDecoder.decodeBool(jsonPath + ".superOnly", json["superOnly"]);
|
| + throw jsonDecoder.mismatch(jsonPath, "pattern");
|
| }
|
| - return new SearchGetTypeHierarchyParams(file, offset,
|
| - superOnly: superOnly);
|
| + return new SearchFindTopLevelDeclarationsParams(pattern);
|
| } else {
|
| throw jsonDecoder.mismatch(
|
| - jsonPath, "search.getTypeHierarchy params", json);
|
| + jsonPath, "search.findTopLevelDeclarations params", json);
|
| }
|
| }
|
|
|
| - factory SearchGetTypeHierarchyParams.fromRequest(Request request) {
|
| - return new SearchGetTypeHierarchyParams.fromJson(
|
| + factory SearchFindTopLevelDeclarationsParams.fromRequest(Request request) {
|
| + return new SearchFindTopLevelDeclarationsParams.fromJson(
|
| new RequestDecoder(request), "params", request.params);
|
| }
|
|
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| - result["file"] = file;
|
| - result["offset"] = offset;
|
| - if (superOnly != null) {
|
| - result["superOnly"] = superOnly;
|
| - }
|
| + result["pattern"] = pattern;
|
| return result;
|
| }
|
|
|
| @override
|
| Request toRequest(String id) {
|
| - return new Request(id, "search.getTypeHierarchy", toJson());
|
| + return new Request(id, "search.findTopLevelDeclarations", toJson());
|
| }
|
|
|
| @override
|
| @@ -16821,10 +11788,8 @@ class SearchGetTypeHierarchyParams implements RequestParams {
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is SearchGetTypeHierarchyParams) {
|
| - return file == other.file &&
|
| - offset == other.offset &&
|
| - superOnly == other.superOnly;
|
| + if (other is SearchFindTopLevelDeclarationsParams) {
|
| + return pattern == other.pattern;
|
| }
|
| return false;
|
| }
|
| @@ -16832,80 +11797,61 @@ class SearchGetTypeHierarchyParams implements RequestParams {
|
| @override
|
| int get hashCode {
|
| int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, file.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, offset.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, superOnly.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, pattern.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * search.getTypeHierarchy result
|
| + * search.findTopLevelDeclarations result
|
| *
|
| * {
|
| - * "hierarchyItems": optional List<TypeHierarchyItem>
|
| + * "id": SearchId
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class SearchGetTypeHierarchyResult implements ResponseResult {
|
| - List<TypeHierarchyItem> _hierarchyItems;
|
| +class SearchFindTopLevelDeclarationsResult implements ResponseResult {
|
| + String _id;
|
|
|
| /**
|
| - * 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.
|
| + * The identifier used to associate results with this search request.
|
| */
|
| - List<TypeHierarchyItem> get hierarchyItems => _hierarchyItems;
|
| + String get id => _id;
|
|
|
| /**
|
| - * 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.
|
| + * The identifier used to associate results with this search request.
|
| */
|
| - void set hierarchyItems(List<TypeHierarchyItem> value) {
|
| - this._hierarchyItems = value;
|
| + void set id(String value) {
|
| + assert(value != null);
|
| + this._id = value;
|
| }
|
|
|
| - SearchGetTypeHierarchyResult({List<TypeHierarchyItem> hierarchyItems}) {
|
| - this.hierarchyItems = hierarchyItems;
|
| + SearchFindTopLevelDeclarationsResult(String id) {
|
| + this.id = id;
|
| }
|
|
|
| - factory SearchGetTypeHierarchyResult.fromJson(
|
| + factory SearchFindTopLevelDeclarationsResult.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - List<TypeHierarchyItem> hierarchyItems;
|
| - if (json.containsKey("hierarchyItems")) {
|
| - hierarchyItems = jsonDecoder.decodeList(
|
| - jsonPath + ".hierarchyItems",
|
| - json["hierarchyItems"],
|
| - (String jsonPath, Object json) =>
|
| - new TypeHierarchyItem.fromJson(jsonDecoder, jsonPath, json));
|
| + String id;
|
| + if (json.containsKey("id")) {
|
| + id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "id");
|
| }
|
| - return new SearchGetTypeHierarchyResult(hierarchyItems: hierarchyItems);
|
| + return new SearchFindTopLevelDeclarationsResult(id);
|
| } else {
|
| throw jsonDecoder.mismatch(
|
| - jsonPath, "search.getTypeHierarchy result", json);
|
| + jsonPath, "search.findTopLevelDeclarations result", json);
|
| }
|
| }
|
|
|
| - factory SearchGetTypeHierarchyResult.fromResponse(Response response) {
|
| - return new SearchGetTypeHierarchyResult.fromJson(
|
| + factory SearchFindTopLevelDeclarationsResult.fromResponse(Response response) {
|
| + return new SearchFindTopLevelDeclarationsResult.fromJson(
|
| new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)),
|
| "result",
|
| response.result);
|
| @@ -16914,11 +11860,7 @@ class SearchGetTypeHierarchyResult implements ResponseResult {
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| - if (hierarchyItems != null) {
|
| - result["hierarchyItems"] = hierarchyItems
|
| - .map((TypeHierarchyItem value) => value.toJson())
|
| - .toList();
|
| - }
|
| + result["id"] = id;
|
| return result;
|
| }
|
|
|
| @@ -16932,9 +11874,8 @@ class SearchGetTypeHierarchyResult implements ResponseResult {
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is SearchGetTypeHierarchyResult) {
|
| - return listEqual(hierarchyItems, other.hierarchyItems,
|
| - (TypeHierarchyItem a, TypeHierarchyItem b) => a == b);
|
| + if (other is SearchFindTopLevelDeclarationsResult) {
|
| + return id == other.id;
|
| }
|
| return false;
|
| }
|
| @@ -16942,165 +11883,138 @@ class SearchGetTypeHierarchyResult implements ResponseResult {
|
| @override
|
| int get hashCode {
|
| int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, hierarchyItems.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, id.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * SearchResult
|
| + * search.getTypeHierarchy params
|
| *
|
| * {
|
| - * "location": Location
|
| - * "kind": SearchResultKind
|
| - * "isPotential": bool
|
| - * "path": List<Element>
|
| + * "file": FilePath
|
| + * "offset": int
|
| + * "superOnly": optional bool
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class SearchResult implements HasToJson {
|
| - Location _location;
|
| -
|
| - SearchResultKind _kind;
|
| -
|
| - bool _isPotential;
|
| -
|
| - List<Element> _path;
|
| +class SearchGetTypeHierarchyParams implements RequestParams {
|
| + String _file;
|
|
|
| - /**
|
| - * The location of the code that matched the search criteria.
|
| - */
|
| - Location get location => _location;
|
| + int _offset;
|
|
|
| - /**
|
| - * The location of the code that matched the search criteria.
|
| - */
|
| - void set location(Location value) {
|
| - assert(value != null);
|
| - this._location = value;
|
| - }
|
| + bool _superOnly;
|
|
|
| /**
|
| - * The kind of element that was found or the kind of reference that was
|
| - * found.
|
| + * The file containing the declaration or reference to the type for which a
|
| + * hierarchy is being requested.
|
| */
|
| - SearchResultKind get kind => _kind;
|
| + String get file => _file;
|
|
|
| /**
|
| - * The kind of element that was found or the kind of reference that was
|
| - * found.
|
| + * The file containing the declaration or reference to the type for which a
|
| + * hierarchy is being requested.
|
| */
|
| - void set kind(SearchResultKind value) {
|
| + void set file(String value) {
|
| assert(value != null);
|
| - this._kind = value;
|
| + this._file = value;
|
| }
|
|
|
| /**
|
| - * 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.
|
| + * The offset of the name of the type within the file.
|
| */
|
| - bool get isPotential => _isPotential;
|
| + int get offset => _offset;
|
|
|
| /**
|
| - * 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.
|
| + * The offset of the name of the type within the file.
|
| */
|
| - void set isPotential(bool value) {
|
| + void set offset(int value) {
|
| assert(value != null);
|
| - this._isPotential = value;
|
| + this._offset = value;
|
| }
|
|
|
| /**
|
| - * The elements that contain the result, starting with the most immediately
|
| - * enclosing ancestor and ending with the library.
|
| + * True if the client is only requesting superclasses and interfaces
|
| + * hierarchy.
|
| */
|
| - List<Element> get path => _path;
|
| + bool get superOnly => _superOnly;
|
|
|
| /**
|
| - * The elements that contain the result, starting with the most immediately
|
| - * enclosing ancestor and ending with the library.
|
| + * True if the client is only requesting superclasses and interfaces
|
| + * hierarchy.
|
| */
|
| - void set path(List<Element> value) {
|
| - assert(value != null);
|
| - this._path = value;
|
| + void set superOnly(bool value) {
|
| + this._superOnly = value;
|
| }
|
|
|
| - SearchResult(Location location, SearchResultKind kind, bool isPotential,
|
| - List<Element> path) {
|
| - this.location = location;
|
| - this.kind = kind;
|
| - this.isPotential = isPotential;
|
| - this.path = path;
|
| + SearchGetTypeHierarchyParams(String file, int offset, {bool superOnly}) {
|
| + this.file = file;
|
| + this.offset = offset;
|
| + this.superOnly = superOnly;
|
| }
|
|
|
| - factory SearchResult.fromJson(
|
| + factory SearchGetTypeHierarchyParams.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - Location location;
|
| - if (json.containsKey("location")) {
|
| - location = new Location.fromJson(
|
| - jsonDecoder, jsonPath + ".location", json["location"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "location");
|
| - }
|
| - SearchResultKind kind;
|
| - if (json.containsKey("kind")) {
|
| - kind = new SearchResultKind.fromJson(
|
| - jsonDecoder, jsonPath + ".kind", json["kind"]);
|
| + json = {};
|
| + }
|
| + if (json is Map) {
|
| + String file;
|
| + if (json.containsKey("file")) {
|
| + file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "kind");
|
| + throw jsonDecoder.mismatch(jsonPath, "file");
|
| }
|
| - bool isPotential;
|
| - if (json.containsKey("isPotential")) {
|
| - isPotential = jsonDecoder.decodeBool(
|
| - jsonPath + ".isPotential", json["isPotential"]);
|
| + int offset;
|
| + if (json.containsKey("offset")) {
|
| + offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "isPotential");
|
| + throw jsonDecoder.mismatch(jsonPath, "offset");
|
| }
|
| - List<Element> path;
|
| - if (json.containsKey("path")) {
|
| - path = jsonDecoder.decodeList(
|
| - jsonPath + ".path",
|
| - json["path"],
|
| - (String jsonPath, Object json) =>
|
| - new Element.fromJson(jsonDecoder, jsonPath, json));
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "path");
|
| + bool superOnly;
|
| + if (json.containsKey("superOnly")) {
|
| + superOnly =
|
| + jsonDecoder.decodeBool(jsonPath + ".superOnly", json["superOnly"]);
|
| }
|
| - return new SearchResult(location, kind, isPotential, path);
|
| + return new SearchGetTypeHierarchyParams(file, offset,
|
| + superOnly: superOnly);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "SearchResult", json);
|
| + throw jsonDecoder.mismatch(
|
| + jsonPath, "search.getTypeHierarchy params", json);
|
| }
|
| }
|
|
|
| + factory SearchGetTypeHierarchyParams.fromRequest(Request request) {
|
| + return new SearchGetTypeHierarchyParams.fromJson(
|
| + new RequestDecoder(request), "params", request.params);
|
| + }
|
| +
|
| @override
|
| 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()).toList();
|
| + result["file"] = file;
|
| + result["offset"] = offset;
|
| + if (superOnly != null) {
|
| + result["superOnly"] = superOnly;
|
| + }
|
| return result;
|
| }
|
|
|
| @override
|
| + Request toRequest(String id) {
|
| + return new Request(id, "search.getTypeHierarchy", toJson());
|
| + }
|
| +
|
| + @override
|
| String toString() => JSON.encode(toJson());
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is SearchResult) {
|
| - return location == other.location &&
|
| - kind == other.kind &&
|
| - isPotential == other.isPotential &&
|
| - listEqual(path, other.path, (Element a, Element b) => a == b);
|
| + if (other is SearchGetTypeHierarchyParams) {
|
| + return file == other.file &&
|
| + offset == other.offset &&
|
| + superOnly == other.superOnly;
|
| }
|
| return false;
|
| }
|
| @@ -17108,254 +12022,275 @@ class SearchResult implements HasToJson {
|
| @override
|
| 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);
|
| + hash = JenkinsSmiHash.combine(hash, file.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, offset.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, superOnly.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * SearchResultKind
|
| + * search.getTypeHierarchy result
|
| *
|
| - * enum {
|
| - * DECLARATION
|
| - * INVOCATION
|
| - * READ
|
| - * READ_WRITE
|
| - * REFERENCE
|
| - * UNKNOWN
|
| - * WRITE
|
| + * {
|
| + * "hierarchyItems": optional List<TypeHierarchyItem>
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class SearchResultKind implements Enum {
|
| - /**
|
| - * The declaration of an element.
|
| - */
|
| - static const SearchResultKind DECLARATION =
|
| - const SearchResultKind._("DECLARATION");
|
| -
|
| - /**
|
| - * The invocation of a function or method.
|
| - */
|
| - static const SearchResultKind INVOCATION =
|
| - const SearchResultKind._("INVOCATION");
|
| -
|
| - /**
|
| - * A reference to a field, parameter or variable where it is being read.
|
| - */
|
| - static const SearchResultKind READ = const SearchResultKind._("READ");
|
| +class SearchGetTypeHierarchyResult implements ResponseResult {
|
| + List<TypeHierarchyItem> _hierarchyItems;
|
|
|
| /**
|
| - * A reference to a field, parameter or variable where it is being read and
|
| - * written.
|
| + * 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.
|
| */
|
| - static const SearchResultKind READ_WRITE =
|
| - const SearchResultKind._("READ_WRITE");
|
| + List<TypeHierarchyItem> get hierarchyItems => _hierarchyItems;
|
|
|
| /**
|
| - * A reference to an element.
|
| + * 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.
|
| */
|
| - static const SearchResultKind REFERENCE =
|
| - const SearchResultKind._("REFERENCE");
|
| + void set hierarchyItems(List<TypeHierarchyItem> value) {
|
| + this._hierarchyItems = value;
|
| + }
|
|
|
| - /**
|
| - * Some other kind of search result.
|
| - */
|
| - static const SearchResultKind UNKNOWN = const SearchResultKind._("UNKNOWN");
|
| + SearchGetTypeHierarchyResult({List<TypeHierarchyItem> hierarchyItems}) {
|
| + this.hierarchyItems = hierarchyItems;
|
| + }
|
|
|
| - /**
|
| - * A reference to a field, parameter or variable where it is being written.
|
| - */
|
| - static const SearchResultKind WRITE = const SearchResultKind._("WRITE");
|
| + factory SearchGetTypeHierarchyResult.fromJson(
|
| + JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| + if (json == null) {
|
| + json = {};
|
| + }
|
| + if (json is Map) {
|
| + List<TypeHierarchyItem> hierarchyItems;
|
| + if (json.containsKey("hierarchyItems")) {
|
| + hierarchyItems = jsonDecoder.decodeList(
|
| + jsonPath + ".hierarchyItems",
|
| + json["hierarchyItems"],
|
| + (String jsonPath, Object json) =>
|
| + new TypeHierarchyItem.fromJson(jsonDecoder, jsonPath, json));
|
| + }
|
| + return new SearchGetTypeHierarchyResult(hierarchyItems: hierarchyItems);
|
| + } else {
|
| + throw jsonDecoder.mismatch(
|
| + jsonPath, "search.getTypeHierarchy result", json);
|
| + }
|
| + }
|
|
|
| - /**
|
| - * A list containing all of the enum values that are defined.
|
| - */
|
| - static const List<SearchResultKind> VALUES = const <SearchResultKind>[
|
| - DECLARATION,
|
| - INVOCATION,
|
| - READ,
|
| - READ_WRITE,
|
| - REFERENCE,
|
| - UNKNOWN,
|
| - WRITE
|
| - ];
|
| + factory SearchGetTypeHierarchyResult.fromResponse(Response response) {
|
| + return new SearchGetTypeHierarchyResult.fromJson(
|
| + new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)),
|
| + "result",
|
| + response.result);
|
| + }
|
|
|
| @override
|
| - 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 "UNKNOWN":
|
| - return UNKNOWN;
|
| - case "WRITE":
|
| - return WRITE;
|
| + Map<String, dynamic> toJson() {
|
| + Map<String, dynamic> result = {};
|
| + if (hierarchyItems != null) {
|
| + result["hierarchyItems"] = hierarchyItems
|
| + .map((TypeHierarchyItem value) => value.toJson())
|
| + .toList();
|
| }
|
| - throw new Exception('Illegal enum value: $name');
|
| + return result;
|
| }
|
|
|
| - factory SearchResultKind.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json is String) {
|
| - try {
|
| - return new SearchResultKind(json);
|
| - } catch (_) {
|
| - // Fall through
|
| - }
|
| - }
|
| - throw jsonDecoder.mismatch(jsonPath, "SearchResultKind", json);
|
| + @override
|
| + Response toResponse(String id) {
|
| + return new Response(id, result: toJson());
|
| }
|
|
|
| @override
|
| - String toString() => "SearchResultKind.$name";
|
| + String toString() => JSON.encode(toJson());
|
|
|
| - String toJson() => name;
|
| + @override
|
| + bool operator ==(other) {
|
| + if (other is SearchGetTypeHierarchyResult) {
|
| + return listEqual(hierarchyItems, other.hierarchyItems,
|
| + (TypeHierarchyItem a, TypeHierarchyItem b) => a == b);
|
| + }
|
| + return false;
|
| + }
|
| +
|
| + @override
|
| + int get hashCode {
|
| + int hash = 0;
|
| + hash = JenkinsSmiHash.combine(hash, hierarchyItems.hashCode);
|
| + return JenkinsSmiHash.finish(hash);
|
| + }
|
| }
|
|
|
| /**
|
| - * search.results params
|
| + * SearchResult
|
| *
|
| * {
|
| - * "id": SearchId
|
| - * "results": List<SearchResult>
|
| - * "isLast": bool
|
| + * "location": Location
|
| + * "kind": SearchResultKind
|
| + * "isPotential": bool
|
| + * "path": List<Element>
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class SearchResultsParams implements HasToJson {
|
| - String _id;
|
| +class SearchResult implements HasToJson {
|
| + Location _location;
|
| +
|
| + SearchResultKind _kind;
|
| +
|
| + bool _isPotential;
|
|
|
| - List<SearchResult> _results;
|
| + List<Element> _path;
|
|
|
| - bool _isLast;
|
| + /**
|
| + * The location of the code that matched the search criteria.
|
| + */
|
| + Location get location => _location;
|
|
|
| /**
|
| - * The id associated with the search.
|
| + * The location of the code that matched the search criteria.
|
| */
|
| - String get id => _id;
|
| + void set location(Location value) {
|
| + assert(value != null);
|
| + this._location = value;
|
| + }
|
|
|
| /**
|
| - * The id associated with the search.
|
| + * The kind of element that was found or the kind of reference that was
|
| + * found.
|
| */
|
| - void set id(String value) {
|
| + SearchResultKind get kind => _kind;
|
| +
|
| + /**
|
| + * The kind of element that was found or the kind of reference that was
|
| + * found.
|
| + */
|
| + void set kind(SearchResultKind value) {
|
| assert(value != null);
|
| - this._id = value;
|
| + this._kind = value;
|
| }
|
|
|
| /**
|
| - * The search results being reported.
|
| + * 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.
|
| */
|
| - List<SearchResult> get results => _results;
|
| + bool get isPotential => _isPotential;
|
|
|
| /**
|
| - * The search results being reported.
|
| + * 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.
|
| */
|
| - void set results(List<SearchResult> value) {
|
| + void set isPotential(bool value) {
|
| assert(value != null);
|
| - this._results = value;
|
| + this._isPotential = value;
|
| }
|
|
|
| /**
|
| - * True if this is that last set of results that will be returned for the
|
| - * indicated search.
|
| + * The elements that contain the result, starting with the most immediately
|
| + * enclosing ancestor and ending with the library.
|
| */
|
| - bool get isLast => _isLast;
|
| + List<Element> get path => _path;
|
|
|
| /**
|
| - * True if this is that last set of results that will be returned for the
|
| - * indicated search.
|
| + * The elements that contain the result, starting with the most immediately
|
| + * enclosing ancestor and ending with the library.
|
| */
|
| - void set isLast(bool value) {
|
| + void set path(List<Element> value) {
|
| assert(value != null);
|
| - this._isLast = value;
|
| + this._path = value;
|
| }
|
|
|
| - SearchResultsParams(String id, List<SearchResult> results, bool isLast) {
|
| - this.id = id;
|
| - this.results = results;
|
| - this.isLast = isLast;
|
| + SearchResult(Location location, SearchResultKind kind, bool isPotential,
|
| + List<Element> path) {
|
| + this.location = location;
|
| + this.kind = kind;
|
| + this.isPotential = isPotential;
|
| + this.path = path;
|
| }
|
|
|
| - factory SearchResultsParams.fromJson(
|
| + factory SearchResult.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - String id;
|
| - if (json.containsKey("id")) {
|
| - id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
|
| + Location location;
|
| + if (json.containsKey("location")) {
|
| + location = new Location.fromJson(
|
| + jsonDecoder, jsonPath + ".location", json["location"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "id");
|
| + throw jsonDecoder.mismatch(jsonPath, "location");
|
| }
|
| - List<SearchResult> results;
|
| - if (json.containsKey("results")) {
|
| - results = jsonDecoder.decodeList(
|
| - jsonPath + ".results",
|
| - json["results"],
|
| - (String jsonPath, Object json) =>
|
| - new SearchResult.fromJson(jsonDecoder, jsonPath, json));
|
| + SearchResultKind kind;
|
| + if (json.containsKey("kind")) {
|
| + kind = new SearchResultKind.fromJson(
|
| + jsonDecoder, jsonPath + ".kind", json["kind"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "results");
|
| + throw jsonDecoder.mismatch(jsonPath, "kind");
|
| }
|
| - bool isLast;
|
| - if (json.containsKey("isLast")) {
|
| - isLast = jsonDecoder.decodeBool(jsonPath + ".isLast", json["isLast"]);
|
| + bool isPotential;
|
| + if (json.containsKey("isPotential")) {
|
| + isPotential = jsonDecoder.decodeBool(
|
| + jsonPath + ".isPotential", json["isPotential"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "isLast");
|
| + throw jsonDecoder.mismatch(jsonPath, "isPotential");
|
| }
|
| - return new SearchResultsParams(id, results, isLast);
|
| + List<Element> path;
|
| + if (json.containsKey("path")) {
|
| + path = jsonDecoder.decodeList(
|
| + jsonPath + ".path",
|
| + json["path"],
|
| + (String jsonPath, Object json) =>
|
| + new Element.fromJson(jsonDecoder, jsonPath, json));
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "path");
|
| + }
|
| + return new SearchResult(location, kind, isPotential, path);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "search.results params", json);
|
| + throw jsonDecoder.mismatch(jsonPath, "SearchResult", json);
|
| }
|
| }
|
|
|
| - factory SearchResultsParams.fromNotification(Notification notification) {
|
| - return new SearchResultsParams.fromJson(
|
| - new ResponseDecoder(null), "params", notification.params);
|
| - }
|
| -
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| - result["id"] = id;
|
| - result["results"] =
|
| - results.map((SearchResult value) => value.toJson()).toList();
|
| - result["isLast"] = isLast;
|
| + result["location"] = location.toJson();
|
| + result["kind"] = kind.toJson();
|
| + result["isPotential"] = isPotential;
|
| + result["path"] = path.map((Element value) => value.toJson()).toList();
|
| return result;
|
| }
|
|
|
| - Notification toNotification() {
|
| - return new Notification("search.results", toJson());
|
| - }
|
| -
|
| @override
|
| String toString() => JSON.encode(toJson());
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is SearchResultsParams) {
|
| - return id == other.id &&
|
| - listEqual(results, other.results,
|
| - (SearchResult a, SearchResult b) => a == b) &&
|
| - isLast == other.isLast;
|
| + if (other is SearchResult) {
|
| + return location == other.location &&
|
| + kind == other.kind &&
|
| + isPotential == other.isPotential &&
|
| + listEqual(path, other.path, (Element a, Element b) => a == b);
|
| }
|
| return false;
|
| }
|
| @@ -17363,264 +12298,242 @@ class SearchResultsParams implements HasToJson {
|
| @override
|
| int get hashCode {
|
| int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, id.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, results.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, isLast.hashCode);
|
| + 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);
|
| }
|
| }
|
|
|
| /**
|
| - * server.connected params
|
| + * SearchResultKind
|
| *
|
| - * {
|
| - * "version": String
|
| - * "pid": int
|
| - * "sessionId": optional String
|
| + * enum {
|
| + * DECLARATION
|
| + * INVOCATION
|
| + * READ
|
| + * READ_WRITE
|
| + * REFERENCE
|
| + * UNKNOWN
|
| + * WRITE
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class ServerConnectedParams implements HasToJson {
|
| - String _version;
|
| -
|
| - int _pid;
|
| -
|
| - String _sessionId;
|
| -
|
| +class SearchResultKind implements Enum {
|
| /**
|
| - * The version number of the analysis server.
|
| + * The declaration of an element.
|
| */
|
| - String get version => _version;
|
| + static const SearchResultKind DECLARATION =
|
| + const SearchResultKind._("DECLARATION");
|
|
|
| /**
|
| - * The version number of the analysis server.
|
| + * The invocation of a function or method.
|
| */
|
| - void set version(String value) {
|
| - assert(value != null);
|
| - this._version = value;
|
| - }
|
| + static const SearchResultKind INVOCATION =
|
| + const SearchResultKind._("INVOCATION");
|
|
|
| /**
|
| - * The process id of the analysis server process.
|
| + * A reference to a field, parameter or variable where it is being read.
|
| */
|
| - int get pid => _pid;
|
| + static const SearchResultKind READ = const SearchResultKind._("READ");
|
|
|
| /**
|
| - * The process id of the analysis server process.
|
| + * A reference to a field, parameter or variable where it is being read and
|
| + * written.
|
| */
|
| - void set pid(int value) {
|
| - assert(value != null);
|
| - this._pid = value;
|
| - }
|
| + static const SearchResultKind READ_WRITE =
|
| + const SearchResultKind._("READ_WRITE");
|
|
|
| /**
|
| - * The session id for this session.
|
| + * A reference to an element.
|
| */
|
| - String get sessionId => _sessionId;
|
| + static const SearchResultKind REFERENCE =
|
| + const SearchResultKind._("REFERENCE");
|
|
|
| /**
|
| - * The session id for this session.
|
| + * Some other kind of search result.
|
| */
|
| - void set sessionId(String value) {
|
| - this._sessionId = value;
|
| - }
|
| -
|
| - ServerConnectedParams(String version, int pid, {String sessionId}) {
|
| - this.version = version;
|
| - this.pid = pid;
|
| - this.sessionId = sessionId;
|
| - }
|
| + static const SearchResultKind UNKNOWN = const SearchResultKind._("UNKNOWN");
|
|
|
| - factory ServerConnectedParams.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - String version;
|
| - if (json.containsKey("version")) {
|
| - version =
|
| - jsonDecoder.decodeString(jsonPath + ".version", json["version"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "version");
|
| - }
|
| - int pid;
|
| - if (json.containsKey("pid")) {
|
| - pid = jsonDecoder.decodeInt(jsonPath + ".pid", json["pid"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "pid");
|
| - }
|
| - String sessionId;
|
| - if (json.containsKey("sessionId")) {
|
| - sessionId = jsonDecoder.decodeString(
|
| - jsonPath + ".sessionId", json["sessionId"]);
|
| - }
|
| - return new ServerConnectedParams(version, pid, sessionId: sessionId);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "server.connected params", json);
|
| - }
|
| - }
|
| + /**
|
| + * A reference to a field, parameter or variable where it is being written.
|
| + */
|
| + static const SearchResultKind WRITE = const SearchResultKind._("WRITE");
|
|
|
| - factory ServerConnectedParams.fromNotification(Notification notification) {
|
| - return new ServerConnectedParams.fromJson(
|
| - new ResponseDecoder(null), "params", notification.params);
|
| - }
|
| + /**
|
| + * A list containing all of the enum values that are defined.
|
| + */
|
| + static const List<SearchResultKind> VALUES = const <SearchResultKind>[
|
| + DECLARATION,
|
| + INVOCATION,
|
| + READ,
|
| + READ_WRITE,
|
| + REFERENCE,
|
| + UNKNOWN,
|
| + WRITE
|
| + ];
|
|
|
| @override
|
| - Map<String, dynamic> toJson() {
|
| - Map<String, dynamic> result = {};
|
| - result["version"] = version;
|
| - result["pid"] = pid;
|
| - if (sessionId != null) {
|
| - result["sessionId"] = sessionId;
|
| - }
|
| - return result;
|
| - }
|
| + final String name;
|
|
|
| - Notification toNotification() {
|
| - return new Notification("server.connected", toJson());
|
| - }
|
| + const SearchResultKind._(this.name);
|
|
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| + 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 "UNKNOWN":
|
| + return UNKNOWN;
|
| + case "WRITE":
|
| + return WRITE;
|
| + }
|
| + throw new Exception('Illegal enum value: $name');
|
| + }
|
|
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is ServerConnectedParams) {
|
| - return version == other.version &&
|
| - pid == other.pid &&
|
| - sessionId == other.sessionId;
|
| + factory SearchResultKind.fromJson(
|
| + JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| + if (json is String) {
|
| + try {
|
| + return new SearchResultKind(json);
|
| + } catch (_) {
|
| + // Fall through
|
| + }
|
| }
|
| - return false;
|
| + throw jsonDecoder.mismatch(jsonPath, "SearchResultKind", json);
|
| }
|
|
|
| @override
|
| - int get hashCode {
|
| - int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, version.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, pid.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, sessionId.hashCode);
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| + String toString() => "SearchResultKind.$name";
|
| +
|
| + String toJson() => name;
|
| }
|
|
|
| /**
|
| - * server.error params
|
| + * search.results params
|
| *
|
| * {
|
| - * "isFatal": bool
|
| - * "message": String
|
| - * "stackTrace": String
|
| + * "id": SearchId
|
| + * "results": List<SearchResult>
|
| + * "isLast": bool
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class ServerErrorParams implements HasToJson {
|
| - bool _isFatal;
|
| +class SearchResultsParams implements HasToJson {
|
| + String _id;
|
|
|
| - String _message;
|
| + List<SearchResult> _results;
|
|
|
| - String _stackTrace;
|
| + bool _isLast;
|
|
|
| /**
|
| - * True if the error is a fatal error, meaning that the server will shutdown
|
| - * automatically after sending this notification.
|
| + * The id associated with the search.
|
| */
|
| - bool get isFatal => _isFatal;
|
| + String get id => _id;
|
|
|
| /**
|
| - * True if the error is a fatal error, meaning that the server will shutdown
|
| - * automatically after sending this notification.
|
| + * The id associated with the search.
|
| */
|
| - void set isFatal(bool value) {
|
| + void set id(String value) {
|
| assert(value != null);
|
| - this._isFatal = value;
|
| + this._id = value;
|
| }
|
|
|
| /**
|
| - * The error message indicating what kind of error was encountered.
|
| + * The search results being reported.
|
| */
|
| - String get message => _message;
|
| + List<SearchResult> get results => _results;
|
|
|
| /**
|
| - * The error message indicating what kind of error was encountered.
|
| + * The search results being reported.
|
| */
|
| - void set message(String value) {
|
| + void set results(List<SearchResult> value) {
|
| assert(value != null);
|
| - this._message = value;
|
| + this._results = value;
|
| }
|
|
|
| /**
|
| - * The stack trace associated with the generation of the error, used for
|
| - * debugging the server.
|
| + * True if this is that last set of results that will be returned for the
|
| + * indicated search.
|
| */
|
| - String get stackTrace => _stackTrace;
|
| + bool get isLast => _isLast;
|
|
|
| /**
|
| - * The stack trace associated with the generation of the error, used for
|
| - * debugging the server.
|
| + * True if this is that last set of results that will be returned for the
|
| + * indicated search.
|
| */
|
| - void set stackTrace(String value) {
|
| + void set isLast(bool value) {
|
| assert(value != null);
|
| - this._stackTrace = value;
|
| + this._isLast = value;
|
| }
|
|
|
| - ServerErrorParams(bool isFatal, String message, String stackTrace) {
|
| - this.isFatal = isFatal;
|
| - this.message = message;
|
| - this.stackTrace = stackTrace;
|
| + SearchResultsParams(String id, List<SearchResult> results, bool isLast) {
|
| + this.id = id;
|
| + this.results = results;
|
| + this.isLast = isLast;
|
| }
|
|
|
| - factory ServerErrorParams.fromJson(
|
| + factory SearchResultsParams.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - bool isFatal;
|
| - if (json.containsKey("isFatal")) {
|
| - isFatal =
|
| - jsonDecoder.decodeBool(jsonPath + ".isFatal", json["isFatal"]);
|
| + String id;
|
| + if (json.containsKey("id")) {
|
| + id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "isFatal");
|
| + throw jsonDecoder.mismatch(jsonPath, "id");
|
| }
|
| - String message;
|
| - if (json.containsKey("message")) {
|
| - message =
|
| - jsonDecoder.decodeString(jsonPath + ".message", json["message"]);
|
| + List<SearchResult> results;
|
| + if (json.containsKey("results")) {
|
| + results = jsonDecoder.decodeList(
|
| + jsonPath + ".results",
|
| + json["results"],
|
| + (String jsonPath, Object json) =>
|
| + new SearchResult.fromJson(jsonDecoder, jsonPath, json));
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "message");
|
| + throw jsonDecoder.mismatch(jsonPath, "results");
|
| }
|
| - String stackTrace;
|
| - if (json.containsKey("stackTrace")) {
|
| - stackTrace = jsonDecoder.decodeString(
|
| - jsonPath + ".stackTrace", json["stackTrace"]);
|
| + bool isLast;
|
| + if (json.containsKey("isLast")) {
|
| + isLast = jsonDecoder.decodeBool(jsonPath + ".isLast", json["isLast"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "stackTrace");
|
| + throw jsonDecoder.mismatch(jsonPath, "isLast");
|
| }
|
| - return new ServerErrorParams(isFatal, message, stackTrace);
|
| + return new SearchResultsParams(id, results, isLast);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "server.error params", json);
|
| + throw jsonDecoder.mismatch(jsonPath, "search.results params", json);
|
| }
|
| }
|
|
|
| - factory ServerErrorParams.fromNotification(Notification notification) {
|
| - return new ServerErrorParams.fromJson(
|
| + factory SearchResultsParams.fromNotification(Notification notification) {
|
| + return new SearchResultsParams.fromJson(
|
| new ResponseDecoder(null), "params", notification.params);
|
| }
|
|
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| - result["isFatal"] = isFatal;
|
| - result["message"] = message;
|
| - result["stackTrace"] = stackTrace;
|
| + result["id"] = id;
|
| + result["results"] =
|
| + results.map((SearchResult value) => value.toJson()).toList();
|
| + result["isLast"] = isLast;
|
| return result;
|
| }
|
|
|
| Notification toNotification() {
|
| - return new Notification("server.error", toJson());
|
| + return new Notification("search.results", toJson());
|
| }
|
|
|
| @override
|
| @@ -17628,10 +12541,11 @@ class ServerErrorParams implements HasToJson {
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is ServerErrorParams) {
|
| - return isFatal == other.isFatal &&
|
| - message == other.message &&
|
| - stackTrace == other.stackTrace;
|
| + if (other is SearchResultsParams) {
|
| + return id == other.id &&
|
| + listEqual(results, other.results,
|
| + (SearchResult a, SearchResult b) => a == b) &&
|
| + isLast == other.isLast;
|
| }
|
| return false;
|
| }
|
| @@ -17639,71 +12553,76 @@ class ServerErrorParams implements HasToJson {
|
| @override
|
| int get hashCode {
|
| int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, isFatal.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, message.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, stackTrace.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, id.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, results.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, isLast.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * server.getVersion params
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class ServerGetVersionParams implements RequestParams {
|
| - @override
|
| - Map<String, dynamic> toJson() => <String, dynamic>{};
|
| -
|
| - @override
|
| - Request toRequest(String id) {
|
| - return new Request(id, "server.getVersion", null);
|
| - }
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is ServerGetVersionParams) {
|
| - return true;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - return 55877452;
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * server.getVersion result
|
| + * server.connected params
|
| *
|
| * {
|
| * "version": String
|
| + * "pid": int
|
| + * "sessionId": optional String
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class ServerGetVersionResult implements ResponseResult {
|
| +class ServerConnectedParams implements HasToJson {
|
| String _version;
|
|
|
| + int _pid;
|
| +
|
| + String _sessionId;
|
| +
|
| /**
|
| * The version number of the analysis server.
|
| */
|
| String get version => _version;
|
|
|
| /**
|
| - * The version number of the analysis server.
|
| + * The version number of the analysis server.
|
| + */
|
| + void set version(String value) {
|
| + assert(value != null);
|
| + this._version = value;
|
| + }
|
| +
|
| + /**
|
| + * The process id of the analysis server process.
|
| + */
|
| + int get pid => _pid;
|
| +
|
| + /**
|
| + * The process id of the analysis server process.
|
| + */
|
| + void set pid(int value) {
|
| + assert(value != null);
|
| + this._pid = value;
|
| + }
|
| +
|
| + /**
|
| + * The session id for this session.
|
| + */
|
| + String get sessionId => _sessionId;
|
| +
|
| + /**
|
| + * The session id for this session.
|
| */
|
| - void set version(String value) {
|
| - assert(value != null);
|
| - this._version = value;
|
| + void set sessionId(String value) {
|
| + this._sessionId = value;
|
| }
|
|
|
| - ServerGetVersionResult(String version) {
|
| + ServerConnectedParams(String version, int pid, {String sessionId}) {
|
| this.version = version;
|
| + this.pid = pid;
|
| + this.sessionId = sessionId;
|
| }
|
|
|
| - factory ServerGetVersionResult.fromJson(
|
| + factory ServerConnectedParams.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| @@ -17716,29 +12635,41 @@ class ServerGetVersionResult implements ResponseResult {
|
| } else {
|
| throw jsonDecoder.mismatch(jsonPath, "version");
|
| }
|
| - return new ServerGetVersionResult(version);
|
| + int pid;
|
| + if (json.containsKey("pid")) {
|
| + pid = jsonDecoder.decodeInt(jsonPath + ".pid", json["pid"]);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "pid");
|
| + }
|
| + String sessionId;
|
| + if (json.containsKey("sessionId")) {
|
| + sessionId = jsonDecoder.decodeString(
|
| + jsonPath + ".sessionId", json["sessionId"]);
|
| + }
|
| + return new ServerConnectedParams(version, pid, sessionId: sessionId);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "server.getVersion result", json);
|
| + throw jsonDecoder.mismatch(jsonPath, "server.connected params", json);
|
| }
|
| }
|
|
|
| - factory ServerGetVersionResult.fromResponse(Response response) {
|
| - return new ServerGetVersionResult.fromJson(
|
| - new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)),
|
| - "result",
|
| - response.result);
|
| + factory ServerConnectedParams.fromNotification(Notification notification) {
|
| + return new ServerConnectedParams.fromJson(
|
| + new ResponseDecoder(null), "params", notification.params);
|
| }
|
|
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| result["version"] = version;
|
| + result["pid"] = pid;
|
| + if (sessionId != null) {
|
| + result["sessionId"] = sessionId;
|
| + }
|
| return result;
|
| }
|
|
|
| - @override
|
| - Response toResponse(String id) {
|
| - return new Response(id, result: toJson());
|
| + Notification toNotification() {
|
| + return new Notification("server.connected", toJson());
|
| }
|
|
|
| @override
|
| @@ -17746,8 +12677,10 @@ class ServerGetVersionResult implements ResponseResult {
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is ServerGetVersionResult) {
|
| - return version == other.version;
|
| + if (other is ServerConnectedParams) {
|
| + return version == other.version &&
|
| + pid == other.pid &&
|
| + sessionId == other.sessionId;
|
| }
|
| return false;
|
| }
|
| @@ -17756,221 +12689,170 @@ class ServerGetVersionResult implements ResponseResult {
|
| int get hashCode {
|
| int hash = 0;
|
| hash = JenkinsSmiHash.combine(hash, version.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, pid.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, sessionId.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * ServerService
|
| + * server.error params
|
| *
|
| - * enum {
|
| - * STATUS
|
| + * {
|
| + * "isFatal": bool
|
| + * "message": String
|
| + * "stackTrace": String
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class ServerService implements Enum {
|
| - static const ServerService STATUS = const ServerService._("STATUS");
|
| -
|
| - /**
|
| - * A list containing all of the enum values that are defined.
|
| - */
|
| - static const List<ServerService> VALUES = const <ServerService>[STATUS];
|
| +class ServerErrorParams implements HasToJson {
|
| + bool _isFatal;
|
|
|
| - @override
|
| - final String name;
|
| + String _message;
|
|
|
| - const ServerService._(this.name);
|
| + String _stackTrace;
|
|
|
| - factory ServerService(String name) {
|
| - switch (name) {
|
| - case "STATUS":
|
| - return STATUS;
|
| - }
|
| - throw new Exception('Illegal enum value: $name');
|
| - }
|
| + /**
|
| + * True if the error is a fatal error, meaning that the server will shutdown
|
| + * automatically after sending this notification.
|
| + */
|
| + bool get isFatal => _isFatal;
|
|
|
| - factory ServerService.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json is String) {
|
| - try {
|
| - return new ServerService(json);
|
| - } catch (_) {
|
| - // Fall through
|
| - }
|
| - }
|
| - throw jsonDecoder.mismatch(jsonPath, "ServerService", json);
|
| + /**
|
| + * True if the error is a fatal error, meaning that the server will shutdown
|
| + * automatically after sending this notification.
|
| + */
|
| + void set isFatal(bool value) {
|
| + assert(value != null);
|
| + this._isFatal = value;
|
| }
|
|
|
| - @override
|
| - String toString() => "ServerService.$name";
|
| -
|
| - String toJson() => name;
|
| -}
|
| + /**
|
| + * The error message indicating what kind of error was encountered.
|
| + */
|
| + String get message => _message;
|
|
|
| -/**
|
| - * server.setSubscriptions params
|
| - *
|
| - * {
|
| - * "subscriptions": List<ServerService>
|
| - * }
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class ServerSetSubscriptionsParams implements RequestParams {
|
| - List<ServerService> _subscriptions;
|
| + /**
|
| + * The error message indicating what kind of error was encountered.
|
| + */
|
| + void set message(String value) {
|
| + assert(value != null);
|
| + this._message = value;
|
| + }
|
|
|
| /**
|
| - * A list of the services being subscribed to.
|
| + * The stack trace associated with the generation of the error, used for
|
| + * debugging the server.
|
| */
|
| - List<ServerService> get subscriptions => _subscriptions;
|
| + String get stackTrace => _stackTrace;
|
|
|
| /**
|
| - * A list of the services being subscribed to.
|
| + * The stack trace associated with the generation of the error, used for
|
| + * debugging the server.
|
| */
|
| - void set subscriptions(List<ServerService> value) {
|
| + void set stackTrace(String value) {
|
| assert(value != null);
|
| - this._subscriptions = value;
|
| + this._stackTrace = value;
|
| }
|
|
|
| - ServerSetSubscriptionsParams(List<ServerService> subscriptions) {
|
| - this.subscriptions = subscriptions;
|
| + ServerErrorParams(bool isFatal, String message, String stackTrace) {
|
| + this.isFatal = isFatal;
|
| + this.message = message;
|
| + this.stackTrace = stackTrace;
|
| }
|
|
|
| - factory ServerSetSubscriptionsParams.fromJson(
|
| + factory ServerErrorParams.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - List<ServerService> subscriptions;
|
| - if (json.containsKey("subscriptions")) {
|
| - subscriptions = jsonDecoder.decodeList(
|
| - jsonPath + ".subscriptions",
|
| - json["subscriptions"],
|
| - (String jsonPath, Object json) =>
|
| - new ServerService.fromJson(jsonDecoder, jsonPath, json));
|
| + bool isFatal;
|
| + if (json.containsKey("isFatal")) {
|
| + isFatal =
|
| + jsonDecoder.decodeBool(jsonPath + ".isFatal", json["isFatal"]);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "subscriptions");
|
| + throw jsonDecoder.mismatch(jsonPath, "isFatal");
|
| }
|
| - return new ServerSetSubscriptionsParams(subscriptions);
|
| + String message;
|
| + if (json.containsKey("message")) {
|
| + message =
|
| + jsonDecoder.decodeString(jsonPath + ".message", json["message"]);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "message");
|
| + }
|
| + String stackTrace;
|
| + if (json.containsKey("stackTrace")) {
|
| + stackTrace = jsonDecoder.decodeString(
|
| + jsonPath + ".stackTrace", json["stackTrace"]);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "stackTrace");
|
| + }
|
| + return new ServerErrorParams(isFatal, message, stackTrace);
|
| } else {
|
| - throw jsonDecoder.mismatch(
|
| - jsonPath, "server.setSubscriptions params", json);
|
| + throw jsonDecoder.mismatch(jsonPath, "server.error params", json);
|
| }
|
| }
|
|
|
| - factory ServerSetSubscriptionsParams.fromRequest(Request request) {
|
| - return new ServerSetSubscriptionsParams.fromJson(
|
| - new RequestDecoder(request), "params", request.params);
|
| + factory ServerErrorParams.fromNotification(Notification notification) {
|
| + return new ServerErrorParams.fromJson(
|
| + new ResponseDecoder(null), "params", notification.params);
|
| }
|
|
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| - result["subscriptions"] =
|
| - subscriptions.map((ServerService value) => value.toJson()).toList();
|
| + result["isFatal"] = isFatal;
|
| + result["message"] = message;
|
| + result["stackTrace"] = stackTrace;
|
| return result;
|
| }
|
|
|
| - @override
|
| - Request toRequest(String id) {
|
| - return new Request(id, "server.setSubscriptions", toJson());
|
| - }
|
| -
|
| - @override
|
| - String toString() => JSON.encode(toJson());
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is ServerSetSubscriptionsParams) {
|
| - return listEqual(subscriptions, other.subscriptions,
|
| - (ServerService a, ServerService b) => a == b);
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, subscriptions.hashCode);
|
| - return JenkinsSmiHash.finish(hash);
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * server.setSubscriptions result
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class ServerSetSubscriptionsResult implements ResponseResult {
|
| - @override
|
| - Map<String, dynamic> toJson() => <String, dynamic>{};
|
| -
|
| - @override
|
| - Response toResponse(String id) {
|
| - return new Response(id, result: null);
|
| - }
|
| -
|
| - @override
|
| - bool operator ==(other) {
|
| - if (other is ServerSetSubscriptionsResult) {
|
| - return true;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - int get hashCode {
|
| - return 748820900;
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * server.shutdown params
|
| - *
|
| - * Clients may not extend, implement or mix-in this class.
|
| - */
|
| -class ServerShutdownParams implements RequestParams {
|
| - @override
|
| - Map<String, dynamic> toJson() => <String, dynamic>{};
|
| + Notification toNotification() {
|
| + return new Notification("server.error", toJson());
|
| + }
|
|
|
| @override
|
| - Request toRequest(String id) {
|
| - return new Request(id, "server.shutdown", null);
|
| - }
|
| + String toString() => JSON.encode(toJson());
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is ServerShutdownParams) {
|
| - return true;
|
| + if (other is ServerErrorParams) {
|
| + return isFatal == other.isFatal &&
|
| + message == other.message &&
|
| + stackTrace == other.stackTrace;
|
| }
|
| return false;
|
| }
|
|
|
| @override
|
| int get hashCode {
|
| - return 366630911;
|
| + int hash = 0;
|
| + hash = JenkinsSmiHash.combine(hash, isFatal.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, message.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, stackTrace.hashCode);
|
| + return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * server.shutdown result
|
| + * server.getVersion params
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class ServerShutdownResult implements ResponseResult {
|
| +class ServerGetVersionParams implements RequestParams {
|
| @override
|
| Map<String, dynamic> toJson() => <String, dynamic>{};
|
|
|
| @override
|
| - Response toResponse(String id) {
|
| - return new Response(id, result: null);
|
| + Request toRequest(String id) {
|
| + return new Request(id, "server.getVersion", null);
|
| }
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is ServerShutdownResult) {
|
| + if (other is ServerGetVersionParams) {
|
| return true;
|
| }
|
| return false;
|
| @@ -17978,99 +12860,75 @@ class ServerShutdownResult implements ResponseResult {
|
|
|
| @override
|
| int get hashCode {
|
| - return 193626532;
|
| + return 55877452;
|
| }
|
| }
|
|
|
| /**
|
| - * server.status params
|
| + * server.getVersion result
|
| *
|
| * {
|
| - * "analysis": optional AnalysisStatus
|
| - * "pub": optional PubStatus
|
| + * "version": String
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class ServerStatusParams implements HasToJson {
|
| - AnalysisStatus _analysis;
|
| -
|
| - PubStatus _pub;
|
| -
|
| - /**
|
| - * The current status of analysis, including whether analysis is being
|
| - * performed and if so what is being analyzed.
|
| - */
|
| - AnalysisStatus get analysis => _analysis;
|
| -
|
| - /**
|
| - * The current status of analysis, including whether analysis is being
|
| - * performed and if so what is being analyzed.
|
| - */
|
| - void set analysis(AnalysisStatus value) {
|
| - this._analysis = value;
|
| - }
|
| +class ServerGetVersionResult implements ResponseResult {
|
| + String _version;
|
|
|
| /**
|
| - * The current status of pub execution, indicating whether we are currently
|
| - * running pub.
|
| + * The version number of the analysis server.
|
| */
|
| - PubStatus get pub => _pub;
|
| + String get version => _version;
|
|
|
| /**
|
| - * The current status of pub execution, indicating whether we are currently
|
| - * running pub.
|
| + * The version number of the analysis server.
|
| */
|
| - void set pub(PubStatus value) {
|
| - this._pub = value;
|
| + void set version(String value) {
|
| + assert(value != null);
|
| + this._version = value;
|
| }
|
|
|
| - ServerStatusParams({AnalysisStatus analysis, PubStatus pub}) {
|
| - this.analysis = analysis;
|
| - this.pub = pub;
|
| + ServerGetVersionResult(String version) {
|
| + this.version = version;
|
| }
|
|
|
| - factory ServerStatusParams.fromJson(
|
| + factory ServerGetVersionResult.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - AnalysisStatus analysis;
|
| - if (json.containsKey("analysis")) {
|
| - analysis = new AnalysisStatus.fromJson(
|
| - jsonDecoder, jsonPath + ".analysis", json["analysis"]);
|
| - }
|
| - PubStatus pub;
|
| - if (json.containsKey("pub")) {
|
| - pub =
|
| - new PubStatus.fromJson(jsonDecoder, jsonPath + ".pub", json["pub"]);
|
| + String version;
|
| + if (json.containsKey("version")) {
|
| + version =
|
| + jsonDecoder.decodeString(jsonPath + ".version", json["version"]);
|
| + } else {
|
| + throw jsonDecoder.mismatch(jsonPath, "version");
|
| }
|
| - return new ServerStatusParams(analysis: analysis, pub: pub);
|
| + return new ServerGetVersionResult(version);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "server.status params", json);
|
| + throw jsonDecoder.mismatch(jsonPath, "server.getVersion result", json);
|
| }
|
| }
|
|
|
| - factory ServerStatusParams.fromNotification(Notification notification) {
|
| - return new ServerStatusParams.fromJson(
|
| - new ResponseDecoder(null), "params", notification.params);
|
| + factory ServerGetVersionResult.fromResponse(Response response) {
|
| + return new ServerGetVersionResult.fromJson(
|
| + new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)),
|
| + "result",
|
| + response.result);
|
| }
|
|
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| - if (analysis != null) {
|
| - result["analysis"] = analysis.toJson();
|
| - }
|
| - if (pub != null) {
|
| - result["pub"] = pub.toJson();
|
| - }
|
| + result["version"] = version;
|
| return result;
|
| }
|
|
|
| - Notification toNotification() {
|
| - return new Notification("server.status", toJson());
|
| + @override
|
| + Response toResponse(String id) {
|
| + return new Response(id, result: toJson());
|
| }
|
|
|
| @override
|
| @@ -18078,8 +12936,8 @@ class ServerStatusParams implements HasToJson {
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is ServerStatusParams) {
|
| - return analysis == other.analysis && pub == other.pub;
|
| + if (other is ServerGetVersionResult) {
|
| + return version == other.version;
|
| }
|
| return false;
|
| }
|
| @@ -18087,203 +12945,137 @@ class ServerStatusParams implements HasToJson {
|
| @override
|
| int get hashCode {
|
| int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, analysis.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, pub.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, version.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * SourceChange
|
| + * ServerService
|
| *
|
| - * {
|
| - * "message": String
|
| - * "edits": List<SourceFileEdit>
|
| - * "linkedEditGroups": List<LinkedEditGroup>
|
| - * "selection": optional Position
|
| + * enum {
|
| + * STATUS
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class SourceChange implements HasToJson {
|
| - String _message;
|
| -
|
| - List<SourceFileEdit> _edits;
|
| -
|
| - List<LinkedEditGroup> _linkedEditGroups;
|
| -
|
| - Position _selection;
|
| +class ServerService implements Enum {
|
| + static const ServerService STATUS = const ServerService._("STATUS");
|
|
|
| /**
|
| - * A human-readable description of the change to be applied.
|
| + * A list containing all of the enum values that are defined.
|
| */
|
| - String get message => _message;
|
| + static const List<ServerService> VALUES = const <ServerService>[STATUS];
|
|
|
| - /**
|
| - * A human-readable description of the change to be applied.
|
| - */
|
| - void set message(String value) {
|
| - assert(value != null);
|
| - this._message = value;
|
| - }
|
| + @override
|
| + final String name;
|
|
|
| - /**
|
| - * A list of the edits used to effect the change, grouped by file.
|
| - */
|
| - List<SourceFileEdit> get edits => _edits;
|
| + const ServerService._(this.name);
|
|
|
| - /**
|
| - * A list of the edits used to effect the change, grouped by file.
|
| - */
|
| - void set edits(List<SourceFileEdit> value) {
|
| - assert(value != null);
|
| - this._edits = value;
|
| + factory ServerService(String name) {
|
| + switch (name) {
|
| + case "STATUS":
|
| + return STATUS;
|
| + }
|
| + throw new Exception('Illegal enum value: $name');
|
| }
|
|
|
| - /**
|
| - * A list of the linked editing groups used to customize the changes that
|
| - * were made.
|
| - */
|
| - List<LinkedEditGroup> get linkedEditGroups => _linkedEditGroups;
|
| -
|
| - /**
|
| - * A list of the linked editing groups used to customize the changes that
|
| - * were made.
|
| - */
|
| - void set linkedEditGroups(List<LinkedEditGroup> value) {
|
| - assert(value != null);
|
| - this._linkedEditGroups = value;
|
| + factory ServerService.fromJson(
|
| + JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| + if (json is String) {
|
| + try {
|
| + return new ServerService(json);
|
| + } catch (_) {
|
| + // Fall through
|
| + }
|
| + }
|
| + throw jsonDecoder.mismatch(jsonPath, "ServerService", json);
|
| }
|
|
|
| + @override
|
| + String toString() => "ServerService.$name";
|
| +
|
| + String toJson() => name;
|
| +}
|
| +
|
| +/**
|
| + * server.setSubscriptions params
|
| + *
|
| + * {
|
| + * "subscriptions": List<ServerService>
|
| + * }
|
| + *
|
| + * Clients may not extend, implement or mix-in this class.
|
| + */
|
| +class ServerSetSubscriptionsParams implements RequestParams {
|
| + List<ServerService> _subscriptions;
|
| +
|
| /**
|
| - * The position that should be selected after the edits have been applied.
|
| + * A list of the services being subscribed to.
|
| */
|
| - Position get selection => _selection;
|
| + List<ServerService> get subscriptions => _subscriptions;
|
|
|
| /**
|
| - * The position that should be selected after the edits have been applied.
|
| + * A list of the services being subscribed to.
|
| */
|
| - void set selection(Position value) {
|
| - this._selection = value;
|
| + void set subscriptions(List<ServerService> value) {
|
| + assert(value != null);
|
| + this._subscriptions = value;
|
| }
|
|
|
| - SourceChange(String message,
|
| - {List<SourceFileEdit> edits,
|
| - List<LinkedEditGroup> linkedEditGroups,
|
| - Position selection}) {
|
| - this.message = message;
|
| - if (edits == null) {
|
| - this.edits = <SourceFileEdit>[];
|
| - } else {
|
| - this.edits = edits;
|
| - }
|
| - if (linkedEditGroups == null) {
|
| - this.linkedEditGroups = <LinkedEditGroup>[];
|
| - } else {
|
| - this.linkedEditGroups = linkedEditGroups;
|
| - }
|
| - this.selection = selection;
|
| + ServerSetSubscriptionsParams(List<ServerService> subscriptions) {
|
| + this.subscriptions = subscriptions;
|
| }
|
|
|
| - factory SourceChange.fromJson(
|
| + factory ServerSetSubscriptionsParams.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - String message;
|
| - if (json.containsKey("message")) {
|
| - message =
|
| - jsonDecoder.decodeString(jsonPath + ".message", json["message"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "message");
|
| - }
|
| - List<SourceFileEdit> edits;
|
| - if (json.containsKey("edits")) {
|
| - edits = jsonDecoder.decodeList(
|
| - jsonPath + ".edits",
|
| - json["edits"],
|
| - (String jsonPath, Object json) =>
|
| - new SourceFileEdit.fromJson(jsonDecoder, jsonPath, json));
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "edits");
|
| - }
|
| - List<LinkedEditGroup> linkedEditGroups;
|
| - if (json.containsKey("linkedEditGroups")) {
|
| - linkedEditGroups = jsonDecoder.decodeList(
|
| - jsonPath + ".linkedEditGroups",
|
| - json["linkedEditGroups"],
|
| + List<ServerService> subscriptions;
|
| + if (json.containsKey("subscriptions")) {
|
| + subscriptions = jsonDecoder.decodeList(
|
| + jsonPath + ".subscriptions",
|
| + json["subscriptions"],
|
| (String jsonPath, Object json) =>
|
| - new LinkedEditGroup.fromJson(jsonDecoder, jsonPath, json));
|
| + new ServerService.fromJson(jsonDecoder, jsonPath, json));
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "linkedEditGroups");
|
| - }
|
| - Position selection;
|
| - if (json.containsKey("selection")) {
|
| - selection = new Position.fromJson(
|
| - jsonDecoder, jsonPath + ".selection", json["selection"]);
|
| + throw jsonDecoder.mismatch(jsonPath, "subscriptions");
|
| }
|
| - return new SourceChange(message,
|
| - edits: edits,
|
| - linkedEditGroups: linkedEditGroups,
|
| - selection: selection);
|
| + return new ServerSetSubscriptionsParams(subscriptions);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "SourceChange", json);
|
| + throw jsonDecoder.mismatch(
|
| + jsonPath, "server.setSubscriptions params", json);
|
| }
|
| }
|
|
|
| + factory ServerSetSubscriptionsParams.fromRequest(Request request) {
|
| + return new ServerSetSubscriptionsParams.fromJson(
|
| + new RequestDecoder(request), "params", request.params);
|
| + }
|
| +
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| - result["message"] = message;
|
| - result["edits"] =
|
| - edits.map((SourceFileEdit value) => value.toJson()).toList();
|
| - result["linkedEditGroups"] = linkedEditGroups
|
| - .map((LinkedEditGroup value) => value.toJson())
|
| - .toList();
|
| - if (selection != null) {
|
| - result["selection"] = selection.toJson();
|
| - }
|
| + result["subscriptions"] =
|
| + subscriptions.map((ServerService value) => value.toJson()).toList();
|
| return result;
|
| }
|
|
|
| - /**
|
| - * Adds [edit] to the [FileEdit] for the given [file].
|
| - */
|
| - void addEdit(String file, int fileStamp, SourceEdit edit) =>
|
| - addEditToSourceChange(this, file, fileStamp, edit);
|
| -
|
| - /**
|
| - * Adds the given [FileEdit].
|
| - */
|
| - void addFileEdit(SourceFileEdit edit) {
|
| - edits.add(edit);
|
| - }
|
| -
|
| - /**
|
| - * Adds the given [LinkedEditGroup].
|
| - */
|
| - void addLinkedEditGroup(LinkedEditGroup linkedEditGroup) {
|
| - linkedEditGroups.add(linkedEditGroup);
|
| - }
|
| -
|
| - /**
|
| - * Returns the [FileEdit] for the given [file], maybe `null`.
|
| - */
|
| - SourceFileEdit getFileEdit(String file) => getChangeFileEdit(this, file);
|
| + @override
|
| + Request toRequest(String id) {
|
| + return new Request(id, "server.setSubscriptions", toJson());
|
| + }
|
|
|
| @override
|
| String toString() => JSON.encode(toJson());
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is SourceChange) {
|
| - return message == other.message &&
|
| - listEqual(edits, other.edits,
|
| - (SourceFileEdit a, SourceFileEdit b) => a == b) &&
|
| - listEqual(linkedEditGroups, other.linkedEditGroups,
|
| - (LinkedEditGroup a, LinkedEditGroup b) => a == b) &&
|
| - selection == other.selection;
|
| + if (other is ServerSetSubscriptionsParams) {
|
| + return listEqual(subscriptions, other.subscriptions,
|
| + (ServerService a, ServerService b) => a == b);
|
| }
|
| return false;
|
| }
|
| @@ -18291,334 +13083,193 @@ class SourceChange implements HasToJson {
|
| @override
|
| 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);
|
| + hash = JenkinsSmiHash.combine(hash, subscriptions.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|
| /**
|
| - * SourceEdit
|
| - *
|
| - * {
|
| - * "offset": int
|
| - * "length": int
|
| - * "replacement": String
|
| - * "id": optional String
|
| - * }
|
| + * server.setSubscriptions result
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class SourceEdit implements HasToJson {
|
| - /**
|
| - * Get the result of applying a set of [edits] to the given [code]. Edits are
|
| - * applied in the order they appear in [edits].
|
| - */
|
| - static String applySequence(String code, Iterable<SourceEdit> edits) =>
|
| - applySequenceOfEdits(code, edits);
|
| -
|
| - int _offset;
|
| -
|
| - int _length;
|
| -
|
| - String _replacement;
|
| -
|
| - String _id;
|
| -
|
| - /**
|
| - * The offset of the region to be modified.
|
| - */
|
| - int get offset => _offset;
|
| +class ServerSetSubscriptionsResult implements ResponseResult {
|
| + @override
|
| + Map<String, dynamic> toJson() => <String, dynamic>{};
|
|
|
| - /**
|
| - * The offset of the region to be modified.
|
| - */
|
| - void set offset(int value) {
|
| - assert(value != null);
|
| - this._offset = value;
|
| + @override
|
| + Response toResponse(String id) {
|
| + return new Response(id, result: null);
|
| }
|
|
|
| - /**
|
| - * The length of the region to be modified.
|
| - */
|
| - int get length => _length;
|
| -
|
| - /**
|
| - * The length of the region to be modified.
|
| - */
|
| - void set length(int value) {
|
| - assert(value != null);
|
| - this._length = value;
|
| + @override
|
| + bool operator ==(other) {
|
| + if (other is ServerSetSubscriptionsResult) {
|
| + return true;
|
| + }
|
| + return false;
|
| }
|
|
|
| - /**
|
| - * The code that is to replace the specified region in the original code.
|
| - */
|
| - String get replacement => _replacement;
|
| -
|
| - /**
|
| - * The code that is to replace the specified region in the original code.
|
| - */
|
| - void set replacement(String value) {
|
| - assert(value != null);
|
| - this._replacement = value;
|
| + @override
|
| + int get hashCode {
|
| + return 748820900;
|
| }
|
| +}
|
|
|
| - /**
|
| - * 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.
|
| - */
|
| - String get id => _id;
|
| -
|
| - /**
|
| - * 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.
|
| - */
|
| - void set id(String value) {
|
| - this._id = value;
|
| - }
|
| +/**
|
| + * server.shutdown params
|
| + *
|
| + * Clients may not extend, implement or mix-in this class.
|
| + */
|
| +class ServerShutdownParams implements RequestParams {
|
| + @override
|
| + Map<String, dynamic> toJson() => <String, dynamic>{};
|
|
|
| - SourceEdit(int offset, int length, String replacement, {String id}) {
|
| - this.offset = offset;
|
| - this.length = length;
|
| - this.replacement = replacement;
|
| - this.id = id;
|
| + @override
|
| + Request toRequest(String id) {
|
| + return new Request(id, "server.shutdown", null);
|
| }
|
|
|
| - factory SourceEdit.fromJson(
|
| - JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| - if (json == null) {
|
| - json = {};
|
| - }
|
| - if (json is Map) {
|
| - int offset;
|
| - if (json.containsKey("offset")) {
|
| - offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "offset");
|
| - }
|
| - int length;
|
| - if (json.containsKey("length")) {
|
| - length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "length");
|
| - }
|
| - String replacement;
|
| - if (json.containsKey("replacement")) {
|
| - replacement = jsonDecoder.decodeString(
|
| - jsonPath + ".replacement", json["replacement"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "replacement");
|
| - }
|
| - String id;
|
| - if (json.containsKey("id")) {
|
| - id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
|
| - }
|
| - return new SourceEdit(offset, length, replacement, id: id);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "SourceEdit", json);
|
| + @override
|
| + bool operator ==(other) {
|
| + if (other is ServerShutdownParams) {
|
| + return true;
|
| }
|
| + return false;
|
| }
|
|
|
| - /**
|
| - * The end of the region to be modified.
|
| - */
|
| - int get end => offset + length;
|
| -
|
| @override
|
| - 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;
|
| + int get hashCode {
|
| + return 366630911;
|
| }
|
| +}
|
|
|
| - /**
|
| - * Get the result of applying the edit to the given [code].
|
| - */
|
| - String apply(String code) => applyEdit(code, this);
|
| +/**
|
| + * server.shutdown result
|
| + *
|
| + * Clients may not extend, implement or mix-in this class.
|
| + */
|
| +class ServerShutdownResult implements ResponseResult {
|
| + @override
|
| + Map<String, dynamic> toJson() => <String, dynamic>{};
|
|
|
| @override
|
| - String toString() => JSON.encode(toJson());
|
| + Response toResponse(String id) {
|
| + return new Response(id, result: null);
|
| + }
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is SourceEdit) {
|
| - return offset == other.offset &&
|
| - length == other.length &&
|
| - replacement == other.replacement &&
|
| - id == other.id;
|
| + if (other is ServerShutdownResult) {
|
| + return true;
|
| }
|
| return false;
|
| }
|
|
|
| @override
|
| 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);
|
| + return 193626532;
|
| }
|
| }
|
|
|
| /**
|
| - * SourceFileEdit
|
| + * server.status params
|
| *
|
| * {
|
| - * "file": FilePath
|
| - * "fileStamp": long
|
| - * "edits": List<SourceEdit>
|
| + * "analysis": optional AnalysisStatus
|
| + * "pub": optional PubStatus
|
| * }
|
| *
|
| * Clients may not extend, implement or mix-in this class.
|
| */
|
| -class SourceFileEdit implements HasToJson {
|
| - String _file;
|
| -
|
| - int _fileStamp;
|
| -
|
| - List<SourceEdit> _edits;
|
| -
|
| - /**
|
| - * The file containing the code to be modified.
|
| - */
|
| - String get file => _file;
|
| +class ServerStatusParams implements HasToJson {
|
| + AnalysisStatus _analysis;
|
|
|
| - /**
|
| - * The file containing the code to be modified.
|
| - */
|
| - void set file(String value) {
|
| - assert(value != null);
|
| - this._file = value;
|
| - }
|
| + PubStatus _pub;
|
|
|
| /**
|
| - * The modification stamp of the file at the moment when the change was
|
| - * created, in milliseconds since the "Unix epoch". Will be -1 if the file
|
| - * did not exist and should be created. The client may use this field to make
|
| - * sure that the file was not changed since then, so it is safe to apply the
|
| - * change.
|
| + * The current status of analysis, including whether analysis is being
|
| + * performed and if so what is being analyzed.
|
| */
|
| - int get fileStamp => _fileStamp;
|
| + AnalysisStatus get analysis => _analysis;
|
|
|
| /**
|
| - * The modification stamp of the file at the moment when the change was
|
| - * created, in milliseconds since the "Unix epoch". Will be -1 if the file
|
| - * did not exist and should be created. The client may use this field to make
|
| - * sure that the file was not changed since then, so it is safe to apply the
|
| - * change.
|
| + * The current status of analysis, including whether analysis is being
|
| + * performed and if so what is being analyzed.
|
| */
|
| - void set fileStamp(int value) {
|
| - assert(value != null);
|
| - this._fileStamp = value;
|
| + void set analysis(AnalysisStatus value) {
|
| + this._analysis = value;
|
| }
|
|
|
| /**
|
| - * A list of the edits used to effect the change.
|
| + * The current status of pub execution, indicating whether we are currently
|
| + * running pub.
|
| */
|
| - List<SourceEdit> get edits => _edits;
|
| + PubStatus get pub => _pub;
|
|
|
| /**
|
| - * A list of the edits used to effect the change.
|
| + * The current status of pub execution, indicating whether we are currently
|
| + * running pub.
|
| */
|
| - void set edits(List<SourceEdit> value) {
|
| - assert(value != null);
|
| - this._edits = value;
|
| + void set pub(PubStatus value) {
|
| + this._pub = value;
|
| }
|
|
|
| - SourceFileEdit(String file, int fileStamp, {List<SourceEdit> edits}) {
|
| - this.file = file;
|
| - this.fileStamp = fileStamp;
|
| - if (edits == null) {
|
| - this.edits = <SourceEdit>[];
|
| - } else {
|
| - this.edits = edits;
|
| - }
|
| + ServerStatusParams({AnalysisStatus analysis, PubStatus pub}) {
|
| + this.analysis = analysis;
|
| + this.pub = pub;
|
| }
|
|
|
| - factory SourceFileEdit.fromJson(
|
| + factory ServerStatusParams.fromJson(
|
| JsonDecoder jsonDecoder, String jsonPath, Object json) {
|
| if (json == null) {
|
| json = {};
|
| }
|
| if (json is Map) {
|
| - String file;
|
| - if (json.containsKey("file")) {
|
| - file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "file");
|
| - }
|
| - int fileStamp;
|
| - if (json.containsKey("fileStamp")) {
|
| - fileStamp =
|
| - jsonDecoder.decodeInt(jsonPath + ".fileStamp", json["fileStamp"]);
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "fileStamp");
|
| + AnalysisStatus analysis;
|
| + if (json.containsKey("analysis")) {
|
| + analysis = new AnalysisStatus.fromJson(
|
| + jsonDecoder, jsonPath + ".analysis", json["analysis"]);
|
| }
|
| - List<SourceEdit> edits;
|
| - if (json.containsKey("edits")) {
|
| - edits = jsonDecoder.decodeList(
|
| - jsonPath + ".edits",
|
| - json["edits"],
|
| - (String jsonPath, Object json) =>
|
| - new SourceEdit.fromJson(jsonDecoder, jsonPath, json));
|
| - } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "edits");
|
| + PubStatus pub;
|
| + if (json.containsKey("pub")) {
|
| + pub =
|
| + new PubStatus.fromJson(jsonDecoder, jsonPath + ".pub", json["pub"]);
|
| }
|
| - return new SourceFileEdit(file, fileStamp, edits: edits);
|
| + return new ServerStatusParams(analysis: analysis, pub: pub);
|
| } else {
|
| - throw jsonDecoder.mismatch(jsonPath, "SourceFileEdit", json);
|
| + throw jsonDecoder.mismatch(jsonPath, "server.status params", json);
|
| }
|
| }
|
|
|
| + factory ServerStatusParams.fromNotification(Notification notification) {
|
| + return new ServerStatusParams.fromJson(
|
| + new ResponseDecoder(null), "params", notification.params);
|
| + }
|
| +
|
| @override
|
| Map<String, dynamic> toJson() {
|
| Map<String, dynamic> result = {};
|
| - result["file"] = file;
|
| - result["fileStamp"] = fileStamp;
|
| - result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList();
|
| + if (analysis != null) {
|
| + result["analysis"] = analysis.toJson();
|
| + }
|
| + if (pub != null) {
|
| + result["pub"] = pub.toJson();
|
| + }
|
| return result;
|
| }
|
|
|
| - /**
|
| - * Adds the given [Edit] to the list.
|
| - */
|
| - void add(SourceEdit edit) => addEditForSource(this, edit);
|
| -
|
| - /**
|
| - * Adds the given [Edit]s.
|
| - */
|
| - void addAll(Iterable<SourceEdit> edits) => addAllEditsForSource(this, edits);
|
| + Notification toNotification() {
|
| + return new Notification("server.status", toJson());
|
| + }
|
|
|
| @override
|
| String toString() => JSON.encode(toJson());
|
|
|
| @override
|
| bool operator ==(other) {
|
| - if (other is SourceFileEdit) {
|
| - return file == other.file &&
|
| - fileStamp == other.fileStamp &&
|
| - listEqual(edits, other.edits, (SourceEdit a, SourceEdit b) => a == b);
|
| + if (other is ServerStatusParams) {
|
| + return analysis == other.analysis && pub == other.pub;
|
| }
|
| return false;
|
| }
|
| @@ -18626,9 +13277,8 @@ class SourceFileEdit implements HasToJson {
|
| @override
|
| int get hashCode {
|
| int hash = 0;
|
| - hash = JenkinsSmiHash.combine(hash, file.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, fileStamp.hashCode);
|
| - hash = JenkinsSmiHash.combine(hash, edits.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, analysis.hashCode);
|
| + hash = JenkinsSmiHash.combine(hash, pub.hashCode);
|
| return JenkinsSmiHash.finish(hash);
|
| }
|
| }
|
|
|