Skip to content

gopls isn't emitting warnings #30932

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

Closed
sbromberger opened this issue Mar 19, 2019 · 1 comment
Closed

gopls isn't emitting warnings #30932

sbromberger opened this issue Mar 19, 2019 · 1 comment

Comments

@sbromberger
Copy link

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

go version go1.12.1 darwin/amd64

Does this issue reproduce with the latest release?

yes

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

go env Output
seth@snoopy:~/dev/go/src/github.com/sbromberger/test$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/seth/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/seth/dev/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.1/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
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/2s/2yph0ncn3cd9myvzw2cn8l_w0000gn/T/go-build449639304=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

started gopls via vim-lsp with -logfile /tmp/gopls.log and opened a file with the following code: https://play.golang.org/p/h-brfsSp7cj

What did you expect to see?

I expected to see gopls notify of one error (line 11) and one warning (line 6).

What did you see instead?

Error was detected; warning was not:

[Trace - 12:17:24 PM] Sending request 'initialize - (1)'.
Params: {"rootUri":"file:///Users/seth/dev/go/src/github.com/sbromberger/test","capabilities":{"workspace":{"applyEdit ":true}},"rootPath":"/Users/seth/dev/go/src/github.com/sbromberger/test","processId":17906,"trace":"off"}


[Trace - 12:17:24 PM] Received response 'initialize - (1)' in 1ms.
Params: {"capabilities":{"textDocumentSync":{"openClose":true,"change":1},"hoverProvider":true,"completionProvider":{"triggerCharacters":["."]},"signatureHelpProvider":{"triggerCharacters":["(",","]},"definitionProvider":true,"codeActionProvider":true,"documentFormattingProvider":true,"documentRangeFormattingProvider":true,"typeDefinitionProvider":true},"custom":null}


[Trace - 12:17:24 PM] Sending notification 'initialized'.
Params: {}


[Trace - 12:17:24 PM] Sending notification 'textDocument/didOpen'.
Params: {"textDocument":{"uri":"file:///Users/seth/dev/go/src/github.com/sbromberger/test/test.go","version":1,"languageId":"go","text":"package main\n\nfunc test(a int) bool {\n\tif a == 5 {\n\t\treturn true\n\t} else {\n\t\treturn false\n\t}\n}\nfunc main() {\n\ta := 6\n}\n"}}


[Trace - 12:17:24 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {"uri":"file:///Users/seth/dev/go/src/github.com/sbromberger/test/test.go","diagnostics":[{"range":{"start":{"line":10,"character":1},"end":{"line":10,"character":2}},"severity":1,"source":"LSP","message":"a declared but not used"}]}
@sbromberger
Copy link
Author

After discussion with @stamblerre , I understand that gopls does not (yet?) support linting. This is why the warning isn't showing up.

@golang golang locked and limited conversation to collaborators Mar 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants