Skip to content

Commit

Permalink
Version 2.18.0-180.0.dev
Browse files Browse the repository at this point in the history
Merge commit '503e7232ab5da9b5d5cacdda097d641e9f7a6062' into 'dev'
  • Loading branch information
Dart CI committed Jun 12, 2022
2 parents 41e17af + 503e723 commit ab8eafd
Show file tree
Hide file tree
Showing 4 changed files with 823 additions and 1,074 deletions.
22 changes: 10 additions & 12 deletions pkg/analysis_server/lib/lsp_protocol/protocol_custom_generated.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1945,11 +1945,7 @@ class RequestMessage implements IncomingMessage, ToJsonable {
final clientRequestTimeJson = json['clientRequestTime'];
final clientRequestTime = clientRequestTimeJson as int?;
final idJson = json['id'];
final id = idJson is int
? Either2<int, String>.t1(idJson)
: (idJson is String
? Either2<int, String>.t2(idJson)
: (throw '''$idJson was not one of (int, String)'''));
final id = _eitherIntString(idJson);
final jsonrpcJson = json['jsonrpc'];
final jsonrpc = jsonrpcJson as String;
final methodJson = json['method'];
Expand Down Expand Up @@ -2226,13 +2222,7 @@ class ResponseMessage implements Message, ToJsonable {
? ResponseError.fromJson(errorJson as Map<String, Object?>)
: null;
final idJson = json['id'];
final id = idJson == null
? null
: (idJson is int
? Either2<int, String>.t1(idJson)
: (idJson is String
? Either2<int, String>.t2(idJson)
: (throw '''$idJson was not one of (int, String)''')));
final id = idJson == null ? null : _eitherIntString(idJson);
final jsonrpcJson = json['jsonrpc'];
final jsonrpc = jsonrpcJson as String;
final resultJson = json['result'];
Expand Down Expand Up @@ -2574,3 +2564,11 @@ class ValidateRefactorResult implements ToJsonable {
@override
String toString() => jsonEncoder.convert(toJson());
}

Either2<int, String> _eitherIntString(Object? value) {
return value is int
? Either2.t1(value)
: value is String
? Either2.t2(value)
: throw '$value was not one of (int, String)';
}
Loading

0 comments on commit ab8eafd

Please sign in to comment.