mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 15:09:04 +00:00
Rename ChangeNotice resolved Dart/Html unit fields.
R=brianwilkerson@google.com BUG= Review URL: https://codereview.chromium.org//881463004 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43147 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
0d6228609d
commit
2b8c66ea79
|
@ -175,7 +175,7 @@ class PerformAnalysisOperation extends ServerOperation {
|
|||
String file = source.fullName;
|
||||
// Dart
|
||||
CompilationUnit parsedDartUnit = notice.parsedDartUnit;
|
||||
CompilationUnit resolvedDartUnit = notice.compilationUnit;
|
||||
CompilationUnit resolvedDartUnit = notice.resolvedDartUnit;
|
||||
CompilationUnit dartUnit =
|
||||
resolvedDartUnit != null ? resolvedDartUnit : parsedDartUnit;
|
||||
if (resolvedDartUnit != null) {
|
||||
|
@ -238,7 +238,7 @@ class PerformAnalysisOperation extends ServerOperation {
|
|||
for (ChangeNotice notice in notices) {
|
||||
// Dart
|
||||
try {
|
||||
CompilationUnit dartUnit = notice.compilationUnit;
|
||||
CompilationUnit dartUnit = notice.resolvedDartUnit;
|
||||
if (dartUnit != null) {
|
||||
server.addOperation(new _DartIndexOperation(context, dartUnit));
|
||||
}
|
||||
|
@ -247,7 +247,7 @@ class PerformAnalysisOperation extends ServerOperation {
|
|||
}
|
||||
// HTML
|
||||
try {
|
||||
HtmlUnit htmlUnit = notice.htmlUnit;
|
||||
HtmlUnit htmlUnit = notice.resolvedHtmlUnit;
|
||||
if (htmlUnit != null) {
|
||||
server.addOperation(new _HtmlIndexOperation(context, htmlUnit));
|
||||
}
|
||||
|
|
|
@ -514,7 +514,7 @@ abstract class AbstractCompletionTest extends AbstractContextTest {
|
|||
|
||||
// Update the index
|
||||
result.changeNotices.forEach((ChangeNotice notice) {
|
||||
CompilationUnit unit = notice.compilationUnit;
|
||||
CompilationUnit unit = notice.resolvedDartUnit;
|
||||
if (unit != null) {
|
||||
index.indexUnit(context, unit);
|
||||
}
|
||||
|
|
|
@ -499,7 +499,7 @@ class B extends A {
|
|||
var result = context2.performAnalysisTask();
|
||||
while (result.hasMoreWork) {
|
||||
result.changeNotices.forEach((ChangeNotice notice) {
|
||||
CompilationUnit unit = notice.compilationUnit;
|
||||
CompilationUnit unit = notice.resolvedDartUnit;
|
||||
if (unit != null) {
|
||||
index.indexUnit(context2, unit);
|
||||
}
|
||||
|
|
|
@ -220,7 +220,7 @@ part '1111/22/new_name.dart';
|
|||
}
|
||||
for (ChangeNotice notice in result.changeNotices) {
|
||||
if (notice.source.fullName.startsWith('/project/')) {
|
||||
index.indexUnit(context, notice.compilationUnit);
|
||||
index.indexUnit(context, notice.resolvedDartUnit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2370,7 +2370,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
|
|||
_workManager.add(source, SourcePriority.PRIORITY_PART);
|
||||
}
|
||||
ChangeNoticeImpl notice = _getNotice(source);
|
||||
notice.compilationUnit = unit;
|
||||
notice.resolvedDartUnit = unit;
|
||||
notice.setErrors(dartEntry.allErrors, lineInfo);
|
||||
}
|
||||
}
|
||||
|
@ -2454,7 +2454,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
|
|||
_workManager.add(source, SourcePriority.PRIORITY_PART);
|
||||
}
|
||||
ChangeNoticeImpl notice = _getNotice(source);
|
||||
notice.compilationUnit = unit;
|
||||
notice.resolvedDartUnit = unit;
|
||||
notice.setErrors(dartEntry.allErrors, lineInfo);
|
||||
}
|
||||
}
|
||||
|
@ -4626,7 +4626,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
|
|||
CompilationUnit unit = task.compilationUnit;
|
||||
if (unit != null) {
|
||||
ChangeNoticeImpl notice = _getNotice(task.source);
|
||||
notice.compilationUnit = unit;
|
||||
notice.resolvedDartUnit = unit;
|
||||
_incrementalAnalysisCache =
|
||||
IncrementalAnalysisCache.cacheResult(task.cache, unit);
|
||||
}
|
||||
|
@ -4687,7 +4687,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
|
|||
dartEntry.setValue(DartEntry.INCLUDED_PARTS, newParts);
|
||||
_cache.storedAst(source);
|
||||
ChangeNoticeImpl notice = _getNotice(source);
|
||||
if (notice.compilationUnit == null) {
|
||||
if (notice.resolvedDartUnit == null) {
|
||||
notice.parsedDartUnit = task.compilationUnit;
|
||||
}
|
||||
notice.setErrors(dartEntry.allErrors, task.lineInfo);
|
||||
|
@ -4767,7 +4767,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
|
|||
htmlEntry.setValue(HtmlEntry.RESOLUTION_ERRORS, task.resolutionErrors);
|
||||
_cache.storedAst(source);
|
||||
ChangeNoticeImpl notice = _getNotice(source);
|
||||
notice.htmlUnit = task.resolvedUnit;
|
||||
notice.resolvedHtmlUnit = task.resolvedUnit;
|
||||
LineInfo lineInfo = htmlEntry.getValue(SourceEntry.LINE_INFO);
|
||||
notice.setErrors(htmlEntry.allErrors, lineInfo);
|
||||
return htmlEntry;
|
||||
|
@ -4930,8 +4930,8 @@ class AnalysisContextImpl implements InternalAnalysisContext {
|
|||
// reset unit in the notification, it is out of date now
|
||||
ChangeNoticeImpl notice = _pendingNotices[source];
|
||||
if (notice != null) {
|
||||
notice.compilationUnit = null;
|
||||
notice.htmlUnit = null;
|
||||
notice.resolvedDartUnit = null;
|
||||
notice.resolvedHtmlUnit = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5064,7 +5064,7 @@ class AnalysisContextImpl implements InternalAnalysisContext {
|
|||
DartEntry dartEntry = _cache.get(source);
|
||||
LineInfo lineInfo = getLineInfo(source);
|
||||
ChangeNoticeImpl notice = _getNotice(source);
|
||||
notice.compilationUnit = unit;
|
||||
notice.resolvedDartUnit = unit;
|
||||
notice.setErrors(dartEntry.allErrors, lineInfo);
|
||||
});
|
||||
// OK
|
||||
|
@ -7239,23 +7239,23 @@ class CacheState extends Enum<CacheState> {
|
|||
* given source.
|
||||
*/
|
||||
abstract class ChangeNotice implements AnalysisErrorInfo {
|
||||
/**
|
||||
* The parsed, but maybe not resolved Dart AST that changed as a result of
|
||||
* the analysis, or `null` if the AST was not changed.
|
||||
*/
|
||||
CompilationUnit get parsedDartUnit;
|
||||
|
||||
/**
|
||||
* The fully resolved Dart AST that changed as a result of the analysis, or
|
||||
* `null` if the AST was not changed.
|
||||
*/
|
||||
CompilationUnit get compilationUnit;
|
||||
CompilationUnit get resolvedDartUnit;
|
||||
|
||||
/**
|
||||
* The fully resolved HTML AST that changed as a result of the analysis, or
|
||||
* `null` if the AST was not changed.
|
||||
*/
|
||||
ht.HtmlUnit get htmlUnit;
|
||||
|
||||
/**
|
||||
* The parsed, but maybe not resolved Dart AST that changed as a result of
|
||||
* the analysis, or `null` if the AST was not changed.
|
||||
*/
|
||||
CompilationUnit get parsedDartUnit;
|
||||
ht.HtmlUnit get resolvedHtmlUnit;
|
||||
|
||||
/**
|
||||
* Return the source for which the result is being reported.
|
||||
|
@ -7287,13 +7287,13 @@ class ChangeNoticeImpl implements ChangeNotice {
|
|||
* The fully resolved Dart AST that changed as a result of the analysis, or
|
||||
* `null` if the AST was not changed.
|
||||
*/
|
||||
CompilationUnit compilationUnit;
|
||||
CompilationUnit resolvedDartUnit;
|
||||
|
||||
/**
|
||||
* The fully resolved HTML AST that changed as a result of the analysis, or
|
||||
* `null` if the AST was not changed.
|
||||
*/
|
||||
ht.HtmlUnit htmlUnit;
|
||||
ht.HtmlUnit resolvedHtmlUnit;
|
||||
|
||||
/**
|
||||
* The errors that changed as a result of the analysis, or `null` if errors
|
||||
|
|
|
@ -3378,7 +3378,7 @@ f3() {
|
|||
// "newUnit", so all clients will get it using the usual way.
|
||||
AnalysisResult analysisResult = analysisContext.performAnalysisTask();
|
||||
ChangeNotice notice = analysisResult.changeNotices[0];
|
||||
expect(notice.compilationUnit, same(newUnit));
|
||||
expect(notice.resolvedDartUnit, same(newUnit));
|
||||
// Resolve "newCode" from scratch.
|
||||
if (compareWithFull) {
|
||||
_resetWithIncremental(false);
|
||||
|
|
Loading…
Reference in a new issue