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
x/tools/gopls: experimental semantic tokenizing of suggested argument names in user defined function types #45233
Comments
/cc @pjweinb |
That seems to be what it is doing. What should it do? gopls semtok produces /⇒4,keyword,[]/func (/⇒1,variable,[]/a /⇒4,variable,[definition]/Node) /⇒2,member,[definition]/Sh(/⇒3,parameter,[definition]/abc /⇒3,operator,[]/.../⇒3,type,[]/int) {} |
So the part that seems off to me is |
thanks. let me think about it overnight. (or over-weekend). |
There's the same issue in type X struct{A int}, which syntactically just has a StructDecl instead of a FuncDecl, so it need to change both places, i think. |
Yes, I was about to create an issue complaining on that! The following declaration is confusing since all of the contents are colored the same! type rocket struct {
// detalles constructivos
caliber, length, massEmpty float64
// esp. tecnicas
thrustMax, burnTime, propInitialMass float64
// rocket state
apogee, empty, mainParachute bool
} I believe |
Inline type definition seems to work as expected. The following example has the expected behaviour in v := struct{A int}{}
var w struct{A float64}
var u = struct{A complex128}{} Does color |
I will produce a fix. Thanks for reporting this. |
Change https://golang.org/cl/305209 mentions this issue: |
What did you do?
Define some function types:
gopls highlights
xyz
anduvw
(suggested function argument names) as semantic tokens. This may be intentional, but I believe it is worth discussing if these "variable names" should be categorized as types, after allabc
(in the same example) is not categorized as a semantic token.Version info/env
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
I am in the latest release.
What operating system and processor architecture are you using (
go env
)?go env
OutputThe text was updated successfully, but these errors were encountered: