Skip to content
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: formatting repeats last characters of /**/ comments #41128

Closed
mrg0lden opened this issue Aug 29, 2020 · 2 comments
Closed

x/tools/gopls: formatting repeats last characters of /**/ comments #41128

mrg0lden opened this issue Aug 29, 2020 · 2 comments
Labels
Milestone

Comments

@mrg0lden
Copy link

@mrg0lden mrg0lden commented Aug 29, 2020

What version of Go are you using (go version)?

$ go version
go version go1.15 windows/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\MrGol\AppData\Local\go-build
set GOENV=C:\Users\MrGol\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\MrGol\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\MrGol\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\MrGol\AppData\Local\Temp\go-build760839506=/tmp/go-build -gno-record-gcc-switches

What did you do?

I'm using the latest version of Go's extension on vscode with gopls enabled.

Go's extension version: 0.16.1

$ gopls version
golang.org/x/tools/gopls 0.4.4
    golang.org/x/tools/gopls@v0.4.4 h1:8djGYsaZ0ByP0vaXg4T+mnyfDcHpWKSZ+tpQSGv9ahk=

I also have formatOnSave enabled.

NOTE: I'm aware of the issue #40355 but I'm not sure they're the same problem

for example, this code
package tables

/*
	Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in 
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in 
culpa qui officia deserunt mollit anim id est laborum.
*/

becomes like this
package tables

/*
	Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.
*/um.
*/

What did you expect to see?

Not to have the last characters get repated

What did you see instead?

Latest characters gets repeated annoyingly.

@gopherbot gopherbot added this to the Unreleased milestone Aug 29, 2020
@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Aug 29, 2020

You can work around this for now by using LF line endings instead of CRLF -- you can toggle this setting in the bottom right corner of VS Code. gofmt always uses LF line endings, so this shouldn't cause any issues.

@stamblerre stamblerre closed this Aug 29, 2020
@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Aug 29, 2020

Duplicate of #41057

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.