internal/lsp/hooks: enable staticcheck hooks
Forgot to enable the staticcheck hooks when I created a struct for analyzers inside of the lsp (https://go-review.googlesource.com/c/tools/+/223662).
Change-Id: Ice7798089100107113741caed3ddc41d172830b4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/225837
Run-TryBot: Rohan Challa <rohan@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Paul Jolly <paul@myitcv.org.uk>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
diff --git a/gopls/internal/hooks/analysis.go b/gopls/internal/hooks/analysis.go
index f3388b4..be304d9 100644
--- a/gopls/internal/hooks/analysis.go
+++ b/gopls/internal/hooks/analysis.go
@@ -14,17 +14,17 @@
func updateAnalyzers(options *source.Options) {
if options.StaticCheck {
for _, a := range simple.Analyzers {
- options.Analyzers[a.Name] = source.Analyzer{Analyzer: a}
+ options.Analyzers[a.Name] = source.Analyzer{Analyzer: a, Enabled: true}
}
for _, a := range staticcheck.Analyzers {
// This check conflicts with the vet printf check (golang/go#34494).
if a.Name == "SA5009" {
continue
}
- options.Analyzers[a.Name] = source.Analyzer{Analyzer: a}
+ options.Analyzers[a.Name] = source.Analyzer{Analyzer: a, Enabled: true}
}
for _, a := range stylecheck.Analyzers {
- options.Analyzers[a.Name] = source.Analyzer{Analyzer: a}
+ options.Analyzers[a.Name] = source.Analyzer{Analyzer: a, Enabled: true}
}
}
}