Alan Donovan

Results 347 comments of Alan Donovan

So, the gopls logic is actually correct; the bugs are in the parser and type-checker. The fix in https://go.dev/cl/606535 is a workaround, and an appropriate one for this particular issue,...

> More generally, it may be very difficult to impossible to provide even invalid types for expressions that cannot be properly type checked by the type checker. It seems that...

> I do think it would be valuable to record the non-invariant at Info.Types. Huh, we already do: ```go type Info struct { // Types maps expressions to their types,...

Semantic tokens are mostly concerned with properties of identifiers, which refer to symbols (named entities). The interesting properties of symbols in Go are things like whether they are var/func/const/type/label, and...

> Hmm at leat interface looks like the same abstract level as an concrete type despite it is itself a type, given interface are so widespread in codebase and semantically...

> The ResponseWriter is an interface type and Request is a concrete type, and it would be better to paint ResponseWriter a different color by semantic tokens so we can...

> Because we know a pointer has a prefix *, number types are some finite set such as int32 or float32, and map or slice both has special typedef syntax,...

I will reopen this issue as a more general feature request for semantic tokens to include the top-level type constructor of each identifier.

> I have read the semantic code and it seems there are no easy ways to see the top-level types by design, do you have any suggestions how to implements...