internal/lsp/cache: disable analysis on dependencies (temporarily)
Right now, we request analyses for files in ParseExported mode, which
doesn't actually produce any meaningful facts. Disable it until we
resolve golang/go#35089, since right now, all this is doing is wasting
memory and CPU.
Change-Id: I6ffb7bdf6c915159b55753b51289cef4bd937603
Reviewed-on: https://go-review.googlesource.com/c/tools/+/208270
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
diff --git a/internal/lsp/cache/analysis.go b/internal/lsp/cache/analysis.go
index 5c206fa..b20dc1a 100644
--- a/internal/lsp/cache/analysis.go
+++ b/internal/lsp/cache/analysis.go
@@ -104,20 +104,26 @@
}
deps = append(deps, reqActionHandle)
}
- // An analysis that consumes/produces facts
- // must run on the package's dependencies too.
- if len(a.FactTypes) > 0 {
- importIDs := make([]string, 0, len(cph.m.deps))
- for _, importID := range cph.m.deps {
- importIDs = append(importIDs, string(importID))
- }
- sort.Strings(importIDs) // for determinism
- for _, importID := range importIDs {
- depActionHandle, err := s.actionHandle(ctx, packageID(importID), source.ParseExported, a)
- if err != nil {
- return nil, err
+
+ // TODO(golang/go#35089): Re-enable this when we doesn't use ParseExported
+ // mode for dependencies. In the meantime, disable analysis for dependencies,
+ // since we don't get anything useful out of it.
+ if false {
+ // An analysis that consumes/produces facts
+ // must run on the package's dependencies too.
+ if len(a.FactTypes) > 0 {
+ importIDs := make([]string, 0, len(cph.m.deps))
+ for _, importID := range cph.m.deps {
+ importIDs = append(importIDs, string(importID))
}
- deps = append(deps, depActionHandle)
+ sort.Strings(importIDs) // for determinism
+ for _, importID := range importIDs {
+ depActionHandle, err := s.actionHandle(ctx, packageID(importID), source.ParseExported, a)
+ if err != nil {
+ return nil, err
+ }
+ deps = append(deps, depActionHandle)
+ }
}
}