diff --git a/internal/lsp/cache/view.go b/internal/lsp/cache/view.go index 22602b13..01b533c0 100644 --- a/internal/lsp/cache/view.go +++ b/internal/lsp/cache/view.go @@ -46,9 +46,7 @@ func (v *View) FileSet() *token.FileSet { } func (v *View) GetAnalysisCache() *source.AnalysisCache { - if v.analysisCache == nil { - v.analysisCache = source.NewAnalysisCache() - } + v.analysisCache = source.NewAnalysisCache() return v.analysisCache } diff --git a/internal/lsp/source/analysis.go b/internal/lsp/source/analysis.go index d01369c6..dacac7f3 100644 --- a/internal/lsp/source/analysis.go +++ b/internal/lsp/source/analysis.go @@ -40,10 +40,6 @@ type analysisKey struct { func (c *AnalysisCache) analyze(pkgs []*packages.Package, analyzers []*analysis.Analyzer) []*action { // TODO(matloob): Every time but the first, this needs to re-construct // the invalidated parts of the action graph, probably under a lock? - // We'll take care of that later. For now, clear the entire cache! - for k := range c.m { - delete(c.m, k) - } // Construct the action graph. var mkAction func(a *analysis.Analyzer, pkg *packages.Package) *action