Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Unified Diff: pkg/analyzer/lib/src/generated/incremental_resolver.dart

Issue 841813002: Linter analyzer plumbing. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/src/generated/incremental_resolver.dart
===================================================================
--- pkg/analyzer/lib/src/generated/incremental_resolver.dart (revision 42670)
+++ pkg/analyzer/lib/src/generated/incremental_resolver.dart (working copy)
@@ -797,6 +797,7 @@
List<AnalysisError> _resolveErrors = AnalysisError.NO_ERRORS;
List<AnalysisError> _verifyErrors = AnalysisError.NO_ERRORS;
List<AnalysisError> _hints = AnalysisError.NO_ERRORS;
+ List<AnalysisError> _lints = AnalysisError.NO_ERRORS;
/**
* The elements that should be resolved because of API changes.
@@ -840,6 +841,7 @@
// verify
_verify(rootNode);
_generateHints(rootNode);
+ _generateLints(rootNode);
// update entry errors
_updateEntry();
// resolve queue in response of API changes
@@ -967,6 +969,20 @@
}
}
+ 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);
+ } finally {
+ timer.stop('generate hints');
danrubel 2015/01/07 20:17:57 hint -> lint
pquitslund 2015/01/08 00:29:52 Done.
+ }
+ }
+
/**
* Return the element defined by [node], or `null` if the node does not
* define an element.
@@ -1009,6 +1025,7 @@
resolver._resolveReferences(node);
resolver._verify(node);
resolver._generateHints(node);
+ resolver._generateLints(node);
resolver._updateEntry();
} finally {
logger.exit();
@@ -1071,6 +1088,7 @@
_shiftErrors(DartEntry.RESOLUTION_ERRORS);
_shiftErrors(DartEntry.VERIFICATION_ERRORS);
_shiftErrors(DartEntry.HINTS);
+ _shiftErrors(DartEntry.LINTS);
}
void _shiftErrors(DataDescriptor<List<AnalysisError>> descriptor) {
@@ -1116,6 +1134,7 @@
errors);
}
entry.setValueInLibrary(DartEntry.HINTS, librarySource, _hints);
+ entry.setValueInLibrary(DartEntry.LINTS, librarySource, _lints);
}
List<AnalysisError> _updateErrors(List<AnalysisError> oldErrors,

Powered by Google App Engine
This is Rietveld 408576698