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

Side by Side Diff: pkg/analysis_server/lib/src/context_manager.dart

Issue 1411393003: Issue 24612. Skip excluded folder during contexts creation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/test/context_manager_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library context.directory.manager; 5 library context.directory.manager;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:convert'; 9 import 'dart:convert';
10 import 'dart:core' hide Resource; 10 import 'dart:core' hide Resource;
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 * created for them and excluded from the context associated with the 888 * created for them and excluded from the context associated with the
889 * [folder]. 889 * [folder].
890 * 890 *
891 * If [withPackageSpecOnly] is `true`, a context will be created only if there 891 * If [withPackageSpecOnly] is `true`, a context will be created only if there
892 * is a 'pubspec.yaml' or '.packages' file in the [folder]. 892 * is a 'pubspec.yaml' or '.packages' file in the [folder].
893 * 893 *
894 * [parent] should be the parent of any contexts that are created. 894 * [parent] should be the parent of any contexts that are created.
895 */ 895 */
896 void _createContexts( 896 void _createContexts(
897 ContextInfo parent, Folder folder, bool withPackageSpecOnly) { 897 ContextInfo parent, Folder folder, bool withPackageSpecOnly) {
898 if (folder.shortName.startsWith('.') || folder.shortName == 'packages') { 898 if (_isExcluded(folder.path) ||
899 folder.shortName.startsWith('.') ||
900 folder.shortName == 'packages') {
899 return; 901 return;
900 } 902 }
901 // Decide whether a context needs to be created for [folder] here, and if 903 // Decide whether a context needs to be created for [folder] here, and if
902 // so, create it. 904 // so, create it.
903 File packageSpec = _findPackageSpecFile(folder); 905 File packageSpec = _findPackageSpecFile(folder);
904 bool createContext = packageSpec.exists || !withPackageSpecOnly; 906 bool createContext = packageSpec.exists || !withPackageSpecOnly;
905 if (withPackageSpecOnly && 907 if (withPackageSpecOnly &&
906 packageSpec.exists && 908 packageSpec.exists &&
907 parent != null && 909 parent != null &&
908 parent.ignored(packageSpec.path)) { 910 parent.ignored(packageSpec.path)) {
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 var path = resourceProvider.pathContext.fromUri(uri); 1445 var path = resourceProvider.pathContext.fromUri(uri);
1444 packageMap[name] = <Folder>[resourceProvider.getFolder(path)]; 1446 packageMap[name] = <Folder>[resourceProvider.getFolder(path)];
1445 } 1447 }
1446 }); 1448 });
1447 return <UriResolver>[new SdkExtUriResolver(packageMap)]; 1449 return <UriResolver>[new SdkExtUriResolver(packageMap)];
1448 } else { 1450 } else {
1449 return const <UriResolver>[]; 1451 return const <UriResolver>[];
1450 } 1452 }
1451 } 1453 }
1452 } 1454 }
OLDNEW
« 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