forked from swaggo/swag
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix formatting crosstalk (swaggo#1317)
* Foramtter: add multi-function test. * Formatter: model changes as byte-range edits. The previous find-and-replace technique for replacing comment lines with their formatted counterparts could apply the change to the wrong line, when multiple identical comment lines exited. This led to “crosstalk”: a formatting change to a comment on one function being applied to another, unrelated function. By modeling each desired replacement with the byte range that it specifically applies to, replacements are now always made to the desired location. * Formatter: preallocate the edit list.
- Loading branch information
Showing
2 changed files
with
100 additions
and
28 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