diff --git a/internal/lsp/source/analysis.go b/internal/lsp/source/analysis.go index 46e64b41228..b1e777f56a7 100644 --- a/internal/lsp/source/analysis.go +++ b/internal/lsp/source/analysis.go @@ -158,7 +158,7 @@ func (act *Action) execOnce(ctx context.Context, fset *token.FileSet) error { } act.pass = pass - if len(act.Pkg.GetErrors()) > 0 && !pass.Analyzer.RunDespiteErrors { + if act.Pkg.IsIllTyped() && !pass.Analyzer.RunDespiteErrors { act.err = fmt.Errorf("analysis skipped due to errors in package: %v", act.Pkg.GetErrors()) } else { act.result, act.err = pass.Analyzer.Run(pass)