x/tools/gopls: guard against panics for analyzers that don't yet support generics #50691
Labels
Analysis
Issues related to static analysis (vet, x/tools/go/analysis)
FrozenDueToAge
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
While we are hopeful to update most analyzers used by gopls for
1.18
, we need to guard against panics from analyzers that don't yet support generics.A general idea is to filter the set of analyses we run on packages that use generics, removing any analyzers that are known to panic or give inaccurate results on generic code. The
x/tools/go/analysis/passes/usesgenerics
analyzer computes package facts intended to facilitate such filtering.Ideally we we would do this filtering for users without any intervention required on their part. However, it's not great to just disable analyses silently: is there any way we can surface this action? Maybe we should include a
window/showMessage
notification the first time that any filtering occurs?The text was updated successfully, but these errors were encountered: