-
Notifications
You must be signed in to change notification settings - Fork 768
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
VSCode (with gopls plugin) local variable usage does not syntax highlighting as expected in function/methods. #920
Comments
Can you please share a |
yes, logs copy/pasted here:
[Trace - 10:08:32.232 AM] Sending request 'textDocument/documentLink - (1)'.Params: {"textDocument":{"uri":"file:///home/nick/go/src/github.com/avlo/golang-reference/iota-poc/003_generate-new_address.go"}}
[Trace - 10:08:32.232 AM] Sending request 'textDocument/codeAction - (2)'.Params: {"textDocument":{"uri":"file:///home/nick/go/src/github.com/avlo/golang-reference/iota-poc/003_generate-new_address.go"},"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":0}},"context":{"diagnostics":[]}}
[Trace - 10:08:32.232 AM] Sending request 'textDocument/documentSymbol - (3)'.Params: {"textDocument":{"uri":"file:///home/nick/go/src/github.com/avlo/golang-reference/iota-poc/003_generate-new_address.go"}}
[Trace - 10:08:32.235 AM] Received response 'textDocument/documentLink - (1)' in 3ms.Result: [{"range":{"start":{"line":7,"character":2},"end":{"line":7,"character":5}},"target":"https://pkg.go.dev/fmt"},{"range":{"start":{"line":9,"character":2},"end":{"line":9,"character":35}},"target":"https://pkg.go.dev/github.com/iotaledger/iota.go@v1.0.0-beta.15/api"},{"range":{"start":{"line":10,"character":2},"end":{"line":10,"character":39}},"target":"https://pkg.go.dev/github.com/iotaledger/iota.go@v1.0.0-beta.15/trinary"},{"range":{"start":{"line":13,"character":12},"end":{"line":13,"character":41}},"target":"https://nodes.devnet.iota.org"}]
[Trace - 10:08:32.242 AM] Received response 'textDocument/codeAction - (2)' in 9ms.Result: null
[Trace - 10:08:32.242 AM] Received response 'textDocument/documentSymbol - (3)' in 9ms.Result: [{"name":"node","detail":"string","kind":13,"range":{"start":{"line":13,"character":0},"end":{"line":13,"character":42}},"selectionRange":{"start":{"line":13,"character":4},"end":{"line":13,"character":8}}},{"name":"seed","detail":"string","kind":14,"range":{"start":{"line":16,"character":0},"end":{"line":16,"character":112}},"selectionRange":{"start":{"line":16,"character":6},"end":{"line":16,"character":10}}},{"name":"securityLevel","detail":"untyped int","kind":14,"range":{"start":{"line":19,"character":0},"end":{"line":19,"character":23}},"selectionRange":{"start":{"line":19,"character":6},"end":{"line":19,"character":19}}},{"name":"main","detail":"()","kind":12,"range":{"start":{"line":21,"character":0},"end":{"line":32,"character":1}},"selectionRange":{"start":{"line":21,"character":5},"end":{"line":21,"character":9}}},{"name":"must","detail":"(err error)","kind":12,"range":{"start":{"line":34,"character":0},"end":{"line":38,"character":1}},"selectionRange":{"start":{"line":34,"character":5},"end":{"line":34,"character":9}}}]
[Trace - 10:08:32.313 AM] Sending request 'textDocument/foldingRange - (4)'.Params: {"textDocument":{"uri":"file:///home/nick/go/src/github.com/avlo/golang-reference/iota-poc/003_generate-new_address.go"}}
[Trace - 10:08:32.314 AM] Received response 'textDocument/foldingRange - (4)' in 1ms.Result: [{"startLine":0,"startCharacter":48,"endLine":2,"endCharacter":48,"kind":"comment"},{"startLine":6,"startCharacter":8,"endLine":10,"endCharacter":40,"kind":"imports"},{"startLine":21,"startCharacter":13,"endLine":31,"endCharacter":49},{"startLine":26,"startCharacter":53,"endLine":27,"endCharacter":96,"kind":"comment"},{"startLine":34,"startCharacter":22,"endLine":37,"endCharacter":2},{"startLine":35,"startCharacter":16,"endLine":36,"endCharacter":12}]
[Trace - 10:08:32.362 AM] Sending request 'textDocument/codeAction - (5)'.Params: {"textDocument":{"uri":"file:///home/nick/go/src/github.com/avlo/golang-reference/iota-poc/003_generate-new_address.go"},"range":{"start":{"line":26,"character":53},"end":{"line":26,"character":53}},"context":{"diagnostics":[]}}
[Trace - 10:08:32.364 AM] Received response 'textDocument/codeAction - (5)' in 1ms.Result: null
[Trace - 10:08:34.597 AM] Sending request 'textDocument/codeLens - (6)'.Params: {"textDocument":{"uri":"file:///home/nick/go/src/github.com/avlo/golang-reference/iota-poc/003_generate-new_address.go"}}
[Trace - 10:08:34.599 AM] Received response 'textDocument/codeLens - (6)' in 1ms.Result: null
On Saturday, November 14, 2020, 9:51:23 AM PST, Rebecca Stambler <notifications@github.com> wrote:
Can you please share a gopls log? You can do so by following the instructions here: https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md#capturing-logs. I just want to confirm that the syntax highlighting isn't coming from gopls.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Thanks for the report and the trace @avlo. The syntax highlighting doesn't come from the gopls. And, the Go's syntax highlighting is done by the vscode itself, not by this extension. VSCode vendors the syntax highligting for Go from better-go-syntax. So, please file an issue in https://github.com/jeff-hykin/better-go-syntax/issues cc @pjweinb |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/nick/.cache/go-build"
GOENV="/home/nick/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/nick/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/nick/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build380113375=/tmp/go-build -gno-record-gcc-switches"
go env
OutputWhat did you do?
VSCode local variable usage does not syntax highlighting as expected in function/methods.
example: local variable
apiRet
assignment correctly highlights (blue):[variable assignment highlights correctly][1]
[1]: https://i.stack.imgur.com/4ViPL.jpg
What did you expect to see?
however, local variable
apiRet
usage does not highlight correctly (white).[variable usage does not highlight correctly][2]
[2]: https://i.stack.imgur.com/oPen2.jpg
note: Screenshots indicate inspect editor textmate scope correctly recognizes local variable assignment as
variable.other.assignment.go
, but does not recognize local variable usage as any scope other thansources.go
What did you see instead?
The text was updated successfully, but these errors were encountered: