1
0
mirror of https://github.com/golang/go synced 2024-11-18 17:04:41 -07:00
go/internal/imports
Suzy Mueller fdb8f0bb4e internal/lsp: cache the imports ProcessEnv across imports calls
The imports ProcessEnv contains cached module and filesystem state. This change
allows gopls to use the same ProcessEnv and resolver across multiple calls to the
internal/imports library.

A ProcessEnv belongs to a view, because the cached module state depends
on the module that is open in the workspace.

Since we do not yet track whether the 'go.mod' file has changed, we
conservatively reset the cached state in the module resolver before
every call to imports.Process.

Change-Id: I27c8e212cb0b477ff425d5ed98a544b27b7d92ee
Reviewed-on: https://go-review.googlesource.com/c/tools/+/184921
Run-TryBot: Suzy Mueller <suzmue@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-07-16 21:50:18 +00:00
..
testdata/mod imports: rename to internal/imports 2019-05-20 21:49:35 +00:00
fix_test.go internal/lsp: cache the imports ProcessEnv across imports calls 2019-07-16 21:50:18 +00:00
fix.go internal/lsp: cache the imports ProcessEnv across imports calls 2019-07-16 21:50:18 +00:00
imports.go internal/lsp, internal/imports: use the internal goimports library 2019-07-01 19:45:22 +00:00
mkindex.go imports: rename to internal/imports 2019-05-20 21:49:35 +00:00
mkstdlib.go imports: rename to internal/imports 2019-05-20 21:49:35 +00:00
mod_112_test.go imports: rename to internal/imports 2019-05-20 21:49:35 +00:00
mod_test.go internal/lsp: cache the imports ProcessEnv across imports calls 2019-07-16 21:50:18 +00:00
mod.go internal/lsp: cache the imports ProcessEnv across imports calls 2019-07-16 21:50:18 +00:00
proxy_112_test.go imports: rename to internal/imports 2019-05-20 21:49:35 +00:00
proxy_113_test.go imports: rename to internal/imports 2019-05-20 21:49:35 +00:00
sortimports.go imports: rename to internal/imports 2019-05-20 21:49:35 +00:00
zstdlib.go imports: rename to internal/imports 2019-05-20 21:49:35 +00:00