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

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

Issue 842533004: Return outline after parse (Closed) Base URL: https://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
« no previous file with comments | « pkg/analysis_server/lib/src/operation/operation_analysis.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/engine.dart
diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
index b8449a503295f28feeb5ad02528e8cebcf783ae7..9480d677f0b365d3b83cf359331549dbdef895c2 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -2370,6 +2370,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
}
ChangeNoticeImpl notice = _getNotice(source);
notice.compilationUnit = unit;
+ notice.resolved = true;
notice.setErrors(dartEntry.allErrors, lineInfo);
}
}
@@ -2454,6 +2455,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
}
ChangeNoticeImpl notice = _getNotice(source);
notice.compilationUnit = unit;
+ notice.resolved = true;
notice.setErrors(dartEntry.allErrors, lineInfo);
}
}
@@ -4626,6 +4628,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
if (unit != null) {
ChangeNoticeImpl notice = _getNotice(task.source);
notice.compilationUnit = unit;
+ notice.resolved = true;
_incrementalAnalysisCache =
IncrementalAnalysisCache.cacheResult(task.cache, unit);
}
@@ -4686,6 +4689,10 @@ class AnalysisContextImpl implements InternalAnalysisContext {
dartEntry.setValue(DartEntry.INCLUDED_PARTS, newParts);
_cache.storedAst(source);
ChangeNoticeImpl notice = _getNotice(source);
+ if (notice.compilationUnit == null) {
+ notice.compilationUnit = task.compilationUnit;
+ notice.resolved = false;
+ }
notice.setErrors(dartEntry.allErrors, task.lineInfo);
// Verify that the incrementally parsed and resolved unit in the incremental
// cache is structurally equivalent to the fully parsed unit
@@ -4764,6 +4771,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
_cache.storedAst(source);
ChangeNoticeImpl notice = _getNotice(source);
notice.htmlUnit = task.resolvedUnit;
+ notice.resolved = true;
LineInfo lineInfo = htmlEntry.getValue(SourceEntry.LINE_INFO);
notice.setErrors(htmlEntry.allErrors, lineInfo);
return htmlEntry;
@@ -5061,6 +5069,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
LineInfo lineInfo = getLineInfo(source);
ChangeNoticeImpl notice = _getNotice(source);
notice.compilationUnit = unit;
+ notice.resolved = true;
notice.setErrors(dartEntry.allErrors, lineInfo);
});
// OK
@@ -7231,37 +7240,38 @@ class CacheState extends Enum<CacheState> {
}
/**
- * The interface `ChangeNotice` defines the behavior of objects that represent a change to the
- * analysis results associated with a given source.
+ * An object that represents a change to the analysis results associated with a
+ * given source.
*/
abstract class ChangeNotice implements AnalysisErrorInfo {
/**
- * Return the fully resolved AST that changed as a result of the analysis, or `null` if the
- * AST was not changed.
- *
- * @return the fully resolved AST that changed as a result of the analysis
+ * Return the AST that changed as a result of the analysis, or `null` if the
+ * AST was not changed. Use the getter [resolved] to determine whether the
+ * AST has been fully resolved.
*/
CompilationUnit get compilationUnit;
/**
- * Return the fully resolved HTML that changed as a result of the analysis, or `null` if the
- * HTML was not changed.
- *
- * @return the fully resolved HTML that changed as a result of the analysis
+ * Return the HTML that changed as a result of the analysis, or `null` if the
+ * HTML was not changed. Use the getter [resolved] to determine whether the
+ * HTML has been fully resolved.
*/
ht.HtmlUnit get htmlUnit;
/**
+ * Return `true` if the [compilationUnit] or [htmlUnit] (whichever is
+ * currently set) has been resolved.
+ */
+ bool get resolved;
+
+ /**
* Return the source for which the result is being reported.
- *
- * @return the source for which the result is being reported
*/
Source get source;
}
/**
- * Instances of the class `ChangeNoticeImpl` represent a change to the analysis results
- * associated with a given source.
+ * An implementation of a [ChangeNotice].
*/
class ChangeNoticeImpl implements ChangeNotice {
/**
@@ -7275,25 +7285,34 @@ class ChangeNoticeImpl implements ChangeNotice {
final Source source;
/**
- * The fully resolved AST that changed as a result of the analysis, or `null` if the AST was
- * not changed.
+ * The AST that changed as a result of the analysis, or `null` if the AST was
+ * not changed. Use the getter [resolved] to determine whether the AST has
+ * been fully resolved.
*/
CompilationUnit compilationUnit;
/**
- * The fully resolved HTML that changed as a result of the analysis, or `null` if the HTML
- * was not changed.
+ * The HTML that changed as a result of the analysis, or `null` if the HTML
+ * was not changed. Use the getter [resolved] to determine whether the HTML
+ * has been fully resolved.
*/
ht.HtmlUnit htmlUnit;
/**
- * The errors that changed as a result of the analysis, or `null` if errors were not
- * changed.
+ * A flag indicating whether the [compilationUnit] or [htmlUnit] (whichever is
+ * currently set) has been resolved.
+ */
+ bool resolved = false;
+
+ /**
+ * The errors that changed as a result of the analysis, or `null` if errors
+ * were not changed.
*/
List<AnalysisError> _errors;
/**
- * The line information associated with the source, or `null` if errors were not changed.
+ * The line information associated with the source, or `null` if errors were
+ * not changed.
*/
LineInfo _lineInfo;
@@ -7311,11 +7330,8 @@ class ChangeNoticeImpl implements ChangeNotice {
LineInfo get lineInfo => _lineInfo;
/**
- * Set the errors that changed as a result of the analysis to the given errors and set the line
- * information to the given line information.
- *
- * @param errors the errors that changed as a result of the analysis
- * @param lineInfo the line information associated with the source
+ * Set the errors that changed as a result of the analysis to the given
+ * [errors] and set the line information to the given [lineInfo].
*/
void setErrors(List<AnalysisError> errors, LineInfo lineInfo) {
this._errors = errors;
« no previous file with comments | « pkg/analysis_server/lib/src/operation/operation_analysis.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698