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

code screen will move up after write a unimported package method and undo #1406

Closed
elricli opened this issue Apr 8, 2021 · 3 comments
Closed
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@elricli
Copy link

elricli commented Apr 8, 2021

For asking questions, see:

Before filing an issue, please review our troubleshooting guides

Please answer these questions before submitting your issue. Thanks!

What version of Go, VS Code & VS Code Go extension are you using?

  • Run go version to get version of Go from the VS Code integrated terminal.
    • go version go1.16.3 windows/amd64
  • Run gopls -v version to get version of Gopls from the VS Code integrated terminal.
    • golang.org/x/tools/gopls v0.6.9
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
    • 1.55.0
    • c185983a683d14c396952dd432459097bc7f757f
    • x64
  • Check your installed extensions to get the version of the VS Code Go extension
    • Go Nightly v2021.4.606
  • Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > Go: Locate Configured Go Tools command.
Checking configured tools....
GOBIN: undefined
toolsGopath: 
gopath: C:\Users\User\go
GOROOT: C:\Program Files\Go
PATH: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Git\cmd;C:\Program Files\dotnet\;C:\Program Files\Graphviz 2.44.1\bin;C:\Program Files (x86)\NetSarang\Xshell 7\;C:\Program Files\nodejs\;C:\Program Files\PowerShell\7\;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\Go\bin;C:\Users\User\AppData\Local\Microsoft\WindowsApps;C:\Program Files\JetBrains\GoLand 2020.2.3\bin;;C:\Users\User\AppData\Local\Programs\Microsoft VS Code\bin;C:\Dev\protoc\bin;C:\Program Files\Graphviz 2.44.1\bin;C:\Program Files\Bandizip\;C:\Users\User\AppData\Roaming\npm;C:\Users\User\go\bin

   gopkgs: C:\Users\User\go\bin\gopkgs.exe installed
   go-outline: C:\Users\User\go\bin\go-outline.exe installed
   gotests: C:\Users\User\go\bin\gotests.exe installed
   gomodifytags: C:\Users\User\go\bin\gomodifytags.exe installed
   impl: C:\Users\User\go\bin\impl.exe installed
   goplay: C:\Users\User\go\bin\goplay.exe installed
   dlv: C:\Users\User\go\bin\dlv.exe installed
   dlv-dap: C:\Users\User\go\bin\dlv-dap.exe installed
   golangci-lint: C:\Users\User\go\bin\golangci-lint.exe installed
   gopls: C:\Users\User\go\bin\gopls.exe installed

go env
Workspace Folder (demo): c:\Dev\Project\demo
	set GO111MODULE=on
	set GOARCH=amd64
	set GOBIN=
	set GOCACHE=C:\Users\User\AppData\Local\go-build
	set GOENV=C:\Users\User\AppData\Roaming\go\env
	set GOEXE=.exe
	set GOFLAGS=
	set GOHOSTARCH=amd64
	set GOHOSTOS=windows
	set GOINSECURE=
	set GOMODCACHE=C:\Users\User\go\pkg\mod
	set GONOPROXY=
	set GONOSUMDB=
	set GOOS=windows
	set GOPATH=C:\Users\User\go
	set GOPRIVATE=
	set GOPROXY=https://goproxy.cn,direct
	set GOROOT=C:\Program Files\Go
	set GOSUMDB=sum.golang.org
	set GOTMPDIR=
	set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
	set GOVCS=
	set GOVERSION=go1.16.3
	set GCCGO=gccgo
	set AR=ar
	set CC=gcc
	set CXX=g++
	set CGO_ENABLED=1
	set GOMOD=c:\Dev\Project\demo\go.mod
	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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\User\AppData\Local\Temp\go-build2701170856=/tmp/go-build -gno-record-gcc-switches

Share the Go related settings you have added/edited

{
    "go.toolsManagement.autoUpdate": true,
    "go.lintTool": "golangci-lint",
    "go.useCodeSnippetsOnFunctionSuggest": true,
    "gopls": {
        "usePlaceholders": true
    }
}

Describe the bug

Exec ctrl+z undo, the screen will move up.

Steps to reproduce the behavior:

  1. input the go code
  2. write a unimported package method
  3. ctrl+z
  4. repeat step 2 and 3

Screenshots or recordings

GIF:
output

Others

  • Write typescript code, can not reproduce after write a unimported package method and undo. So, my guess is that the problem is caused by the vscode-go extension
  • Disable all extension, the problem can not reproduce, becasue can not auto completed function.

I hope I have provided enough information

@stamblerre
Copy link
Contributor

Thank you for this report. The problem is probably caused by the fact that the undo also removes imports, so maybe VS Code doesn't handle that well. The Go extension doesn't control which part of the screen is shown, so I'm not sure if this is actually caused by the extension--it seems likely that the problem is VS Code itself. Do you mind opening this issue up in the https://github.com/microsoft/vscode repository instead?

@stamblerre stamblerre added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Apr 8, 2021
@gopherbot gopherbot added this to the Untriaged milestone Apr 8, 2021
@elricli
Copy link
Author

elricli commented Apr 9, 2021

I opened this issue in microsoft/vscode.

@stamblerre
Copy link
Contributor

Thank you! I'll close this issue, but please reopen if it does turn out to be a problem with the Go extension.

@stamblerre stamblerre removed this from the Untriaged milestone Apr 9, 2021
@golang golang locked and limited conversation to collaborators Apr 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants