mirror of
https://github.com/golang/go
synced 2024-11-18 10:14:45 -07:00
internal/lsp/cache: vendored packages are not workspace packages
Most people aren't going to edit vendored packages; we don't need to fully analyze them. Fixes golang/go#38080. Change-Id: I9c9a286b5340ecffe976b0ea652f1d3b4de4bd41 Reviewed-on: https://go-review.googlesource.com/c/tools/+/237598 Run-TryBot: Heschi Kreinick <heschi@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This commit is contained in:
parent
ca43edf915
commit
02f7de68dc
7
internal/lsp/cache/load.go
vendored
7
internal/lsp/cache/load.go
vendored
@ -210,13 +210,18 @@ func (s *snapshot) setMetadata(ctx context.Context, pkgPath packagePath, pkg *pa
|
||||
}
|
||||
|
||||
// Set the workspace packages. If any of the package's files belong to the
|
||||
// view, then the package is considered to be a workspace package.
|
||||
// view, then the package may be a workspace package.
|
||||
for _, uri := range append(m.compiledGoFiles, m.goFiles...) {
|
||||
if !s.view.contains(uri) {
|
||||
continue
|
||||
}
|
||||
|
||||
// The package's files are in this view. It may be a workspace package.
|
||||
if strings.Contains(string(uri), "/vendor/") {
|
||||
// Vendored packages are not likely to be interesting to the user.
|
||||
continue
|
||||
}
|
||||
|
||||
switch m.forTest {
|
||||
case "":
|
||||
// A normal package.
|
||||
|
Loading…
Reference in New Issue
Block a user