-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix trailing comment attribution when file has no final newline (#12082)
Fixes #12081. The issue was the call to `MaybeDetachComment`: the conditional assumed that there was a next token, which was on the same line as the previous one, making attribution unclear. However, if there is no next token, we should not detach. The actual fix is a one-liner. The rest of this PR is updates to the tests to verify this behavior under a handful of scenarios. Closes #12082 COPYBARA_INTEGRATE_REVIEW=#12082 from jhump:jh/fix-trailing-comment-attribution 767e41c PiperOrigin-RevId: 513046172
- Loading branch information
1 parent
8ad6cdd
commit 90623c7
Showing
2 changed files
with
40 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters