Chromium Code Reviews| Index: pkg/analyzer_plugin/lib/plugin/plugin.dart |
| diff --git a/pkg/analyzer_plugin/lib/plugin/plugin.dart b/pkg/analyzer_plugin/lib/plugin/plugin.dart |
| index 4bbe1fae1f67c340d5fc5e6059b302a5a7c1cf52..5c84f5151e9b4fd9a3314f263424799ced743240 100644 |
| --- a/pkg/analyzer_plugin/lib/plugin/plugin.dart |
| +++ b/pkg/analyzer_plugin/lib/plugin/plugin.dart |
| @@ -269,6 +269,10 @@ abstract class ServerPlugin { |
| // has the side-effect of adding it to the analysis driver scheduler. |
| AnalysisDriverGeneric driver = createAnalysisDriver(contextRoot); |
| driverMap[contextRoot] = driver; |
| + _addFilesToDriver( |
| + driver, |
| + resourceProvider.getResource(contextRoot.root), |
| + contextRoot.exclude); |
| } |
| } |
| for (ContextRoot contextRoot in oldRoots) { |
| @@ -459,6 +463,25 @@ abstract class ServerPlugin { |
| } |
| /** |
| + * Add all of the files contained in the given [resource] that are not in the |
| + * list of [excluded] resources to the given [driver]. |
| + */ |
| + void _addFilesToDriver( |
| + AnalysisDriverGeneric driver, Resource resource, List<String> excluded) { |
| + String path = resource.path; |
| + if (excluded.contains(path) || !resource.exists) { |
|
scheglov
2017/05/18 01:20:40
It does not guarantee anything that the resource e
Brian Wilkerson
2017/05/18 14:43:36
I removed the existence check.
|
| + return; |
| + } |
| + if (resource is File) { |
| + driver.addFile(path); |
| + } else if (resource is Folder) { |
| + for (Resource child in resource.getChildren()) { |
|
scheglov
2017/05/18 01:20:40
getChildren() should be wrapped with try/catch in
Brian Wilkerson
2017/05/18 14:43:36
Done
|
| + _addFilesToDriver(driver, child, excluded); |
| + } |
| + } |
| + } |
| + |
| + /** |
| * Compute the response that should be returned for the given [request], or |
| * `null` if the response has already been sent. |
| */ |