| 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 e0ad10d1805d6da2de34304a7e903f05edcfc1a4..26b1136053cec44a328263fa99361455e2fc5322 100644
|
| --- a/pkg/analysis_server/lib/src/context_manager.dart
|
| +++ b/pkg/analysis_server/lib/src/context_manager.dart
|
| @@ -7,6 +7,7 @@ library context.directory.manager;
|
| import 'dart:async';
|
| import 'dart:collection';
|
|
|
| +import 'package:analysis_server/src/analysis_server.dart';
|
| import 'package:analyzer/file_system/file_system.dart';
|
| import 'package:analyzer/source/package_map_provider.dart';
|
| import 'package:analyzer/source/package_map_resolver.dart';
|
| @@ -326,8 +327,10 @@ abstract class ContextManager {
|
| return new PackageUriResolver([new JavaFile(info.packageRoot)]);
|
| } else {
|
| beginComputePackageMap();
|
| - PackageMapInfo packageMapInfo =
|
| - _packageMapProvider.computePackageMap(folder);
|
| + PackageMapInfo packageMapInfo;
|
| + ServerPerformanceStatistics.pub.makeCurrentWhile(() {
|
| + packageMapInfo = _packageMapProvider.computePackageMap(folder);
|
| + });
|
| endComputePackageMap();
|
| info.packageMapDependencies = packageMapInfo.dependencies;
|
| if (packageMapInfo.packageMap == null) {
|
| @@ -361,20 +364,6 @@ abstract class ContextManager {
|
| }
|
|
|
| /**
|
| - * Create a new context associated with the given [folder]. The [pubspecFile]
|
| - * is the `pubspec.yaml` file contained in the folder. Add any sources that
|
| - * are not included in one of the [children] to the context.
|
| - */
|
| - _ContextInfo _createContextWithSources(Folder folder, File pubspecFile,
|
| - List<_ContextInfo> children) {
|
| - _ContextInfo info = _createContext(folder, pubspecFile, children);
|
| - ChangeSet changeSet = new ChangeSet();
|
| - _addSourceFiles(changeSet, folder, info);
|
| - applyChangesToContext(folder, changeSet);
|
| - return info;
|
| - }
|
| -
|
| - /**
|
| * Creates a new context associated with [folder].
|
| *
|
| * If there are subfolders with 'pubspec.yaml' files, separate contexts
|
| @@ -414,6 +403,20 @@ abstract class ContextManager {
|
| }
|
|
|
| /**
|
| + * Create a new context associated with the given [folder]. The [pubspecFile]
|
| + * is the `pubspec.yaml` file contained in the folder. Add any sources that
|
| + * are not included in one of the [children] to the context.
|
| + */
|
| + _ContextInfo _createContextWithSources(Folder folder, File pubspecFile,
|
| + List<_ContextInfo> children) {
|
| + _ContextInfo info = _createContext(folder, pubspecFile, children);
|
| + ChangeSet changeSet = new ChangeSet();
|
| + _addSourceFiles(changeSet, folder, info);
|
| + applyChangesToContext(folder, changeSet);
|
| + return info;
|
| + }
|
| +
|
| + /**
|
| * Clean up and destroy the context associated with the given folder.
|
| */
|
| void _destroyContext(Folder folder) {
|
|
|