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

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

Issue 1222433003: Invalidate both hints and lints on incremental resolution. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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
diff --git a/pkg/analyzer/lib/src/generated/incremental_resolver.dart b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
index 6f5480d992ffccf7493b4fdf7b7f45f27e53cda0..259cd030933d9bd0006e5f1e596e32c91f59b7c9 100644
--- a/pkg/analyzer/lib/src/generated/incremental_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
@@ -899,7 +899,6 @@ class IncrementalResolver {
List<AnalysisError> _resolveErrors = AnalysisError.NO_ERRORS;
List<AnalysisError> _verifyErrors = AnalysisError.NO_ERRORS;
- List<AnalysisError> _lints = AnalysisError.NO_ERRORS;
/**
* Initialize a newly created incremental resolver to resolve a node in the
@@ -941,7 +940,6 @@ class IncrementalResolver {
// verify
_verify(rootNode);
_context.invalidateLibraryHints(_librarySource);
- _generateLints(rootNode);
// update entry errors
_updateEntry();
// notify unit
@@ -1053,24 +1051,6 @@ class IncrementalResolver {
throw new AnalysisException("Cannot resolve node: no resolvable node");
}
- void _generateLints(AstNode node) {
- LoggingTimer timer = logger.startTimer();
- try {
- 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');
- }
- }
-
/**
* Return the element defined by [node], or `null` if the node does not
* define an element.
@@ -1201,21 +1181,8 @@ class IncrementalResolver {
}
void _updateEntry_OLD() {
- {
- List<AnalysisError> oldErrors = oldEntry.getValueInLibrary(
- DartEntry.RESOLUTION_ERRORS, _librarySource);
- List<AnalysisError> errors = _updateErrors(oldErrors, _resolveErrors);
- oldEntry.setValueInLibrary(
- DartEntry.RESOLUTION_ERRORS, _librarySource, errors);
- }
- {
- List<AnalysisError> oldErrors = oldEntry.getValueInLibrary(
- DartEntry.VERIFICATION_ERRORS, _librarySource);
- List<AnalysisError> errors = _updateErrors(oldErrors, _verifyErrors);
- oldEntry.setValueInLibrary(
- DartEntry.VERIFICATION_ERRORS, _librarySource, errors);
- }
- oldEntry.setValueInLibrary(DartEntry.LINTS, _librarySource, _lints);
+ _updateErrors_OLD(DartEntry.RESOLUTION_ERRORS, _resolveErrors);
+ _updateErrors_OLD(DartEntry.VERIFICATION_ERRORS, _verifyErrors);
}
List<AnalysisError> _updateErrors(
@@ -1249,6 +1216,14 @@ class IncrementalResolver {
newUnitEntry.setValueIncremental(descriptor, errors);
}
+ void _updateErrors_OLD(DataDescriptor<List<AnalysisError>> descriptor,
+ List<AnalysisError> newErrors) {
+ List<AnalysisError> oldErrors =
+ oldEntry.getValueInLibrary(descriptor, _librarySource);
+ List<AnalysisError> errors = _updateErrors(oldErrors, newErrors);
+ oldEntry.setValueInLibrary(descriptor, _librarySource, errors);
+ }
+
void _verify(AstNode node) {
LoggingTimer timer = logger.startTimer();
try {
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/test/generated/incremental_resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698