@@ -22,21 +22,22 @@ import 'package:analysis_server/src/lsp/json_parsing.dart';
22
22
import 'package:analysis_server/src/protocol/protocol_internal.dart'
23
23
show listEqual, mapEqual;
24
24
import 'package:analyzer/src/generated/utilities_general.dart' ;
25
+ import 'package:meta/meta.dart' ;
25
26
26
27
const jsonEncoder = JsonEncoder .withIndent (' ' );
27
28
28
29
class AnalyzerStatusParams implements ToJsonable {
29
30
static const jsonHandler = LspJsonHandler (
30
31
AnalyzerStatusParams .canParse, AnalyzerStatusParams .fromJson);
31
32
32
- AnalyzerStatusParams (this .isAnalyzing) {
33
+ AnalyzerStatusParams ({ @required this .isAnalyzing} ) {
33
34
if (isAnalyzing == null ) {
34
35
throw 'isAnalyzing is required but was not provided' ;
35
36
}
36
37
}
37
38
static AnalyzerStatusParams fromJson (Map <String , dynamic > json) {
38
39
final isAnalyzing = json['isAnalyzing' ];
39
- return AnalyzerStatusParams (isAnalyzing);
40
+ return AnalyzerStatusParams (isAnalyzing: isAnalyzing );
40
41
}
41
42
42
43
final bool isAnalyzing;
@@ -98,7 +99,7 @@ class ClosingLabel implements ToJsonable {
98
99
static const jsonHandler =
99
100
LspJsonHandler (ClosingLabel .canParse, ClosingLabel .fromJson);
100
101
101
- ClosingLabel (this .range, this .label) {
102
+ ClosingLabel ({ @required this .range, @required this .label} ) {
102
103
if (range == null ) {
103
104
throw 'range is required but was not provided' ;
104
105
}
@@ -109,7 +110,7 @@ class ClosingLabel implements ToJsonable {
109
110
static ClosingLabel fromJson (Map <String , dynamic > json) {
110
111
final range = json['range' ] != null ? Range .fromJson (json['range' ]) : null ;
111
112
final label = json['label' ];
112
- return ClosingLabel (range, label);
113
+ return ClosingLabel (range: range, label : label);
113
114
}
114
115
115
116
final String label;
@@ -190,8 +191,13 @@ class CompletionItemResolutionInfo implements ToJsonable {
190
191
CompletionItemResolutionInfo .canParse,
191
192
CompletionItemResolutionInfo .fromJson);
192
193
193
- CompletionItemResolutionInfo (this .file, this .offset, this .libId,
194
- this .displayUri, this .rOffset, this .rLength) {
194
+ CompletionItemResolutionInfo (
195
+ {@required this .file,
196
+ @required this .offset,
197
+ @required this .libId,
198
+ @required this .displayUri,
199
+ @required this .rOffset,
200
+ @required this .rLength}) {
195
201
if (file == null ) {
196
202
throw 'file is required but was not provided' ;
197
203
}
@@ -219,7 +225,12 @@ class CompletionItemResolutionInfo implements ToJsonable {
219
225
final rOffset = json['rOffset' ];
220
226
final rLength = json['rLength' ];
221
227
return CompletionItemResolutionInfo (
222
- file, offset, libId, displayUri, rOffset, rLength);
228
+ file: file,
229
+ offset: offset,
230
+ libId: libId,
231
+ displayUri: displayUri,
232
+ rOffset: rOffset,
233
+ rLength: rLength);
223
234
}
224
235
225
236
final String displayUri;
@@ -389,14 +400,14 @@ class DartDiagnosticServer implements ToJsonable {
389
400
static const jsonHandler = LspJsonHandler (
390
401
DartDiagnosticServer .canParse, DartDiagnosticServer .fromJson);
391
402
392
- DartDiagnosticServer (this .port) {
403
+ DartDiagnosticServer ({ @required this .port} ) {
393
404
if (port == null ) {
394
405
throw 'port is required but was not provided' ;
395
406
}
396
407
}
397
408
static DartDiagnosticServer fromJson (Map <String , dynamic > json) {
398
409
final port = json['port' ];
399
- return DartDiagnosticServer (port);
410
+ return DartDiagnosticServer (port: port );
400
411
}
401
412
402
413
final num port;
@@ -456,8 +467,13 @@ class DartDiagnosticServer implements ToJsonable {
456
467
class Element implements ToJsonable {
457
468
static const jsonHandler = LspJsonHandler (Element .canParse, Element .fromJson);
458
469
459
- Element (this .range, this .name, this .kind, this .parameters,
460
- this .typeParameters, this .returnType) {
470
+ Element (
471
+ {this .range,
472
+ @required this .name,
473
+ @required this .kind,
474
+ this .parameters,
475
+ this .typeParameters,
476
+ this .returnType}) {
461
477
if (name == null ) {
462
478
throw 'name is required but was not provided' ;
463
479
}
@@ -472,7 +488,13 @@ class Element implements ToJsonable {
472
488
final parameters = json['parameters' ];
473
489
final typeParameters = json['typeParameters' ];
474
490
final returnType = json['returnType' ];
475
- return Element (range, name, kind, parameters, typeParameters, returnType);
491
+ return Element (
492
+ range: range,
493
+ name: name,
494
+ kind: kind,
495
+ parameters: parameters,
496
+ typeParameters: typeParameters,
497
+ returnType: returnType);
476
498
}
477
499
478
500
final String kind;
@@ -616,15 +638,15 @@ class FlutterOutline implements ToJsonable {
616
638
LspJsonHandler (FlutterOutline .canParse, FlutterOutline .fromJson);
617
639
618
640
FlutterOutline (
619
- this .kind,
641
+ { @required this .kind,
620
642
this .label,
621
643
this .className,
622
644
this .variableName,
623
645
this .attributes,
624
646
this .dartElement,
625
- this .range,
626
- this .codeRange,
627
- this .children) {
647
+ @required this .range,
648
+ @required this .codeRange,
649
+ this .children} ) {
628
650
if (kind == null ) {
629
651
throw 'kind is required but was not provided' ;
630
652
}
@@ -655,8 +677,16 @@ class FlutterOutline implements ToJsonable {
655
677
? .map ((item) => item != null ? FlutterOutline .fromJson (item) : null )
656
678
? .cast <FlutterOutline >()
657
679
? .toList ();
658
- return FlutterOutline (kind, label, className, variableName, attributes,
659
- dartElement, range, codeRange, children);
680
+ return FlutterOutline (
681
+ kind: kind,
682
+ label: label,
683
+ className: className,
684
+ variableName: variableName,
685
+ attributes: attributes,
686
+ dartElement: dartElement,
687
+ range: range,
688
+ codeRange: codeRange,
689
+ children: children);
660
690
}
661
691
662
692
final List <FlutterOutlineAttribute > attributes;
@@ -862,7 +892,8 @@ class FlutterOutlineAttribute implements ToJsonable {
862
892
static const jsonHandler = LspJsonHandler (
863
893
FlutterOutlineAttribute .canParse, FlutterOutlineAttribute .fromJson);
864
894
865
- FlutterOutlineAttribute (this .name, this .label, this .valueRange) {
895
+ FlutterOutlineAttribute (
896
+ {@required this .name, @required this .label, this .valueRange}) {
866
897
if (name == null ) {
867
898
throw 'name is required but was not provided' ;
868
899
}
@@ -875,7 +906,8 @@ class FlutterOutlineAttribute implements ToJsonable {
875
906
final label = json['label' ];
876
907
final valueRange =
877
908
json['valueRange' ] != null ? Range .fromJson (json['valueRange' ]) : null ;
878
- return FlutterOutlineAttribute (name, label, valueRange);
909
+ return FlutterOutlineAttribute (
910
+ name: name, label: label, valueRange: valueRange);
879
911
}
880
912
881
913
final String label;
@@ -973,7 +1005,11 @@ class FlutterOutlineAttribute implements ToJsonable {
973
1005
class Outline implements ToJsonable {
974
1006
static const jsonHandler = LspJsonHandler (Outline .canParse, Outline .fromJson);
975
1007
976
- Outline (this .element, this .range, this .codeRange, this .children) {
1008
+ Outline (
1009
+ {@required this .element,
1010
+ @required this .range,
1011
+ @required this .codeRange,
1012
+ this .children}) {
977
1013
if (element == null ) {
978
1014
throw 'element is required but was not provided' ;
979
1015
}
@@ -994,7 +1030,11 @@ class Outline implements ToJsonable {
994
1030
? .map ((item) => item != null ? Outline .fromJson (item) : null )
995
1031
? .cast <Outline >()
996
1032
? .toList ();
997
- return Outline (element, range, codeRange, children);
1033
+ return Outline (
1034
+ element: element,
1035
+ range: range,
1036
+ codeRange: codeRange,
1037
+ children: children);
998
1038
}
999
1039
1000
1040
final List <Outline > children;
@@ -1118,7 +1158,7 @@ class PublishClosingLabelsParams implements ToJsonable {
1118
1158
static const jsonHandler = LspJsonHandler (
1119
1159
PublishClosingLabelsParams .canParse, PublishClosingLabelsParams .fromJson);
1120
1160
1121
- PublishClosingLabelsParams (this .uri, this .labels) {
1161
+ PublishClosingLabelsParams ({ @required this .uri, @required this .labels} ) {
1122
1162
if (uri == null ) {
1123
1163
throw 'uri is required but was not provided' ;
1124
1164
}
@@ -1132,7 +1172,7 @@ class PublishClosingLabelsParams implements ToJsonable {
1132
1172
? .map ((item) => item != null ? ClosingLabel .fromJson (item) : null )
1133
1173
? .cast <ClosingLabel >()
1134
1174
? .toList ();
1135
- return PublishClosingLabelsParams (uri, labels);
1175
+ return PublishClosingLabelsParams (uri: uri, labels : labels);
1136
1176
}
1137
1177
1138
1178
final List <ClosingLabel > labels;
@@ -1219,7 +1259,7 @@ class PublishFlutterOutlineParams implements ToJsonable {
1219
1259
PublishFlutterOutlineParams .canParse,
1220
1260
PublishFlutterOutlineParams .fromJson);
1221
1261
1222
- PublishFlutterOutlineParams (this .uri, this .outline) {
1262
+ PublishFlutterOutlineParams ({ @required this .uri, @required this .outline} ) {
1223
1263
if (uri == null ) {
1224
1264
throw 'uri is required but was not provided' ;
1225
1265
}
@@ -1232,7 +1272,7 @@ class PublishFlutterOutlineParams implements ToJsonable {
1232
1272
final outline = json['outline' ] != null
1233
1273
? FlutterOutline .fromJson (json['outline' ])
1234
1274
: null ;
1235
- return PublishFlutterOutlineParams (uri, outline);
1275
+ return PublishFlutterOutlineParams (uri: uri, outline : outline);
1236
1276
}
1237
1277
1238
1278
final FlutterOutline outline;
@@ -1314,7 +1354,7 @@ class PublishOutlineParams implements ToJsonable {
1314
1354
static const jsonHandler = LspJsonHandler (
1315
1355
PublishOutlineParams .canParse, PublishOutlineParams .fromJson);
1316
1356
1317
- PublishOutlineParams (this .uri, this .outline) {
1357
+ PublishOutlineParams ({ @required this .uri, @required this .outline} ) {
1318
1358
if (uri == null ) {
1319
1359
throw 'uri is required but was not provided' ;
1320
1360
}
@@ -1326,7 +1366,7 @@ class PublishOutlineParams implements ToJsonable {
1326
1366
final uri = json['uri' ];
1327
1367
final outline =
1328
1368
json['outline' ] != null ? Outline .fromJson (json['outline' ]) : null ;
1329
- return PublishOutlineParams (uri, outline);
1369
+ return PublishOutlineParams (uri: uri, outline : outline);
1330
1370
}
1331
1371
1332
1372
final Outline outline;
0 commit comments