Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(707)

Unified Diff: pkg/analysis_server/lib/src/context_manager.dart

Issue 1263443005: Make exclude list also exclude contexts (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/test/context_manager_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8d22758b77fd917a86f4334156681191b9b985b0..723c9c7d069b5c06c9c1711c971f5b87e2e164f3 100644
--- a/pkg/analysis_server/lib/src/context_manager.dart
+++ b/pkg/analysis_server/lib/src/context_manager.dart
@@ -844,9 +844,13 @@ class ContextManagerImpl implements ContextManager {
packageSpec = folder.getChild(PUBSPEC_NAME);
}
- bool parentCreated = false;
- if (packageSpec.exists || !withPackageSpecOnly) {
- parentCreated = true;
+ bool createContext = packageSpec.exists || !withPackageSpecOnly;
+ if (withPackageSpecOnly && packageSpec.exists &&
+ (parent != null) && parent.ignored(packageSpec.path)) {
+ // Don't create a context if the package spec is required and ignored.
+ createContext = false;
+ }
+ if (createContext) {
parent = _createContext(parent, folder, packageSpec);
}
@@ -854,7 +858,9 @@ class ContextManagerImpl implements ContextManager {
try {
for (Resource child in folder.getChildren()) {
if (child is Folder) {
- _createContexts(parent, child, true);
+ if (!parent.ignored(child.path)) {
+ _createContexts(parent, child, true);
+ }
}
}
} on FileSystemException {
@@ -862,7 +868,7 @@ class ContextManagerImpl implements ContextManager {
// are no subfolders that need to be added.
}
- if (parentCreated) {
+ if (createContext) {
// Now that the child contexts have been created, add the sources that
// don't belong to the children.
ChangeSet changeSet = new ChangeSet();
« no previous file with comments | « no previous file | pkg/analysis_server/test/context_manager_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698