Skip to content

Whitespace removed around standalone macro with attribute #689

Closed
@klanchman

Description

@klanchman

When a using standalone macro with an attribute on it, swift-format wants to remove whitespace around the macro.

The following example assumes the default swift-format configuration. Tested on 509.0.0 and main.

Input:

@available(iOS 17.0, *)
#Preview("Name") {
  EmptyView()
}

Expected output: same as input

Actual output:

Test.swift:1:24: warning: [RemoveLine] remove line break
Test.swift:2:17: warning: [Spacing] remove 1 space
@available(iOS 17.0, *)#Preview("Name"){
  EmptyView()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions