mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 12:24:24 +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
1 changed files with 32 additions and 20 deletions
|
@ -1379,6 +1379,9 @@ class ContextManagerImpl implements ContextManager {
|
||||||
if (resource is File) {
|
if (resource is File) {
|
||||||
File file = resource;
|
File file = resource;
|
||||||
if (_shouldFileBeAnalyzed(file)) {
|
if (_shouldFileBeAnalyzed(file)) {
|
||||||
|
if (enableNewAnalysisDriver) {
|
||||||
|
info.analysisDriver.addFile(path);
|
||||||
|
} else {
|
||||||
ChangeSet changeSet = new ChangeSet();
|
ChangeSet changeSet = new ChangeSet();
|
||||||
Source source = createSourceInContext(info.context, file);
|
Source source = createSourceInContext(info.context, file);
|
||||||
changeSet.addedSource(source);
|
changeSet.addedSource(source);
|
||||||
|
@ -1386,6 +1389,7 @@ class ContextManagerImpl implements ContextManager {
|
||||||
info.sources[path] = source;
|
info.sources[path] = source;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ChangeType.REMOVE:
|
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);
|
List<Source> sources = info.context.getSourcesWithFullName(path);
|
||||||
if (!sources.isEmpty) {
|
if (!sources.isEmpty) {
|
||||||
ChangeSet changeSet = new ChangeSet();
|
ChangeSet changeSet = new ChangeSet();
|
||||||
|
@ -1429,8 +1436,12 @@ class ContextManagerImpl implements ContextManager {
|
||||||
callbacks.applyChangesToContext(info.folder, changeSet);
|
callbacks.applyChangesToContext(info.folder, changeSet);
|
||||||
info.sources.remove(path);
|
info.sources.remove(path);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ChangeType.MODIFY:
|
case ChangeType.MODIFY:
|
||||||
|
if (enableNewAnalysisDriver) {
|
||||||
|
info.analysisDriver.changeFile(path);
|
||||||
|
} else {
|
||||||
List<Source> sources = info.context.getSourcesWithFullName(path);
|
List<Source> sources = info.context.getSourcesWithFullName(path);
|
||||||
if (!sources.isEmpty) {
|
if (!sources.isEmpty) {
|
||||||
ChangeSet changeSet = new ChangeSet();
|
ChangeSet changeSet = new ChangeSet();
|
||||||
|
@ -1439,6 +1450,7 @@ class ContextManagerImpl implements ContextManager {
|
||||||
});
|
});
|
||||||
callbacks.applyChangesToContext(info.folder, changeSet);
|
callbacks.applyChangesToContext(info.folder, changeSet);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
_checkForPackagespecUpdate(path, info, info.folder);
|
_checkForPackagespecUpdate(path, info, info.folder);
|
||||||
|
|
Loading…
Reference in a new issue