gopls version
golang.org/x/tools/gopls v0.20.0
go env
What did you do?
In Zed, with gopls enabled, I type:
type Demo struct {
Field1
}
func main() {
d := De[...]
}
Where [...] is where my cursor is.
What did you see happen?
gopls suggests Demo as a completion.
What did you expect to see?
gopls knows d := Demo is not valid, as it rightly complains with Demo (type) is not an expression (compiler NotAnExpr).
Therefore, I would expect it to suggest Demo{} as the only valid completion for this instance.
Other possible scenarios where Demo might be valid, such as d := make(chan Demo) are clearly not applicable at the point of completion.
Editor and settings
No response
Logs
No response
gopls version
golang.org/x/tools/gopls v0.20.0
go env
What did you do?
In
Zed, withgoplsenabled, I type:Where
[...]is where my cursor is.What did you see happen?
goplssuggestsDemoas a completion.What did you expect to see?
goplsknowsd := Demois not valid, as it rightly complains withDemo (type) is not an expression (compiler NotAnExpr).Therefore, I would expect it to suggest
Demo{}as the only valid completion for this instance.Other possible scenarios where
Demomight be valid, such asd := make(chan Demo)are clearly not applicable at the point of completion.Editor and settings
No response
Logs
No response