mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 08:24:39 +00:00
Simplify handling of watch events for the new analysis driver.
R=brianwilkerson@google.com BUG= Review URL: https://codereview.chromium.org/2463903002 .
This commit is contained in:
parent
6826e267b9
commit
0257eeb4f5
|
@ -1379,6 +1379,9 @@ class ContextManagerImpl implements ContextManager {
|
|||
if (resource is File) {
|
||||
File file = resource;
|
||||
if (_shouldFileBeAnalyzed(file)) {
|
||||
if (enableNewAnalysisDriver) {
|
||||
info.analysisDriver.addFile(path);
|
||||
} else {
|
||||
ChangeSet changeSet = new ChangeSet();
|
||||
Source source = createSourceInContext(info.context, file);
|
||||
changeSet.addedSource(source);
|
||||
|
@ -1386,6 +1389,7 @@ class ContextManagerImpl implements ContextManager {
|
|||
info.sources[path] = source;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ChangeType.REMOVE:
|
||||
|
||||
|
@ -1420,6 +1424,9 @@ class ContextManagerImpl implements ContextManager {
|
|||
}
|
||||
}
|
||||
|
||||
if (enableNewAnalysisDriver) {
|
||||
info.analysisDriver.removeFile(path);
|
||||
} else {
|
||||
List<Source> sources = info.context.getSourcesWithFullName(path);
|
||||
if (!sources.isEmpty) {
|
||||
ChangeSet changeSet = new ChangeSet();
|
||||
|
@ -1429,8 +1436,12 @@ class ContextManagerImpl implements ContextManager {
|
|||
callbacks.applyChangesToContext(info.folder, changeSet);
|
||||
info.sources.remove(path);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ChangeType.MODIFY:
|
||||
if (enableNewAnalysisDriver) {
|
||||
info.analysisDriver.changeFile(path);
|
||||
} else {
|
||||
List<Source> sources = info.context.getSourcesWithFullName(path);
|
||||
if (!sources.isEmpty) {
|
||||
ChangeSet changeSet = new ChangeSet();
|
||||
|
@ -1439,6 +1450,7 @@ class ContextManagerImpl implements ContextManager {
|
|||
});
|
||||
callbacks.applyChangesToContext(info.folder, changeSet);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
_checkForPackagespecUpdate(path, info, info.folder);
|
||||
|
|
Loading…
Reference in a new issue