x/tools/gopls: formatting corrupts /**/ comments with CRLF line endings #40355
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
What version of Go, VS Code & VS Code Go extension are you using?
go version
to get version of Gogo version go1.13 windows/amd64
code -v
orcode-insiders -v
to get version of VS Code or VS Code Insidersgo env
to get the go development environment detailsShare the Go related settings you have added/edited
Run
Preferences: Open Settings (JSON)
command to open your settings.json file.Share all the settings with the
go.
or["go"]
orgopls
prefixes.Describe the bug
When working on some files with the
CRLF
line endings, if the auto formatter is going to make changes to the import lines (and maybe others?) it can get into a state where it seems to not account for the length of the line endings.I indicate "seems" as the more lines I give it to remove, the more extra characters it adds back into the file in the wrong place that are splices of nearby lines.
It also behaves if I switch the line ending to LF which is when I started counting the number of characters of garbage I was getting.
Steps to reproduce the behavior:
minimal.go
minimal.go
in vscodeCRLF
in the bottom right of the editor/
Screenshots or recordings
Before and after here:
The text was updated successfully, but these errors were encountered: