mirror of https://github.com/golang/go.git
Calling PackagesForFile on builtin.go loads is at a command-line-arguments package, which has many type checking errors. Add a new snapshot method IsBuiltin, which is used to avoid calling PackagesForFile on builtin.go when diagnosing changed files or checking for orphaned files. There may be other places where this should be used, but this functionality can't reasonably be pushed down, as PackagesForFile should always return something. This exacerbated an existing race to building the builtin, because ast.NewPackage unfortunately mutates the ast.File. Fix this by just building the builtin package directly when building the handle. It should be very fast. Fixes golang/go#44866 Change-Id: Ie6c07478493fa011e92e6966289c2fa822d87b35 Reviewed-on: https://go-review.googlesource.com/c/tools/+/314290 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> |
||
|---|---|---|
| .. | ||
| analysisinternal | ||
| apidiff | ||
| event | ||
| fakenet | ||
| fastwalk | ||
| gocommand | ||
| gopathwalk | ||
| imports | ||
| jsonrpc2 | ||
| jsonrpc2_v2 | ||
| lsp | ||
| memoize | ||
| packagesinternal | ||
| proxydir | ||
| span | ||
| stack | ||
| testenv | ||
| tool | ||
| typesinternal | ||
| xcontext | ||