-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Open
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.
Milestone
Description
gopls version
golang.org/x/tools/gopls v0.20.0
go env
N/AWhat 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
Metadata
Metadata
Assignees
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.