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

VSCode (with gopls plugin) local variable usage does not syntax highlighting as expected in function/methods. #920

Closed
avlo opened this issue Nov 13, 2020 · 3 comments

Comments

@avlo
Copy link

@avlo avlo commented Nov 13, 2020

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

$ go version
go.1.15.5

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 Output
$ go env

What 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 than sources.go

What did you see instead?

@stamblerre stamblerre transferred this issue from golang/go Nov 14, 2020
@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Nov 14, 2020

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.

@avlo
Copy link
Author

@avlo avlo commented Nov 17, 2020

@hyangah
Copy link
Contributor

@hyangah hyangah commented Dec 1, 2020

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

@hyangah hyangah closed this Dec 1, 2020
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