mirror of
https://github.com/nicklockwood/SwiftFormat.git
synced 2026-06-16 10:34:34 +00:00
Fix docComments rule for macros
This commit is contained in:
@@ -2491,7 +2491,7 @@ extension Token {
|
||||
"import", "let", "var", "typealias", "func", "enum", "case",
|
||||
"struct", "class", "actor", "protocol", "init", "deinit",
|
||||
"extension", "subscript", "operator", "precedencegroup",
|
||||
"associatedtype",
|
||||
"associatedtype", "macro",
|
||||
])
|
||||
|
||||
for keywordToExclude in keywordsToExclude {
|
||||
|
||||
@@ -3322,6 +3322,17 @@ class SyntaxTests: RulesTests {
|
||||
testFormatting(for: input, rule: FormatRules.docComments)
|
||||
}
|
||||
|
||||
func testDocCommentForMacro() {
|
||||
let input = """
|
||||
/// Adds a static `logger` member to the type.
|
||||
@attached(member, names: named(logger)) public macro StaticLogger(
|
||||
subsystem: String? = nil,
|
||||
category: String? = nil
|
||||
) = #externalMacro(module: "StaticLoggerMacros", type: "StaticLogger")
|
||||
"""
|
||||
testFormatting(for: input, rule: FormatRules.docComments)
|
||||
}
|
||||
|
||||
// MARK: - conditionalAssignment
|
||||
|
||||
func testDoesntConvertIfStatementAssignmentSwift5_8() {
|
||||
|
||||
Reference in New Issue
Block a user