| 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 analysis.server; | 5 library analysis.server; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:core'; | 9 import 'dart:core'; |
| 10 import 'dart:io' as io; | 10 import 'dart:io' as io; |
| 11 import 'dart:math' show max; | 11 import 'dart:math' show max; |
| 12 | 12 |
| 13 import 'package:analysis_server/plugin/protocol/protocol.dart' | 13 import 'package:analysis_server/plugin/protocol/protocol.dart' |
| 14 hide AnalysisOptions, Element; | 14 hide AnalysisOptions, Element; |
| 15 import 'package:analysis_server/src/analysis_logger.dart'; | 15 import 'package:analysis_server/src/analysis_logger.dart'; |
| 16 import 'package:analysis_server/src/channel/channel.dart'; | 16 import 'package:analysis_server/src/channel/channel.dart'; |
| 17 import 'package:analysis_server/src/context_manager.dart'; | 17 import 'package:analysis_server/src/context_manager.dart'; |
| 18 import 'package:analysis_server/src/operation/operation.dart'; | 18 import 'package:analysis_server/src/operation/operation.dart'; |
| 19 import 'package:analysis_server/src/operation/operation_analysis.dart'; | 19 import 'package:analysis_server/src/operation/operation_analysis.dart'; |
| 20 import 'package:analysis_server/src/operation/operation_queue.dart'; | 20 import 'package:analysis_server/src/operation/operation_queue.dart'; |
| 21 import 'package:analysis_server/src/plugin/server_plugin.dart'; | 21 import 'package:analysis_server/src/plugin/server_plugin.dart'; |
| 22 import 'package:analysis_server/src/services/correction/namespace.dart'; | 22 import 'package:analysis_server/src/services/correction/namespace.dart'; |
| 23 import 'package:analysis_server/src/services/index/index.dart'; | 23 import 'package:analysis_server/src/services/index/index.dart'; |
| 24 import 'package:analysis_server/src/services/search/search_engine.dart'; | 24 import 'package:analysis_server/src/services/search/search_engine.dart'; |
| 25 import 'package:analysis_server/src/services/search/search_engine_internal.dart'
; | 25 import 'package:analysis_server/src/services/search/search_engine_internal.dart'
; |
| 26 import 'package:analysis_server/src/single_context_manager.dart'; | 26 import 'package:analysis_server/src/single_context_manager.dart'; |
| 27 import 'package:analyzer/dart/ast/ast.dart'; | 27 import 'package:analyzer/dart/ast/ast.dart'; |
| 28 import 'package:analyzer/dart/element/element.dart'; | 28 import 'package:analyzer/dart/element/element.dart'; |
| 29 import 'package:analyzer/exception/exception.dart'; |
| 29 import 'package:analyzer/file_system/file_system.dart'; | 30 import 'package:analyzer/file_system/file_system.dart'; |
| 30 import 'package:analyzer/instrumentation/instrumentation.dart'; | 31 import 'package:analyzer/instrumentation/instrumentation.dart'; |
| 31 import 'package:analyzer/plugin/resolver_provider.dart'; | 32 import 'package:analyzer/plugin/resolver_provider.dart'; |
| 32 import 'package:analyzer/source/pub_package_map_provider.dart'; | 33 import 'package:analyzer/source/pub_package_map_provider.dart'; |
| 33 import 'package:analyzer/src/context/builder.dart'; | 34 import 'package:analyzer/src/context/builder.dart'; |
| 34 import 'package:analyzer/src/dart/ast/utilities.dart'; | 35 import 'package:analyzer/src/dart/ast/utilities.dart'; |
| 35 import 'package:analyzer/src/generated/engine.dart'; | 36 import 'package:analyzer/src/generated/engine.dart'; |
| 36 import 'package:analyzer/exception/exception.dart'; | |
| 37 import 'package:analyzer/src/generated/sdk.dart'; | 37 import 'package:analyzer/src/generated/sdk.dart'; |
| 38 import 'package:analyzer/src/generated/source.dart'; | 38 import 'package:analyzer/src/generated/source.dart'; |
| 39 import 'package:analyzer/src/generated/source_io.dart'; | 39 import 'package:analyzer/src/generated/source_io.dart'; |
| 40 import 'package:analyzer/src/generated/utilities_general.dart'; | 40 import 'package:analyzer/src/generated/utilities_general.dart'; |
| 41 import 'package:analyzer/src/summary/package_bundle_reader.dart'; | 41 import 'package:analyzer/src/summary/package_bundle_reader.dart'; |
| 42 import 'package:analyzer/src/summary/pub_summary.dart'; | 42 import 'package:analyzer/src/summary/pub_summary.dart'; |
| 43 import 'package:analyzer/src/task/dart.dart'; | 43 import 'package:analyzer/src/task/dart.dart'; |
| 44 import 'package:analyzer/src/util/glob.dart'; | 44 import 'package:analyzer/src/util/glob.dart'; |
| 45 import 'package:analyzer/task/dart.dart'; | 45 import 'package:analyzer/task/dart.dart'; |
| 46 import 'package:plugin/plugin.dart'; | 46 import 'package:plugin/plugin.dart'; |
| (...skipping 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1591 final AnalysisServer analysisServer; | 1591 final AnalysisServer analysisServer; |
| 1592 | 1592 |
| 1593 /** | 1593 /** |
| 1594 * The [ResourceProvider] by which paths are converted into [Resource]s. | 1594 * The [ResourceProvider] by which paths are converted into [Resource]s. |
| 1595 */ | 1595 */ |
| 1596 final ResourceProvider resourceProvider; | 1596 final ResourceProvider resourceProvider; |
| 1597 | 1597 |
| 1598 ServerContextManagerCallbacks(this.analysisServer, this.resourceProvider); | 1598 ServerContextManagerCallbacks(this.analysisServer, this.resourceProvider); |
| 1599 | 1599 |
| 1600 @override | 1600 @override |
| 1601 AnalysisContext addContext( | 1601 AnalysisContext addContext(Folder folder, AnalysisOptions options) { |
| 1602 Folder folder, AnalysisOptions options, FolderDisposition disposition) { | |
| 1603 ContextBuilder builder = createContextBuilder(folder, options); | 1602 ContextBuilder builder = createContextBuilder(folder, options); |
| 1604 AnalysisContext context = builder.buildContext(folder.path); | 1603 AnalysisContext context = builder.buildContext(folder.path); |
| 1605 | 1604 |
| 1606 // TODO(brianwilkerson) Move bundle discovery into ContextBuilder | 1605 // TODO(brianwilkerson) Move bundle discovery into ContextBuilder |
| 1607 if (analysisServer.options.enablePubSummaryManager) { | 1606 if (analysisServer.options.enablePubSummaryManager) { |
| 1608 List<LinkedPubPackage> linkedBundles = | 1607 List<LinkedPubPackage> linkedBundles = |
| 1609 analysisServer.pubSummaryManager.getLinkedBundles(context); | 1608 analysisServer.pubSummaryManager.getLinkedBundles(context); |
| 1610 if (linkedBundles.isNotEmpty) { | 1609 if (linkedBundles.isNotEmpty) { |
| 1611 SummaryDataStore store = new SummaryDataStore([]); | 1610 SummaryDataStore store = new SummaryDataStore([]); |
| 1612 for (LinkedPubPackage package in linkedBundles) { | 1611 for (LinkedPubPackage package in linkedBundles) { |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1793 /** | 1792 /** |
| 1794 * The [PerformanceTag] for time spent in server request handlers. | 1793 * The [PerformanceTag] for time spent in server request handlers. |
| 1795 */ | 1794 */ |
| 1796 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); | 1795 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); |
| 1797 | 1796 |
| 1798 /** | 1797 /** |
| 1799 * The [PerformanceTag] for time spent in split store microtasks. | 1798 * The [PerformanceTag] for time spent in split store microtasks. |
| 1800 */ | 1799 */ |
| 1801 static PerformanceTag splitStore = new PerformanceTag('splitStore'); | 1800 static PerformanceTag splitStore = new PerformanceTag('splitStore'); |
| 1802 } | 1801 } |
| OLD | NEW |