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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:collection'; | 6 import 'dart:collection'; |
7 import 'dart:convert'; | 7 import 'dart:convert'; |
8 import 'dart:core'; | 8 import 'dart:core'; |
9 | 9 |
10 import 'package:analysis_server/src/analysis_server.dart'; | |
11 import 'package:analyzer/context/context_root.dart'; | 10 import 'package:analyzer/context/context_root.dart'; |
12 import 'package:analyzer/file_system/file_system.dart'; | 11 import 'package:analyzer/file_system/file_system.dart'; |
13 import 'package:analyzer/instrumentation/instrumentation.dart'; | 12 import 'package:analyzer/instrumentation/instrumentation.dart'; |
14 import 'package:analyzer/plugin/resolver_provider.dart'; | 13 import 'package:analyzer/plugin/resolver_provider.dart'; |
15 import 'package:analyzer/source/analysis_options_provider.dart'; | 14 import 'package:analyzer/source/analysis_options_provider.dart'; |
16 import 'package:analyzer/source/package_map_provider.dart'; | 15 import 'package:analyzer/source/package_map_provider.dart'; |
17 import 'package:analyzer/source/package_map_resolver.dart'; | 16 import 'package:analyzer/source/package_map_resolver.dart'; |
18 import 'package:analyzer/source/path_filter.dart'; | 17 import 'package:analyzer/source/path_filter.dart'; |
19 import 'package:analyzer/source/pub_package_map_provider.dart'; | 18 import 'package:analyzer/source/pub_package_map_provider.dart'; |
20 import 'package:analyzer/source/sdk_ext.dart'; | 19 import 'package:analyzer/source/sdk_ext.dart'; |
(...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1148 Packages packages = _readPackagespec(packagespecFile); | 1147 Packages packages = _readPackagespec(packagespecFile); |
1149 return new PackagesFileDisposition(packages); | 1148 return new PackagesFileDisposition(packages); |
1150 } | 1149 } |
1151 if (packageResolverProvider != null) { | 1150 if (packageResolverProvider != null) { |
1152 UriResolver resolver = packageResolverProvider(folder); | 1151 UriResolver resolver = packageResolverProvider(folder); |
1153 if (resolver != null) { | 1152 if (resolver != null) { |
1154 return new CustomPackageResolverDisposition(resolver); | 1153 return new CustomPackageResolverDisposition(resolver); |
1155 } | 1154 } |
1156 } | 1155 } |
1157 | 1156 |
1158 ServerPerformanceStatistics.pub.makeCurrentWhile(() { | 1157 packageMapInfo = _packageMapProvider.computePackageMap(folder); |
1159 packageMapInfo = _packageMapProvider.computePackageMap(folder); | |
1160 }); | |
1161 } finally { | 1158 } finally { |
1162 callbacks.computingPackageMap(false); | 1159 callbacks.computingPackageMap(false); |
1163 } | 1160 } |
1164 for (String dependencyPath in packageMapInfo.dependencies) { | 1161 for (String dependencyPath in packageMapInfo.dependencies) { |
1165 addDependency(dependencyPath); | 1162 addDependency(dependencyPath); |
1166 } | 1163 } |
1167 if (packageMapInfo.packageMap == null) { | 1164 if (packageMapInfo.packageMap == null) { |
1168 return new NoPackageFolderDisposition(); | 1165 return new NoPackageFolderDisposition(); |
1169 } | 1166 } |
1170 return new PackageMapDisposition(packageMapInfo.packageMap); | 1167 return new PackageMapDisposition(packageMapInfo.packageMap); |
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1974 } | 1971 } |
1975 return _embedderLocator; | 1972 return _embedderLocator; |
1976 } | 1973 } |
1977 | 1974 |
1978 @override | 1975 @override |
1979 SdkExtensionFinder getSdkExtensionFinder(ResourceProvider resourceProvider) { | 1976 SdkExtensionFinder getSdkExtensionFinder(ResourceProvider resourceProvider) { |
1980 return _sdkExtensionFinder ??= | 1977 return _sdkExtensionFinder ??= |
1981 new SdkExtensionFinder(buildPackageMap(resourceProvider)); | 1978 new SdkExtensionFinder(buildPackageMap(resourceProvider)); |
1982 } | 1979 } |
1983 } | 1980 } |
OLD | NEW |