Closed merlinz01 closed 5 months ago
I don't think this is a gopls issue. The following marker test, which exercises the server-side implementation of "semantic tokens", passes, as it should:
func MyTestFunc(firstArg error, secondArg, anotherArg, //@ token("first", "parameter", "definition"), token("second", "parameter", "definition")
thirdArg, fourthArg, //@ token("third", "parameter", "definition"), token("fourth", "parameter", "definition")
fifthArg, sixthArg string, //@ token("fifth", "parameter", "definition"), token("sixth", "parameter", "definition"), token("string", "type", "defaultLibrary")
seventhArg error, eighthArg, ninthArg,
tenthArg string) {
}
So I think this is a VS Code (client-side) issue.
@hyangah Should I transfer it to the other repo?
@merlinz01 This is an issue in the VS Code's default Go syntax highlighting. Please file an issue to https://github.com/worlpaker/go-syntax, or use the semantic token-based highlighting if you want to use Gopls's syntax highlighting capability. https://github.com/golang/vscode-go/wiki/features#syntax-highlighting
Thanks, I enabled semantic tokens and now it highlights corrrectly. I have opened an issue in the go-syntax repo.
gopls version
Build info ---------- golang.org/x/tools/gopls v0.15.2 golang.org/x/tools/gopls@v0.15.2 h1:4JKt4inO8JaFW3l/Fh9X1k/5JQn+iUOpdc4/Lpi0mOs= github.com/BurntSushi/toml@v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= github.com/google/go-cmp@v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= golang.org/x/exp/typeparams@v0.0.0-20221212164502-fae10dda9338 h1:2O2DON6y3XMJiQRAS1UWU+54aec2uopH3x7MAiqGW6Y= golang.org/x/mod@v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= golang.org/x/sync@v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/telemetry@v0.0.0-20240209200032-7b892fcb8a78 h1:vcVnuftN4J4UKLRcgetjzfU9FjjgXUUYUc3JhFplgV4= golang.org/x/text@v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/tools@v0.18.1-0.20240311201521-78fbdeb61842 h1:No0LMXYFkp3j4oEsPdtY8LUQz33gu79Rm9DE+izMeGQ= golang.org/x/vuln@v1.0.1 h1:KUas02EjQK5LTuIx1OylBQdKKZ9jeugs+HiqO5HormU= honnef.co/go/tools@v0.4.6 h1:oFEHCKeID7to/3autwsWfnuv69j3NsfcXbvJKuIcep8= mvdan.cc/gofumpt@v0.6.0 h1:G3QvahNDmpD+Aek/bNOLrFR2XC6ZAdo62dZu65gmwGo= mvdan.cc/xurls/v2@v2.5.0 h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8= go: go1.22rc1
go env
What did you do?
Write a function with a multiline argument list and multiple arguments with the same type:
What did you see happen?
In VSCode:
What did you expect to see?
All the argument names the same color.
Editor and settings
VSCode
Logs