From e417ea36bae18ab4aced13c6db31aa330d9f006a Mon Sep 17 00:00:00 2001 From: Robert Findley Date: Thu, 29 Dec 2022 20:07:44 -0500 Subject: [PATCH] gopls: remove dead analysis code Change-Id: I1650a5b6b5a754438db2308e8e27da228bba939c Reviewed-on: https://go-review.googlesource.com/c/tools/+/459790 TryBot-Result: Gopher Robot gopls-CI: kokoro Auto-Submit: Robert Findley Reviewed-by: Alan Donovan Run-TryBot: Robert Findley --- gopls/internal/lsp/cache/analysis.go | 8 -------- gopls/internal/lsp/source/options.go | 25 ------------------------- 2 files changed, 33 deletions(-) diff --git a/gopls/internal/lsp/cache/analysis.go b/gopls/internal/lsp/cache/analysis.go index 8185f23bed2..61e868c5e17 100644 --- a/gopls/internal/lsp/cache/analysis.go +++ b/gopls/internal/lsp/cache/analysis.go @@ -1130,14 +1130,6 @@ func (act *action) exec() (interface{}, *actionSummary, error) { }, nil } -func factType(fact analysis.Fact) reflect.Type { - t := reflect.TypeOf(fact) - if t.Kind() != reflect.Ptr { - panic(fmt.Sprintf("invalid Fact type: got %T, want pointer", fact)) - } - return t -} - // requiredAnalyzers returns the transitive closure of required analyzers in preorder. func requiredAnalyzers(analyzers []*analysis.Analyzer) []*analysis.Analyzer { var result []*analysis.Analyzer diff --git a/gopls/internal/lsp/source/options.go b/gopls/internal/lsp/source/options.go index cf8c6415176..ba6c3f0da2c 100644 --- a/gopls/internal/lsp/source/options.go +++ b/gopls/internal/lsp/source/options.go @@ -1394,31 +1394,6 @@ func (r *OptionResult) setStringSlice(s *[]string) { } } -// EnabledAnalyzers returns all of the analyzers enabled by the options. -func EnabledAnalyzers(options *Options) (analyzers []*Analyzer) { - for _, a := range options.DefaultAnalyzers { - if a.IsEnabled(options) { - analyzers = append(analyzers, a) - } - } - for _, a := range options.TypeErrorAnalyzers { - if a.IsEnabled(options) { - analyzers = append(analyzers, a) - } - } - for _, a := range options.ConvenienceAnalyzers { - if a.IsEnabled(options) { - analyzers = append(analyzers, a) - } - } - for _, a := range options.StaticcheckAnalyzers { - if a.IsEnabled(options) { - analyzers = append(analyzers, a) - } - } - return analyzers -} - func typeErrorAnalyzers() map[string]*Analyzer { return map[string]*Analyzer{ fillreturns.Analyzer.Name: {