| Index: pkg/analysis_server/lib/src/protocol.dart
|
| diff --git a/pkg/analysis_server/lib/src/protocol.dart b/pkg/analysis_server/lib/src/protocol.dart
|
| index d2afd17520474cb1c9b2974edd8ece58fd29c2ca..c4371d10ea11650b0ad223be75ffbcbb0bf0814e 100644
|
| --- a/pkg/analysis_server/lib/src/protocol.dart
|
| +++ b/pkg/analysis_server/lib/src/protocol.dart
|
| @@ -232,6 +232,34 @@ RefactoringOptions _refactoringOptionsFromJson(JsonDecoder jsonDecoder,
|
|
|
|
|
| /**
|
| + * Type of callbacks used to decode parts of JSON objects. [jsonPath] is a
|
| + * string describing the part of the JSON object being decoded, and [value] is
|
| + * the part to decode.
|
| + */
|
| +typedef Object JsonDecoderCallback(String jsonPath, Object value);
|
| +
|
| +
|
| +/**
|
| + * Instances of the class [DomainHandler] implement a [RequestHandler] and
|
| + * also startup and shutdown methods.
|
| + */
|
| +abstract class DomainHandler extends RequestHandler {
|
| + /**
|
| + * Perform any operations associated with the shutdown of the domain. It is
|
| + * not guaranteed that this method will be called. If it is, it will be
|
| + * called after the last [Request] has been made.
|
| + */
|
| + void shutdown() {}
|
| +
|
| + /**
|
| + * Perform any operations associated with the startup of the domain. This
|
| + * will be called before the first [Request].
|
| + */
|
| + void startup() {}
|
| +}
|
| +
|
| +
|
| +/**
|
| * Classes implementing [Enum] represent enumerated types in the protocol.
|
| */
|
| abstract class Enum {
|
| @@ -244,14 +272,6 @@ abstract class Enum {
|
|
|
|
|
| /**
|
| - * Type of callbacks used to decode parts of JSON objects. [jsonPath] is a
|
| - * string describing the part of the JSON object being decoded, and [value] is
|
| - * the part to decode.
|
| - */
|
| -typedef Object JsonDecoderCallback(String jsonPath, Object value);
|
| -
|
| -
|
| -/**
|
| * Instances of the class [HasToJson] implement [toJson] method that returns
|
| * a JSON presentation.
|
| */
|
| @@ -269,6 +289,13 @@ abstract class HasToJson {
|
| */
|
| abstract class JsonDecoder {
|
| /**
|
| + * Retrieve the RefactoringKind that should be assumed when decoding
|
| + * refactoring feedback objects, or null if no refactoring feedback object is
|
| + * expected to be encountered.
|
| + */
|
| + RefactoringKind get refactoringKind;
|
| +
|
| + /**
|
| * Create an exception to throw if the JSON object at [jsonPath] fails to
|
| * match the API definition of [expected].
|
| */
|
| @@ -281,13 +308,6 @@ abstract class JsonDecoder {
|
| dynamic missingKey(String jsonPath, String key);
|
|
|
| /**
|
| - * Retrieve the RefactoringKind that should be assumed when decoding
|
| - * refactoring feedback objects, or null if no refactoring feedback object is
|
| - * expected to be encountered.
|
| - */
|
| - RefactoringKind get refactoringKind;
|
| -
|
| - /**
|
| * Decode a JSON object that is expected to be a boolean. The strings "true"
|
| * and "false" are also accepted.
|
| */
|
| @@ -457,7 +477,6 @@ class Notification {
|
| }
|
| }
|
|
|
| -
|
| /**
|
| * Instances of the class [Request] represent a request that was received.
|
| */
|
| @@ -553,6 +572,7 @@ class Request {
|
| }
|
| }
|
|
|
| +
|
| /**
|
| * JsonDecoder for decoding requests. Errors are reporting by throwing a
|
| * [RequestFailure].
|
| @@ -565,6 +585,11 @@ class RequestDecoder extends JsonDecoder {
|
|
|
| RequestDecoder(this._request);
|
|
|
| + RefactoringKind get refactoringKind {
|
| + // Refactoring feedback objects should never appear in requests.
|
| + return null;
|
| + }
|
| +
|
| @override
|
| dynamic mismatch(String jsonPath, String expected) {
|
| return new RequestFailure(
|
| @@ -579,14 +604,8 @@ class RequestDecoder extends JsonDecoder {
|
| jsonPath,
|
| 'contain key ${JSON.encode(key)}'));
|
| }
|
| -
|
| - RefactoringKind get refactoringKind {
|
| - // Refactoring feedback objects should never appear in requests.
|
| - return null;
|
| - }
|
| }
|
|
|
| -
|
| /**
|
| * Instances of the class [RequestFailure] represent an exception that occurred
|
| * during the handling of a request that requires that an error be returned to
|
| @@ -619,25 +638,6 @@ abstract class RequestHandler {
|
| }
|
|
|
| /**
|
| - * Instances of the class [DomainHandler] implement a [RequestHandler] and
|
| - * also startup and shutdown methods.
|
| - */
|
| -abstract class DomainHandler extends RequestHandler {
|
| - /**
|
| - * Perform any operations associated with the startup of the domain. This
|
| - * will be called before the first [Request].
|
| - */
|
| - void startup() { }
|
| -
|
| - /**
|
| - * Perform any operations associated with the shutdown of the domain. It is
|
| - * not guaranteed that this method will be called. If it is, it will be
|
| - * called after the last [Request] has been made.
|
| - */
|
| - void shutdown() { }
|
| -}
|
| -
|
| -/**
|
| * Instances of the class [Response] represent a response to a request.
|
| */
|
| class Response {
|
|
|