1
0
mirror of https://github.com/golang/go synced 2024-09-30 14:28:33 -06:00
go/internal/analysisinternal
Josh Baum 74a6bbb346 internal/lsp: enhance fillstruct and fillreturns to fill with variables
In the previous implementation, we always created a default
value for each type in the struct or return statement in fillstruct
and fillreturns, respectively. Now, we try to find a variable in scope
that matches the expected type. If we find multiple matches, we choose
the variable that is named most similarly to the type. If we do not
find a variable that matches, we maintain the previous functionality.

Change-Id: I3acb7e27476afaa71aaff9ffb69445913575e2b6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/245130
Run-TryBot: Josh Baum <joshbaum@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2020-08-10 18:49:36 +00:00
..
analysis.go internal/lsp: enhance fillstruct and fillreturns to fill with variables 2020-08-10 18:49:36 +00:00