| Index: pkg/analysis_server/lib/src/context_manager.dart
|
| diff --git a/pkg/analysis_server/lib/src/context_manager.dart b/pkg/analysis_server/lib/src/context_manager.dart
|
| index 73ae4c96fa56c9b3f93c68b3b9ca6deadb92b78c..18e5136e67b63c64ee79a471cf7d7aec7359f5a6 100644
|
| --- a/pkg/analysis_server/lib/src/context_manager.dart
|
| +++ b/pkg/analysis_server/lib/src/context_manager.dart
|
| @@ -263,8 +263,8 @@ abstract class ContextManager {
|
| break;
|
| }
|
| Resource resource = resourceProvider.getResource(path);
|
| - // pubspec was added, extract a new context
|
| - if (_isPubspec(path)) {
|
| + // pubspec was added in a sub-folder, extract a new context
|
| + if (_isPubspec(path) && info.isRoot && !info.isPubspec(path)) {
|
| _extractContext(info, resource);
|
| return;
|
| }
|
| @@ -284,7 +284,7 @@ abstract class ContextManager {
|
| break;
|
| case ChangeType.REMOVE:
|
| // pubspec was removed, merge the context into its parent
|
| - if (info.isPubspec(path)) {
|
| + if (info.isPubspec(path) && !info.isRoot) {
|
| _mergeContext(info);
|
| return;
|
| }
|
| @@ -450,6 +450,11 @@ class _ContextInfo {
|
| }
|
|
|
| /**
|
| + * Returns `true` if this context is root folder based.
|
| + */
|
| + bool get isRoot => parent == null;
|
| +
|
| + /**
|
| * Returns `true` if [path] is excluded, as it is in one of the children.
|
| */
|
| bool excludes(String path) {
|
|
|