Skip to content

Commit c17d42e

Browse files
committed
Revert "Remove added group around base type in AttributedTypeSyntax"
This reverts commit d022b8b.
1 parent e9274f1 commit c17d42e

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2411,6 +2411,9 @@ private final class TokenStreamCreator: SyntaxVisitor {
24112411
)
24122412
}
24132413

2414+
before(node.baseType.firstToken(viewMode: .sourceAccurate), tokens: .open)
2415+
after(node.baseType.lastToken(viewMode: .sourceAccurate), tokens: .close)
2416+
24142417
after(node.lastToken(viewMode: .sourceAccurate), tokens: .close)
24152418
return .visitChildren
24162419
}

Tests/SwiftFormatTests/PrettyPrint/FunctionTypeTests.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -316,15 +316,15 @@ final class FunctionTypeTests: PrettyPrintTestCase {
316316
expected: """
317317
func f(
318318
_ body:
319-
nonisolated(nonsending) ()
320-
async -> Void
319+
nonisolated(nonsending)
320+
() async -> Void
321321
) {}
322322
323323
func f(
324324
_ body:
325325
@Foo @Bar
326-
nonisolated(nonsending) ()
327-
async -> Void
326+
nonisolated(nonsending)
327+
() async -> Void
328328
) {}
329329
330330
func f(
@@ -336,8 +336,8 @@ final class FunctionTypeTests: PrettyPrintTestCase {
336336
func f(
337337
_ body:
338338
inout @Foo @Bar
339-
nonisolated(nonsending) ()
340-
async -> Void
339+
nonisolated(nonsending)
340+
() async -> Void
341341
) {}
342342
343343
""",

0 commit comments

Comments
 (0)