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

gopls: no way to close notifications #1234

Closed
warriorstar-orion opened this issue Feb 17, 2021 · 11 comments · May be fixed by #3633
Closed

gopls: no way to close notifications #1234

warriorstar-orion opened this issue Feb 17, 2021 · 11 comments · May be fixed by #3633
Labels
gopls gopls related issues upstream-tools Issues that are caused by problems in the tools that the extension depends on.

Comments

@warriorstar-orion
Copy link

Hello, thank you for all your hard work.

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.15.7 darwin/amd64
  • Run gopls -v version to get version of Gopls from the VS Code integrated terminal.

    • command not found: gopls
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.

    • 1.53.2
  • Check your installed extensions to get the version of the VS Code Go extension

    • v0.22.1
  • Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > Go: Locate Configured Go Tools command.

`Go: Locate Configured Go Tools`
Checking configured tools....
GOBIN: undefined
toolsGopath: 
gopath: /private/var/tmp/bazelbuild-bin/global_go_path/
GOROOT: /usr/local/Cellar/go/1.15.7_1/libexec
PATH: /Users/orion/.pyenv/shims:/Users/orion/.nvm/versions/node/v9.2.0/bin:/usr/local/sbin:/usr/local/bin:/Users/orion/System/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Library/Apple/usr/bin:/Users/orion/.cargo/bin:/usr/local/opt/fzf/bin

   gopkgs: /private/var/tmp/bazelbuild-bin/global_go_path/bin/gopkgs installed
   go-outline: /private/var/tmp/bazelbuild-bin/global_go_path/bin/go-outline installed
   gotests: /private/var/tmp/bazelbuild-bin/global_go_path/bin/gotests installed
   gomodifytags: /private/var/tmp/bazelbuild-bin/global_go_path/bin/gomodifytags installed
   impl: /private/var/tmp/bazelbuild-bin/global_go_path/bin/impl installed
   goplay: /private/var/tmp/bazelbuild-bin/global_go_path/bin/goplay installed
   dlv: /private/var/tmp/bazelbuild-bin/global_go_path/bin/dlv installed
   golint: /private/var/tmp/bazelbuild-bin/global_go_path/bin/golint installed
   gopls: /private/var/tmp/bazelbuild-bin/global_go_path/bin/gopls installed

go env
Workspace Folder (Projects): /Users/orion/Projects
	GO111MODULE=""
	GOARCH="amd64"
	GOBIN=""
	GOCACHE="/Users/orion/Library/Caches/go-build"
	GOENV="/Users/orion/Library/Application Support/go/env"
	GOEXE=""
	GOFLAGS=""
	GOHOSTARCH="amd64"
	GOHOSTOS="darwin"
	GOINSECURE=""
	GOMODCACHE="/private/var/tmp/bazelbuild-bin/global_go_path/pkg/mod"
	GONOPROXY=""
	GONOSUMDB=""
	GOOS="darwin"
	GOPATH="/private/var/tmp/bazelbuild-bin/global_go_path/"
	GOPRIVATE=""
	GOPROXY="https://proxy.golang.org,direct"
	GOROOT="/usr/local/Cellar/go/1.15.7_1/libexec"
	GOSUMDB="sum.golang.org"
	GOTMPDIR=""
	GOTOOLDIR="/usr/local/Cellar/go/1.15.7_1/libexec/pkg/tool/darwin_amd64"
	GCCGO="gccgo"
	AR="ar"
	CC="clang"
	CXX="clang++"
	CGO_ENABLED="1"
	GOMOD=""
	CGO_CFLAGS="-g -O2"
	CGO_CPPFLAGS=""
	CGO_CXXFLAGS="-g -O2"
	CGO_FFLAGS="-g -O2"
	CGO_LDFLAGS="-g -O2"
	PKG_CONFIG="pkg-config"
	GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/mh/x76pfqyn4pl55v0yx9vl5bxw0000gn/T/go-build753216086=/tmp/go-build -gno-record-gcc-switches -fno-common"

Share 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"] or gopls prefixes.

   "go.buildOnSave": "off",
    "go.lintOnSave": "off",
    "go.vetOnSave": "off",
    "[go]": {
        "editor.insertSpaces": false,
        "editor.formatOnSave": false,
        "editor.codeActionsOnSave": {
            "source.organizeImports": false
        }
    },

Describe the bug

Notifications from this extension cannot be closed completely. As a result, when minimized, they instead are displayed as a line of text in the status bar at the bottom of the workbench, clobbering any text there, including e.g. Vim extensions' status lines.

This is especially painful since it persists even if the file one is looking at isn't a Go source file.

Steps to reproduce the behavior:

  1. Open a Workspace containing several folders, some of which contain Golang source, some of which don't.
  2. Open one of the Golang source files.
  3. See notification. In this case, the notification is prefixed with "Error loading workspace: ..." The text and cause of the error is irrelevant and not the problem I'm trying to solve (the project in question is a Bazel-based monorepo so module files are not included or used, being "outside of a module" is a permanent and desired state).
  4. Observe that the notification cannot be closed, only minimized.
  5. Minimize the notification.
  6. Observe that it is now relegated to the workbench status bar, replacing the VIM status line or pushing it to the far side of the status bar.
  7. Close the Golang file, and open another kind of file, such as a Markdown or C++ source file.
  8. Observe that the notification persists despite no longer being germane to the focused source file.

Screenshots or recordings

Screen Shot 2021-02-17 at 08 04 57

Screen Shot 2021-02-17 at 08 06 45

Thanks again!

@hyangah
Copy link
Contributor

hyangah commented Feb 17, 2021

@warriorstar-orion Thanks for the report.
That's unfortunate - this is not a normal notification, but the uncancelable progress notification.
In this specific case, it's better to disable the language server (please add "go.useLanguageServer": false in the setting).
gopls doesn't handle bazel-based monorepo yet.

cc @stamblerre

@hyangah hyangah changed the title No way to close notifications gopls: no way to close notifications Feb 17, 2021
@hyangah hyangah added gopls gopls related issues upstream-tools Issues that are caused by problems in the tools that the extension depends on. labels Feb 17, 2021
@gopherbot gopherbot added this to the Untriaged milestone Apr 8, 2021
@stamblerre
Copy link
Contributor

Closing, as gopls does not yet support Bazel, and we don't have plans to change the notification style.

@stamblerre stamblerre removed this from the Untriaged milestone Apr 9, 2021
@golang golang deleted a comment from gopherbot Apr 13, 2021
@gopherbot
Copy link
Collaborator

Change https://golang.org/cl/374280 mentions this issue: Upgraded go and build to latest versions

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/389994 mentions this issue: src/goGenerateTests: fix method can not generate test in gopls document symbol

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/417315 mentions this issue: Update debugging.md

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/451755 mentions this issue: src/goRunTestCodelens: add codelens for sub tests

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/527979 mentions this issue: src/goTest: Convert pprof web URL to externally available URL

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/536595 mentions this issue: #2698

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/568595 mentions this issue: r/issue/issues in repo's issues URL

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/594535 mentions this issue: fix broken link to VSCode Workspace Settings docs in gopath.md

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/611915 mentions this issue: fix typo in settings documentation: "treateed" to "treated"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls gopls related issues upstream-tools Issues that are caused by problems in the tools that the extension depends on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants