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' hide Resource; | 9 import 'dart:core' hide Resource; |
10 import 'dart:io' as io; | 10 import 'dart:io' as io; |
(...skipping 11 matching lines...) Expand all Loading... |
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/file_system/file_system.dart'; | 29 import 'package:analyzer/file_system/file_system.dart'; |
30 import 'package:analyzer/instrumentation/instrumentation.dart'; | 30 import 'package:analyzer/instrumentation/instrumentation.dart'; |
31 import 'package:analyzer/plugin/resolver_provider.dart'; | 31 import 'package:analyzer/plugin/resolver_provider.dart'; |
32 import 'package:analyzer/source/embedder.dart'; | |
33 import 'package:analyzer/source/pub_package_map_provider.dart'; | 32 import 'package:analyzer/source/pub_package_map_provider.dart'; |
| 33 import 'package:analyzer/src/context/builder.dart'; |
34 import 'package:analyzer/src/dart/ast/utilities.dart'; | 34 import 'package:analyzer/src/dart/ast/utilities.dart'; |
| 35 import 'package:analyzer/src/dart/sdk/sdk.dart'; |
35 import 'package:analyzer/src/generated/engine.dart'; | 36 import 'package:analyzer/src/generated/engine.dart'; |
36 import 'package:analyzer/src/generated/java_engine.dart'; | 37 import 'package:analyzer/src/generated/java_engine.dart'; |
37 import 'package:analyzer/src/generated/java_io.dart'; | 38 import 'package:analyzer/src/generated/java_io.dart'; |
38 import 'package:analyzer/src/generated/sdk.dart'; | 39 import 'package:analyzer/src/generated/sdk.dart'; |
39 import 'package:analyzer/src/generated/source.dart'; | 40 import 'package:analyzer/src/generated/source.dart'; |
40 import 'package:analyzer/src/generated/source_io.dart'; | 41 import 'package:analyzer/src/generated/source_io.dart'; |
41 import 'package:analyzer/src/generated/utilities_general.dart'; | 42 import 'package:analyzer/src/generated/utilities_general.dart'; |
42 import 'package:analyzer/src/task/dart.dart'; | 43 import 'package:analyzer/src/task/dart.dart'; |
43 import 'package:analyzer/src/util/glob.dart'; | 44 import 'package:analyzer/src/util/glob.dart'; |
44 import 'package:analyzer/task/dart.dart'; | 45 import 'package:analyzer/task/dart.dart'; |
(...skipping 1609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1654 SourceFactory _createSourceFactory(InternalAnalysisContext context, | 1655 SourceFactory _createSourceFactory(InternalAnalysisContext context, |
1655 AnalysisOptions options, FolderDisposition disposition, Folder folder) { | 1656 AnalysisOptions options, FolderDisposition disposition, Folder folder) { |
1656 List<UriResolver> resolvers = []; | 1657 List<UriResolver> resolvers = []; |
1657 List<UriResolver> packageUriResolvers = | 1658 List<UriResolver> packageUriResolvers = |
1658 disposition.createPackageUriResolvers(resourceProvider); | 1659 disposition.createPackageUriResolvers(resourceProvider); |
1659 | 1660 |
1660 // If no embedded URI resolver was provided, defer to a locator-backed one. | 1661 // If no embedded URI resolver was provided, defer to a locator-backed one. |
1661 EmbedderYamlLocator locator = | 1662 EmbedderYamlLocator locator = |
1662 disposition.getEmbedderLocator(resourceProvider); | 1663 disposition.getEmbedderLocator(resourceProvider); |
1663 Map<Folder, YamlMap> embedderYamls = locator.embedderYamls; | 1664 Map<Folder, YamlMap> embedderYamls = locator.embedderYamls; |
1664 EmbedderSdk embedderSdk = new EmbedderSdk(embedderYamls); | 1665 EmbedderSdk embedderSdk = new EmbedderSdk(resourceProvider, embedderYamls); |
1665 if (embedderSdk.libraryMap.size() == 0) { | 1666 if (embedderSdk.libraryMap.size() == 0) { |
1666 // There was no embedder file, or the file was empty, so used the default | 1667 // There was no embedder file, or the file was empty, so used the default |
1667 // SDK. | 1668 // SDK. |
1668 resolvers.add(new DartUriResolver( | 1669 resolvers.add(new DartUriResolver( |
1669 analysisServer.sdkManager.getSdkForOptions(options))); | 1670 analysisServer.sdkManager.getSdkForOptions(options))); |
1670 } else { | 1671 } else { |
1671 // The embedder file defines an alternate SDK, so use it. | 1672 // The embedder file defines an alternate SDK, so use it. |
1672 List<String> paths = <String>[]; | 1673 List<String> paths = <String>[]; |
1673 for (Folder folder in embedderYamls.keys) { | 1674 for (Folder folder in embedderYamls.keys) { |
1674 paths.add(folder | 1675 paths.add(folder |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1790 /** | 1791 /** |
1791 * The [PerformanceTag] for time spent in server request handlers. | 1792 * The [PerformanceTag] for time spent in server request handlers. |
1792 */ | 1793 */ |
1793 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); | 1794 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); |
1794 | 1795 |
1795 /** | 1796 /** |
1796 * The [PerformanceTag] for time spent in split store microtasks. | 1797 * The [PerformanceTag] for time spent in split store microtasks. |
1797 */ | 1798 */ |
1798 static PerformanceTag splitStore = new PerformanceTag('splitStore'); | 1799 static PerformanceTag splitStore = new PerformanceTag('splitStore'); |
1799 } | 1800 } |
OLD | NEW |