Skip to content
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

Bad formatting of native body function. #771

Closed
lrhn opened this issue Feb 5, 2019 · 2 comments
Closed

Bad formatting of native body function. #771

lrhn opened this issue Feb 5, 2019 · 2 comments

Comments

@lrhn
Copy link
Member

lrhn commented Feb 5, 2019

Example:

class C {
  void
      _SomethingWithAVeryLongName(
          List<int> sixteenLetterers, String fiver, List<int> eightish)
      native 'SomethingWithAVeryLongName'; // ignore: native_function_body_in_non
}

The line break between void and the name seems unnecessary.

(I know that native functions are not valid Dart, but apparently people keep using them anyway. We should give them a better alternative and stop wasting time implementing it in our tools. Until such times ...)

@munificent
Copy link
Member

That is a little strange looking. :-/

@munificent
Copy link
Member

It's the ignore comment that's causing problems here because it needs to hang off the same line where it's written, which forces some weird splitting. But I think the forthcoming tall style does a pretty good job:

class C {
  void _SomethingWithAVeryLongName(
    List<int> sixteenLetterers,
    String fiver,
    List<int> eightish,
  ) native 'SomethingWithAVeryLongName'; // ignore: native_function_body_in_non
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants