| Index: pkg/analyzer/lib/src/generated/incremental_resolver.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/incremental_resolver.dart b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
|
| index 789ab424947fe66ef48a6405df0f91bf83cbf040..6dd488c51571f252c14eea7188d7cd99823c4d70 100644
|
| --- a/pkg/analyzer/lib/src/generated/incremental_resolver.dart
|
| +++ b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
|
| @@ -999,12 +999,16 @@ class IncrementalResolver {
|
| void _generateLints(AstNode node) {
|
| LoggingTimer timer = logger.startTimer();
|
| try {
|
| - RecordingErrorListener errorListener = new RecordingErrorListener();
|
| - CompilationUnit unit = node.getAncestor((n) => n is CompilationUnit);
|
| - LintGenerator lintGenerator =
|
| - new LintGenerator(<CompilationUnit>[unit], errorListener);
|
| - lintGenerator.generate();
|
| - _lints = errorListener.getErrorsForSource(_source);
|
| + if (_context.analysisOptions.lint) {
|
| + RecordingErrorListener errorListener = new RecordingErrorListener();
|
| + CompilationUnit unit = node.getAncestor((n) => n is CompilationUnit);
|
| + LintGenerator lintGenerator =
|
| + new LintGenerator(<CompilationUnit>[unit], errorListener);
|
| + lintGenerator.generate();
|
| + _lints = errorListener.getErrorsForSource(_source);
|
| + } else {
|
| + _lints = AnalysisError.NO_ERRORS;
|
| + }
|
| } finally {
|
| timer.stop('generate lints');
|
| }
|
|
|