| Index: pkg/analysis_server/lib/src/domain_execution.dart
|
| diff --git a/pkg/analysis_server/lib/src/domain_execution.dart b/pkg/analysis_server/lib/src/domain_execution.dart
|
| index e1654df93b73e984e721780cf2b48f95c5ab2b72..16a6f664654f7d76a36123076293b98030bb832e 100644
|
| --- a/pkg/analysis_server/lib/src/domain_execution.dart
|
| +++ b/pkg/analysis_server/lib/src/domain_execution.dart
|
| @@ -13,6 +13,7 @@ import 'package:analysis_server/src/protocol.dart';
|
| import 'package:analyzer/file_system/file_system.dart';
|
| import 'package:analyzer/src/generated/engine.dart';
|
| import 'package:analyzer/src/generated/source.dart';
|
| +import 'package:analyzer/src/generated/utilities_general.dart';
|
|
|
| /**
|
| * Instances of the class [ExecutionDomainHandler] implement a [RequestHandler]
|
| @@ -158,30 +159,36 @@ class ExecutionDomainHandler implements RequestHandler {
|
| }
|
|
|
| void _fileAnalyzed(ChangeNotice notice) {
|
| - Source source = notice.source;
|
| - String filePath = source.fullName;
|
| - if (!_isInAnalysisRoot(filePath)) {
|
| - return;
|
| - }
|
| - AnalysisContext context = server.getAnalysisContext(filePath);
|
| - if (AnalysisEngine.isDartFileName(filePath)) {
|
| - ExecutableKind kind = ExecutableKind.NOT_EXECUTABLE;
|
| - if (context.isClientLibrary(source)) {
|
| - kind = ExecutableKind.CLIENT;
|
| - if (context.isServerLibrary(source)) {
|
| - kind = ExecutableKind.EITHER;
|
| + PerformanceTag prevTag =
|
| + ServerPerformanceStatistics.executionDomain.makeCurrent();
|
| + try {
|
| + Source source = notice.source;
|
| + String filePath = source.fullName;
|
| + if (!_isInAnalysisRoot(filePath)) {
|
| + return;
|
| + }
|
| + AnalysisContext context = server.getAnalysisContext(filePath);
|
| + if (AnalysisEngine.isDartFileName(filePath)) {
|
| + ExecutableKind kind = ExecutableKind.NOT_EXECUTABLE;
|
| + if (context.isClientLibrary(source)) {
|
| + kind = ExecutableKind.CLIENT;
|
| + if (context.isServerLibrary(source)) {
|
| + kind = ExecutableKind.EITHER;
|
| + }
|
| + } else if (context.isServerLibrary(source)) {
|
| + kind = ExecutableKind.SERVER;
|
| }
|
| - } else if (context.isServerLibrary(source)) {
|
| - kind = ExecutableKind.SERVER;
|
| + server.sendNotification(
|
| + new ExecutionLaunchDataParams(filePath, kind: kind).toNotification());
|
| + } else if (AnalysisEngine.isHtmlFileName(filePath)) {
|
| + List<Source> libraries = context.getLibrariesReferencedFromHtml(source);
|
| + server.sendNotification(
|
| + new ExecutionLaunchDataParams(
|
| + filePath,
|
| + referencedFiles: _getFullNames(libraries)).toNotification());
|
| }
|
| - server.sendNotification(
|
| - new ExecutionLaunchDataParams(filePath, kind: kind).toNotification());
|
| - } else if (AnalysisEngine.isHtmlFileName(filePath)) {
|
| - List<Source> libraries = context.getLibrariesReferencedFromHtml(source);
|
| - server.sendNotification(
|
| - new ExecutionLaunchDataParams(
|
| - filePath,
|
| - referencedFiles: _getFullNames(libraries)).toNotification());
|
| + } finally {
|
| + prevTag.makeCurrent();
|
| }
|
| }
|
|
|
|
|