You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gopls/internal/golang: refactor.extract.variable: allow all exprs
This CL changes "Extract variable" to allow its use on all
legitimate expressions. Previously it had a short allowlist
of obviously valid forms based on syntax alone, which excluded
anything that might be a type (not a term). It also used to
trigger spuriously on (e.g.) an ExprStmt that calls a nullary
function, or a two-valued comma,ok expression.
Now, it consults the type checker for the definitive answer.
Also, it uses PathEnclosingInterval's "exact" flag so that
extraneous whitespace is permitted.
+ test
Fixesgolang/go#70561
Change-Id: I45471ca99e11b04db02671fbd1702dec2547b258
Reviewed-on: https://go-review.googlesource.com/c/tools/+/631777
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
0 commit comments