File tree 11 files changed +64
-10
lines changed
platform_tests/alternate_language_test_plugin/android/src/main
11 files changed +64
-10
lines changed Original file line number Diff line number Diff line change
1
+ ## 4.2.6
2
+
3
+ * Fixes bug with parsing documentation comments that start with '/'.
4
+
1
5
## 4.2.5
2
6
3
7
* [ dart] Fixes enum parameter handling in Dart test API class.
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import 'dart:mirrors';
9
9
import 'ast.dart' ;
10
10
11
11
/// The current version of pigeon. This must match the version in pubspec.yaml.
12
- const String pigeonVersion = '4.2.5 ' ;
12
+ const String pigeonVersion = '4.2.6 ' ;
13
13
14
14
/// Read all the content from [stdin] to a String.
15
15
String readStdin () {
@@ -474,7 +474,10 @@ void addDocumentationComments(
474
474
indent.writeln (commentSpec.openCommentToken);
475
475
currentLineOpenToken = commentSpec.blockContinuationToken;
476
476
}
477
- for (final String line in allComments) {
477
+ for (String line in allComments) {
478
+ if (line.isNotEmpty && line[0 ] != ' ' ) {
479
+ line = ' $line ' ;
480
+ }
478
481
indent.writeln (
479
482
'$currentLineOpenToken $line ' ,
480
483
);
Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ import 'package:pigeon/pigeon.dart';
20
20
/// This comment is to test enum documentation comments.
21
21
///
22
22
/// This comment also tests multiple line comments.
23
+ ///
24
+ ///////////////////////////
25
+ /// This comment also tests comments that start with '/'
26
+ ///////////////////////////
23
27
enum MessageRequestState {
24
28
pending,
25
29
success,
Original file line number Diff line number Diff line change 2
2
# changes on generated files. This will need a way to avoid unnecessary churn,
3
3
# such as a flag to suppress version stamp generation.
4
4
* .java
5
- ! AlternateLanguageTestPlugin.kt
5
+ ! AlternateLanguageTestPlugin.java
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: pigeon
2
2
description : Code generator tool to make communication between Flutter and the host platform type-safe and easier.
3
3
repository : https://github.com/flutter/packages/tree/main/packages/pigeon
4
4
issue_tracker : https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3Apigeon
5
- version : 4.2.5 # This must match the version in lib/generator_tools.dart
5
+ version : 4.2.6 # This must match the version in lib/generator_tools.dart
6
6
7
7
environment :
8
8
sdk : " >=2.12.0 <3.0.0"
Original file line number Diff line number Diff line change @@ -1062,6 +1062,9 @@ void main() {
1062
1062
];
1063
1063
int count = 0 ;
1064
1064
1065
+ final List <String > unspacedComments = < String > ['////////' ];
1066
+ int unspacedCount = 0 ;
1067
+
1065
1068
final Root root = Root (
1066
1069
apis: < Api > [
1067
1070
Api (
@@ -1107,7 +1110,10 @@ void main() {
1107
1110
enums: < Enum > [
1108
1111
Enum (
1109
1112
name: 'enum' ,
1110
- documentationComments: < String > [comments[count++ ]],
1113
+ documentationComments: < String > [
1114
+ comments[count++ ],
1115
+ unspacedComments[unspacedCount++ ]
1116
+ ],
1111
1117
members: < String > [
1112
1118
'one' ,
1113
1119
'two' ,
@@ -1121,6 +1127,7 @@ void main() {
1121
1127
for (final String comment in comments) {
1122
1128
expect (code, contains ('//$comment ' ));
1123
1129
}
1130
+ expect (code, contains ('// ///' ));
1124
1131
});
1125
1132
1126
1133
test ('doesnt create codecs if no custom datatypes' , () {
Original file line number Diff line number Diff line change @@ -1174,6 +1174,10 @@ name: foobar
1174
1174
' enum comment' ,
1175
1175
];
1176
1176
int count = 0 ;
1177
+
1178
+ final List <String > unspacedComments = < String > ['////////' ];
1179
+ int unspacedCount = 0 ;
1180
+
1177
1181
final Root root = Root (
1178
1182
apis: < Api > [
1179
1183
Api (
@@ -1219,7 +1223,10 @@ name: foobar
1219
1223
enums: < Enum > [
1220
1224
Enum (
1221
1225
name: 'enum' ,
1222
- documentationComments: < String > [comments[count++ ]],
1226
+ documentationComments: < String > [
1227
+ comments[count++ ],
1228
+ unspacedComments[unspacedCount++ ]
1229
+ ],
1223
1230
members: < String > [
1224
1231
'one' ,
1225
1232
'two' ,
@@ -1233,6 +1240,7 @@ name: foobar
1233
1240
for (final String comment in comments) {
1234
1241
expect (code, contains ('///$comment ' ));
1235
1242
}
1243
+ expect (code, contains ('/// ///' ));
1236
1244
});
1237
1245
1238
1246
test ('doesnt create codecs if no custom datatypes' , () {
Original file line number Diff line number Diff line change @@ -1139,6 +1139,9 @@ void main() {
1139
1139
];
1140
1140
int count = 0 ;
1141
1141
1142
+ final List <String > unspacedComments = < String > ['////////' ];
1143
+ int unspacedCount = 0 ;
1144
+
1142
1145
final Root root = Root (
1143
1146
apis: < Api > [
1144
1147
Api (
@@ -1185,7 +1188,10 @@ void main() {
1185
1188
enums: < Enum > [
1186
1189
Enum (
1187
1190
name: 'enum' ,
1188
- documentationComments: < String > [comments[count++ ]],
1191
+ documentationComments: < String > [
1192
+ comments[count++ ],
1193
+ unspacedComments[unspacedCount++ ]
1194
+ ],
1189
1195
members: < String > [
1190
1196
'one' ,
1191
1197
'two' ,
@@ -1204,6 +1210,7 @@ void main() {
1204
1210
.hasMatch (code),
1205
1211
true );
1206
1212
}
1213
+ expect (code, isNot (contains ('*//' )));
1207
1214
});
1208
1215
1209
1216
test ('doesnt create codecs if no custom datatypes' , () {
Original file line number Diff line number Diff line change @@ -1019,6 +1019,9 @@ void main() {
1019
1019
];
1020
1020
int count = 0 ;
1021
1021
1022
+ final List <String > unspacedComments = < String > ['////////' ];
1023
+ int unspacedCount = 0 ;
1024
+
1022
1025
final Root root = Root (
1023
1026
apis: < Api > [
1024
1027
Api (
@@ -1065,7 +1068,10 @@ void main() {
1065
1068
enums: < Enum > [
1066
1069
Enum (
1067
1070
name: 'enum' ,
1068
- documentationComments: < String > [comments[count++ ]],
1071
+ documentationComments: < String > [
1072
+ comments[count++ ],
1073
+ unspacedComments[unspacedCount++ ]
1074
+ ],
1069
1075
members: < String > [
1070
1076
'one' ,
1071
1077
'two' ,
@@ -1084,6 +1090,7 @@ void main() {
1084
1090
.hasMatch (code),
1085
1091
true );
1086
1092
}
1093
+ expect (code, isNot (contains ('*//' )));
1087
1094
});
1088
1095
1089
1096
test ('doesnt create codecs if no custom datatypes' , () {
Original file line number Diff line number Diff line change @@ -1751,6 +1751,9 @@ void main() {
1751
1751
];
1752
1752
int count = 0 ;
1753
1753
1754
+ final List <String > unspacedComments = < String > ['////////' ];
1755
+ int unspacedCount = 0 ;
1756
+
1754
1757
final Root root = Root (
1755
1758
apis: < Api > [
1756
1759
Api (
@@ -1797,7 +1800,10 @@ void main() {
1797
1800
enums: < Enum > [
1798
1801
Enum (
1799
1802
name: 'enum' ,
1800
- documentationComments: < String > [comments[count++ ]],
1803
+ documentationComments: < String > [
1804
+ comments[count++ ],
1805
+ unspacedComments[unspacedCount++ ]
1806
+ ],
1801
1807
members: < String > [
1802
1808
'one' ,
1803
1809
'two' ,
@@ -1811,6 +1817,7 @@ void main() {
1811
1817
for (final String comment in comments) {
1812
1818
expect (code, contains ('///$comment ' ));
1813
1819
}
1820
+ expect (code, contains ('/// ///' ));
1814
1821
});
1815
1822
1816
1823
test ('doesnt create codecs if no custom datatypes' , () {
Original file line number Diff line number Diff line change @@ -958,6 +958,9 @@ void main() {
958
958
];
959
959
int count = 0 ;
960
960
961
+ final List <String > unspacedComments = < String > ['////////' ];
962
+ int unspacedCount = 0 ;
963
+
961
964
final Root root = Root (
962
965
apis: < Api > [
963
966
Api (
@@ -1004,7 +1007,10 @@ void main() {
1004
1007
enums: < Enum > [
1005
1008
Enum (
1006
1009
name: 'enum' ,
1007
- documentationComments: < String > [comments[count++ ]],
1010
+ documentationComments: < String > [
1011
+ comments[count++ ],
1012
+ unspacedComments[unspacedCount++ ]
1013
+ ],
1008
1014
members: < String > [
1009
1015
'one' ,
1010
1016
'two' ,
@@ -1019,6 +1025,7 @@ void main() {
1019
1025
for (final String comment in comments) {
1020
1026
expect (code, contains ('///$comment ' ));
1021
1027
}
1028
+ expect (code, contains ('/// ///' ));
1022
1029
});
1023
1030
1024
1031
test ('doesnt create codecs if no custom datatypes' , () {
You can’t perform that action at this time.
0 commit comments