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/undeclaredname: add missing colon when appropriate
This CL improves the undeclared-variable quick fix
by adding the missing colon when appropriate, that is:
1) When the first occurrence of undefined ident's parent within
function is an AssignStmt, and it sits in the left hand side;
2) Its Tok is set to token.ASSIGN (=);
3) Ident must not be self assignment.
Prior to this CL:
1) the new generated one simply sits above
the cursor position, while this CL insert it before the first
undefined ident with the same name.
2) It results in a syntax error, as stated in https://go-review.googlesource.com/c/tools/+/623156/comment/09944936_9d2835c2/,
so this CL also adds a default value derived from its type.
Fixesgolang/go#69980
Change-Id: I4ccad852f89bc60034ade856ad5b1490686fc1e8
GitHub-Last-Rev: 378bdfd
GitHub-Pull-Request: #545
Reviewed-on: https://go-review.googlesource.com/c/tools/+/629895
Auto-Submit: Robert Findley <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Robert Findley <[email protected]>
Reviewed-by: Veronica Silina <[email protected]>
0 commit comments