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
internal/imports: FixImports should be cancellable
Historically, FixImports did not have access to a context, and performed
its imports scan with context.Background. Since then, FixImports is
called by gopls with the CodeAction Context, yet cancelling this context
does not abort the scan. Fix this by using the correct context, and
checking context cancellation before parsing.
It's a little hard to see that context cancellation doesn't leave the
process environent in a broken state, but we can infer that this is OK
because other scans (such as that used by unimported completion) do
cancel their context.
Additionally, remove a 'fixImportsDefault' extensibility seam that is
apparently unused after six years.
For golang/go#67289
Change-Id: I32261b1bfb38af32880e981cd2423414069b32a3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/589975
LUCI-TryBot-Result: Go LUCI <[email protected]>
Auto-Submit: Robert Findley <[email protected]>
Reviewed-by: Alan Donovan <[email protected]>
0 commit comments