Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whitespace removed around standalone macro with attribute #689

Open
klanchman opened this issue Feb 9, 2024 · 3 comments
Open

Whitespace removed around standalone macro with attribute #689

klanchman opened this issue Feb 9, 2024 · 3 comments

Comments

@klanchman
Copy link

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()
}
@ahoppen
Copy link
Contributor

ahoppen commented Apr 23, 2024

Tracked in Apple’s issue tracker as rdar://126948308

@MarceNN
Copy link

MarceNN commented Apr 24, 2024

Hi, I couldn't find that issue on apple's tracker. https://openradar.appspot.com/search?query=126948308
Do you have the link?

@ahoppen
Copy link
Contributor

ahoppen commented Apr 24, 2024

The issue has just been synced to Apple’s issue tracker, which isn’t public. Having it represented in there simplifies planning within Apple. We will post any relevant updates to the GitHub issue as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants