File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Top Open diff view settings Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Top Open diff view settings Original file line number Diff line number Diff line change @@ -858,6 +858,7 @@ pub const Node = struct {
858858
859859 pub fn firstToken (self : * FnProto ) TokenIndex {
860860 if (self .visib_token ) | visib_token | return visib_token ;
861+ if (self .async_attr ) | async_attr | return async_attr .firstToken ();
861862 if (self .extern_export_inline_token ) | extern_export_inline_token | return extern_export_inline_token ;
862863 assert (self .lib_name == null );
863864 if (self .cc_token ) | cc_token | return cc_token ;
Original file line number Diff line number Diff line change 1+ test "zig fmt: preserve space between async fn definitions" {
2+ try testCanonical (
3+ \\async fn a() void {}
4+ \\
5+ \\async fn b() void {}
6+ \\
7+ );
8+ }
9+
110test "zig fmt: comment to disable/enable zig fmt first" {
211 try testCanonical (
312 \\// Test trailing comma syntax
You can’t perform that action at this time.
0 commit comments