| Index: pkg/analysis_server/lib/src/plugin/plugin_watcher.dart
|
| diff --git a/pkg/analysis_server/lib/src/plugin/plugin_watcher.dart b/pkg/analysis_server/lib/src/plugin/plugin_watcher.dart
|
| index ab3111da39b31178f95aa83e15719acfaf594c53..3f2d312b0d972efb87e56b7158da8a2db6417d4a 100644
|
| --- a/pkg/analysis_server/lib/src/plugin/plugin_watcher.dart
|
| +++ b/pkg/analysis_server/lib/src/plugin/plugin_watcher.dart
|
| @@ -52,8 +52,8 @@ class PluginWatcher implements DriverWatcher {
|
| void addedDriver(AnalysisDriver driver, ContextRoot contextRoot) {
|
| _driverInfo[driver] = new _DriverInfo(
|
| contextRoot, <String>[contextRoot.root, _getSdkPath(driver)]);
|
| - driver.fsState.knownFilesSetChanges.listen((KnownFilesSetChange change) {
|
| - List<String> addedPluginPaths = _checkPluginsFor(driver, change);
|
| + driver.results.listen((AnalysisResult result) {
|
| + List<String> addedPluginPaths = _checkPluginsFor(driver);
|
| for (String pluginPath in addedPluginPaths) {
|
| manager.addPluginToContextRoot(contextRoot, pluginPath);
|
| }
|
| @@ -78,17 +78,9 @@ class PluginWatcher implements DriverWatcher {
|
| * seen that defines a plugin. Return a list of the roots of all such plugins
|
| * that are found.
|
| */
|
| - List<String> _checkPluginsFor(
|
| - AnalysisDriver driver, KnownFilesSetChange change) {
|
| - _DriverInfo info = _driverInfo[driver];
|
| - if (info == null) {
|
| - // The driver must have been removed prior to getting the notification of
|
| - // newly analyzed files.
|
| - return const <String>[];
|
| - }
|
| - List<String> packageRoots = info.packageRoots;
|
| - FileSystemState fileSystemState = driver.fsState;
|
| + List<String> _checkPluginsFor(AnalysisDriver driver) {
|
| AbsolutePathContext context = resourceProvider.absolutePathContext;
|
| + List<String> packageRoots = _driverInfo[driver].packageRoots;
|
|
|
| bool isInRoot(String path) {
|
| for (String root in packageRoots) {
|
| @@ -107,8 +99,8 @@ class PluginWatcher implements DriverWatcher {
|
| }
|
|
|
| List<String> addedPluginPaths = <String>[];
|
| - for (String path in change.added) {
|
| - FileState state = fileSystemState.getFileForPath(path);
|
| + for (FileState state in driver.fsState.knownFiles) {
|
| + String path = state.path;
|
| if (!isInRoot(path)) {
|
| // Found a file not in a previously known package.
|
| Uri uri = state.uri;
|
|
|