-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
too long line without obvious reason. #573
Comments
Your expression is too complex and the formatter is giving up after too many tries to find an optional solution to it. :( I'll leave this open because I would like to improve the heuristics around But, in this case, I don't see why you are creating an empty list literal and then calling part of app_code_generator;
LibraryBuilder createRootProvidersLibrary(List<DataSource> dataSources) {
final providers = [
AngularCore.provideFunction.call([
FhirClientBrowser.dataConnectionsService
], {
'useClass': reference(
'AppDataConnections', GeneratedApplication.dataConnectionsImportPath)
}),
AngularRouter.routerProvidersReference,
AngularCore.provideFunction.call(
[AngularLocation.appBaseHrefReference], {'useValue': literal('/')}),
AngularCore.provideFunction.call([AngularLocation.locationStrategy],
{'useClass': AngularLocation.locationStrategy}),
AngularCore.provideFunction.call([FhirClientUtil.runModeEnum],
{'useValue': GeneratedApplication.runModeReference}),
AngularCore.provideFunction.call([FhirClientUtil.jsonPrettyPrintService],
{'useClass': FhirClientUtilBrowser.jsonPrettyPrintService}),
AngularCore.provideFunction.call([FhirClientWebui.alertService],
{'useClass': FhirClientWebui.alertServiceBrowser}),
AngularCore.provideFunction
.call([HttpClient.baseClient], {'useClass': HttpClient.browserClient})
];
return new LibraryBuilder.scope(scope: new Scope.dedupe())
..addMember(list(providers).asFinal('rootProviders', lib$core.List));
} ? |
Thanks for the hint. Was focusing on other stuff 😄 |
This code is also formatted wrongly:
|
Should this be merged with #456 ? |
Yeah, may as well. I can find this bug from that one to add it to the regression tests. |
Hey @munificent, I think it would be nice if you could update your FAQ found here: https://github.com/dart-lang/dart_style/wiki/FAQ At the very bottom of your FAQ, you refer to this ticket (#573) for example but it's been closed and completed back in 2018 🤓 Nonetheless, thanks for your work and writeup. |
Good catch! Now that cascades are much faster, most of the remaining performance failure cases are around argument lists. I updated that section of the FAQ to point to the relevant issue. Thanks! |
When I move
{'useClass': HttpClient.browserClient}));
to the next linedartfmt
moves it back to where it is.Dart VM version: 1.22.0-edge.d591b59fcd01519076d84ce22362552265d34d0e (Tue Jan 3 01:25:48 2017) on "linux_x64"
The text was updated successfully, but these errors were encountered: