Uh oh!
There was an error while loading. Please reload this page.
[pigeon] Change generator formatting to closer match formatter output - #3072
Conversation
Uh oh!
There was an error while loading. Please reload this page.
| indent.writeln('import java.util.HashMap;'); | ||
| indent.writeln('import java.util.List;'); | ||
| indent.writeln('import java.util.Map;'); | ||
| indent.writeln('import java.util.HashMap;'); |
There was a problem hiding this comment.
Optional: Consider replacing this with the approach I added to the C++ generator, which passes a list of imports to a helper that sorts them all then writes import $foo for each one, so we don't have to manually keep this sorted in the future.
Uh oh!
There was an error while loading. Please reload this page.
| } else { | ||
| indent.writeln( | ||
| '$returnType $output = ($returnType)channelReply;'); | ||
| '$returnType $output = ($returnType)channelReply;'); |
There was a problem hiding this comment.
Optional: it might be worth extracting a getCastExpression({required String type, required String value}) to abstract this since we've messed up the format in several places. Then the exact format of a cast only needs to be right in one place.
Uh oh!
There was an error while loading. Please reload this page.
| return '($varName == null) ? null : ${hostDatatype.datatype}.fromList((ArrayList<Object>)$varName)'; | ||
| } else { | ||
| return '(${hostDatatype.datatype})$varName'; | ||
| return '(${hostDatatype.datatype})$varName'; |
There was a problem hiding this comment.
This is at least 6 times we've manually constructed a cast wrong, which definitely makes me think it's worth a helper.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…flutter#3072) * dart and some java * java * objc header * objc source * newln * loopable new lines * better counting * cpp and redo previous changes * changelog * nest and nits * addScoped * rewrite description of newln * regex tests
…flutter#3072) * dart and some java * java * objc header * objc source * newln * loopable new lines * better counting * cpp and redo previous changes * changelog * nest and nits * addScoped * rewrite description of newln * regex tests
Over the last few months (and especially with the large class redesign) there has been a build up of small lint issues within the generated code.
This pr fixes as many of them as possible without adding unneeded complexity to the generators or making assumptions about line length.
I've also added a
newlnmethod for adding empty lines and ending lines. Since this was a common use-case of various methods such aswritelnandaddln. I've replaced all instances of these being called with an empty string.