Skip to content

Commit d022b8b

Browse files
committed
Remove added group around base type in AttributedTypeSyntax
Causes quite a few changes in eg. sourcekit-lsp, so presumably will in other codebases as well. Ideally we'd add this behind some new versioning in the config. As an example of a change this causes: ``` private let logMessageToIndexLog: @sendable ( _ message: String, _ type: WindowMessageType, _ structure: LanguageServerProtocol.StructuredLogKind ) -> Void ``` To: ``` @sendable ( _ message: String, _ type: WindowMessageType, _ structure: LanguageServerProtocol.StructuredLogKind ) -> Void ```
1 parent f45ca4f commit d022b8b

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

Sources/SwiftFormat/PrettyPrint/TokenStreamCreator.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2411,9 +2411,6 @@ 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-
24172414
after(node.lastToken(viewMode: .sourceAccurate), tokens: .close)
24182415
return .visitChildren
24192416
}

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)