-
Notifications
You must be signed in to change notification settings - Fork 231
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
PrettyPrinter reports wrong line numbers #882
Comments
bkolb
added a commit
to bkolb/swift-format
that referenced
this issue
Nov 23, 2024
This is to reproduce issue swiftlang#882. No fix is provided yet. Issue: swiftlang#882
bkolb
added a commit
to bkolb/swift-format
that referenced
this issue
Nov 23, 2024
This is to reproduce issue swiftlang#882. No fix is provided yet. Issue: swiftlang#882
My suspicion is, that the pretty printer is thrown off by multiline comments. In that case, it seems to add only one line for an entire comment block. |
bkolb
added a commit
to bkolb/swift-format
that referenced
this issue
Nov 23, 2024
The reason for the wrong line number were multiline comments. In to accomodate for this, we now check the string while writing for new lines and increment the line count accordingly. Issue: swiftlang#882
Synced to Apple’s issue tracker as rdar://140495994 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a file with a copyright header. This leads to the reporting of wrong line numbers in rules like
EndOfLineComment
Here is an example where the reporting works as expected:
Changing the input to the following will fail:
The error is here is reported in location (line:col 5:52) and should be in (line:col 12:52)
The text was updated successfully, but these errors were encountered: