-
Notifications
You must be signed in to change notification settings - Fork 18k
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
x/tools/gopls: strange unified diff #60379
Labels
FrozenDueToAge
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
Comments
Yes, the code wrongly concludes that an insertion at the beginning of a
line replaces the whole line. There's already a TODO in the code, so some
clear thought is required.
…On Tue, May 23, 2023 at 10:54 PM Alan Donovan ***@***.***> wrote:
Assigned #60379 <#60379> to @pjweinb
<https://github.com/pjweinb>.
—
Reply to this email directly, view it on GitHub
<#60379 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJIAIZMATXQU2GNRUXPKUDXHVZ57ANCNFSM6AAAAAAYMW5WMM>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
Change https://go.dev/cl/498975 mentions this issue: |
Change https://go.dev/cl/499377 mentions this issue: |
Change https://go.dev/cl/499376 mentions this issue: |
gopherbot
pushed a commit
to golang/tools
that referenced
this issue
Jun 1, 2023
Previously, the expandEdit operation would expand to the end of the line unconditionally, but this caused it to gulp an extra line if it was already line-aligned. This change causes it to do the expansion only if the end is not line-aligned, or the replacement text doesn't end with a newline. Now, removing the fast path no longer causes tests to fail. This also allows us to remove the logic added in CL 489695 to work around issue golang/go#59232. Fixes golang/go#60379 Fixes golang/go#59232 Change-Id: Ia40e4e3bb714d75acb95103a38e8c49a8ef456de Reviewed-on: https://go-review.googlesource.com/c/tools/+/499377 Run-TryBot: Alan Donovan <adonovan@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Peter Weinberger <pjw@google.com>
apstndb
pushed a commit
to apstndb/gotoolsdiff
that referenced
this issue
Jan 11, 2025
The fast-path "optimization" that skips the main algorithm when the input is already line-aligned failed to check that the replacement text consisted of complete lines. (Scare quotes because removing the "optimization" causes tests to fail. See CL 499377 next in stack for why.) Thanks to pjw for diagnosing the root cause and providing the test case in CL 498975. Fixes golang/go#60379 Change-Id: I2ff92de4550754691442362b8a8932ee42971461 Reviewed-on: https://go-review.googlesource.com/c/tools/+/499376 gopls-CI: kokoro <noreply+kokoro@google.com> Run-TryBot: Alan Donovan <adonovan@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Peter Weinberger <pjw@google.com>
apstndb
pushed a commit
to apstndb/gotoolsdiff
that referenced
this issue
Jan 11, 2025
Previously, the expandEdit operation would expand to the end of the line unconditionally, but this caused it to gulp an extra line if it was already line-aligned. This change causes it to do the expansion only if the end is not line-aligned, or the replacement text doesn't end with a newline. Now, removing the fast path no longer causes tests to fail. This also allows us to remove the logic added in CL 489695 to work around issue golang/go#59232. Fixes golang/go#60379 Fixes golang/go#59232 Change-Id: Ia40e4e3bb714d75acb95103a38e8c49a8ef456de Reviewed-on: https://go-review.googlesource.com/c/tools/+/499377 Run-TryBot: Alan Donovan <adonovan@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Peter Weinberger <pjw@google.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
FrozenDueToAge
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
The unified diff output
gopls format
includes a\ No newline at end of file
line in the middle of the file. Is that valid?The text was updated successfully, but these errors were encountered: