| OLD | NEW |
| 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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 * File name of package spec files. | 336 * File name of package spec files. |
| 337 */ | 337 */ |
| 338 static const String PACKAGE_SPEC_NAME = '.packages'; | 338 static const String PACKAGE_SPEC_NAME = '.packages'; |
| 339 | 339 |
| 340 /** | 340 /** |
| 341 * The [ResourceProvider] using which paths are converted into [Resource]s. | 341 * The [ResourceProvider] using which paths are converted into [Resource]s. |
| 342 */ | 342 */ |
| 343 final ResourceProvider resourceProvider; | 343 final ResourceProvider resourceProvider; |
| 344 | 344 |
| 345 /** | 345 /** |
| 346 * The context used to work with file system paths. | |
| 347 */ | |
| 348 pathos.Context pathContext; | |
| 349 | |
| 350 /** | |
| 351 * The context used to work with absolute file system paths. | 346 * The context used to work with absolute file system paths. |
| 352 * | 347 * |
| 353 * TODO(scheglov) remove [pathContext]. | 348 * TODO(scheglov) remove [pathContext]. |
| 354 */ | 349 */ |
| 355 AbsolutePathContext absolutePathContext; | 350 AbsolutePathContext absolutePathContext; |
| 356 | 351 |
| 357 /** | 352 /** |
| 353 * The context used to work with file system paths. |
| 354 */ |
| 355 pathos.Context pathContext; |
| 356 |
| 357 /** |
| 358 * The list of excluded paths (folders and files) most recently passed to | 358 * The list of excluded paths (folders and files) most recently passed to |
| 359 * [setRoots]. | 359 * [setRoots]. |
| 360 */ | 360 */ |
| 361 List<String> excludedPaths = <String>[]; | 361 List<String> excludedPaths = <String>[]; |
| 362 | 362 |
| 363 /** | 363 /** |
| 364 * The list of included paths (folders and files) most recently passed to | 364 * The list of included paths (folders and files) most recently passed to |
| 365 * [setRoots]. | 365 * [setRoots]. |
| 366 */ | 366 */ |
| 367 List<String> includedPaths = <String>[]; | 367 List<String> includedPaths = <String>[]; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 | 410 |
| 411 /** | 411 /** |
| 412 * Stream subscription we are using to watch each analysis root directory for | 412 * Stream subscription we are using to watch each analysis root directory for |
| 413 * changes. | 413 * changes. |
| 414 */ | 414 */ |
| 415 final Map<Folder, StreamSubscription<WatchEvent>> changeSubscriptions = | 415 final Map<Folder, StreamSubscription<WatchEvent>> changeSubscriptions = |
| 416 <Folder, StreamSubscription<WatchEvent>>{}; | 416 <Folder, StreamSubscription<WatchEvent>>{}; |
| 417 | 417 |
| 418 ContextManagerImpl(this.resourceProvider, this.packageResolverProvider, | 418 ContextManagerImpl(this.resourceProvider, this.packageResolverProvider, |
| 419 this._packageMapProvider, this._instrumentationService) { | 419 this._packageMapProvider, this._instrumentationService) { |
| 420 absolutePathContext = resourceProvider.absolutePathContext; |
| 420 pathContext = resourceProvider.pathContext; | 421 pathContext = resourceProvider.pathContext; |
| 421 absolutePathContext = new AbsolutePathContext(pathContext.separator); | |
| 422 } | 422 } |
| 423 | 423 |
| 424 @override | 424 @override |
| 425 List<AnalysisContext> contextsInAnalysisRoot(Folder analysisRoot) { | 425 List<AnalysisContext> contextsInAnalysisRoot(Folder analysisRoot) { |
| 426 List<AnalysisContext> contexts = <AnalysisContext>[]; | 426 List<AnalysisContext> contexts = <AnalysisContext>[]; |
| 427 ContextInfo innermostContainingInfo = | 427 ContextInfo innermostContainingInfo = |
| 428 _getInnermostContextInfoFor(analysisRoot.path); | 428 _getInnermostContextInfoFor(analysisRoot.path); |
| 429 void addContextAndDescendants(ContextInfo info) { | 429 void addContextAndDescendants(ContextInfo info) { |
| 430 contexts.add(info.context); | 430 contexts.add(info.context); |
| 431 info.children.forEach(addContextAndDescendants); | 431 info.children.forEach(addContextAndDescendants); |
| (...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1469 var path = resourceProvider.pathContext.fromUri(uri); | 1469 var path = resourceProvider.pathContext.fromUri(uri); |
| 1470 packageMap[name] = <Folder>[resourceProvider.getFolder(path)]; | 1470 packageMap[name] = <Folder>[resourceProvider.getFolder(path)]; |
| 1471 } | 1471 } |
| 1472 }); | 1472 }); |
| 1473 return <UriResolver>[new SdkExtUriResolver(packageMap)]; | 1473 return <UriResolver>[new SdkExtUriResolver(packageMap)]; |
| 1474 } else { | 1474 } else { |
| 1475 return const <UriResolver>[]; | 1475 return const <UriResolver>[]; |
| 1476 } | 1476 } |
| 1477 } | 1477 } |
| 1478 } | 1478 } |
| OLD | NEW |