-
Notifications
You must be signed in to change notification settings - Fork 125
Implement support for generic function types #563
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
Comments
Generally, for the formatter, I don't put new syntax behind explicit flags. Instead, if you throw an AST at dartfmt that uses the new syntax, it will try to handle it. Since all dartfmt does is rearrange whitespace, I don't think we have to worry too much about compatibility on experimental language features—if a feature is changed or removed, people will stop formatting code that uses it. |
That sounds reasonable. I copied this from the other bugs, but I agree that it doesn't really apply to the formatter. |
Moving to 1.22 for implementation, informal spec is linked from the meta-issue dart-lang/sdk#27527 |
Thanks! |
@munificent is this done? If so, was it merged to the sdk? |
No, this is blocked on analyzer support. dart_style uses analyzer's parser so if there isn't a version of analyzer that parses some syntax, it can't format it. Once dart-lang/sdk#27969 is done, I'll add support to dartfmt. |
OK. Please note that dart-lang/sdk#27969 was punted to 1.23! |
Good to know, thanks! |
@munificent any news on this? |
Nope, there won't be any news until analyzer supports it in dart-lang/sdk#27969. dartfmt can't format any syntax that it can't parse. :) |
Analyzer is done! |
Bob - any updates? The last full push to trunk is Wednesday early morning. |
No update yet, I just saw that analyzer support landed (I was out yesterday). I'll take a look as soon as I can. @bwilkerson, is there a published version of analyzer that supports the new syntax? Are there AST changes? |
This is the formatter issue for dart-lang/sdk#27527.
At the moment we only really need the new syntax in typedefs. Eventually, we want to make this syntax usable for fields and locals, but it's not yet as high a priority. If you find the time to make it work there too, please guard it behind a (different) flag.
The text was updated successfully, but these errors were encountered: