| 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'; | 10 import 'package:analysis_server/src/analysis_server.dart'; |
| (...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1037 | 1037 |
| 1038 void _checkForPackagespecUpdate( | 1038 void _checkForPackagespecUpdate( |
| 1039 String path, ContextInfo info, Folder folder) { | 1039 String path, ContextInfo info, Folder folder) { |
| 1040 // Check to see if this is the .packages file for this context and if so, | 1040 // Check to see if this is the .packages file for this context and if so, |
| 1041 // update the context's source factory. | 1041 // update the context's source factory. |
| 1042 if (absolutePathContext.basename(path) == PACKAGE_SPEC_NAME) { | 1042 if (absolutePathContext.basename(path) == PACKAGE_SPEC_NAME) { |
| 1043 String contextRoot = info.folder.path; | 1043 String contextRoot = info.folder.path; |
| 1044 ContextBuilder builder = | 1044 ContextBuilder builder = |
| 1045 callbacks.createContextBuilder(info.folder, defaultContextOptions); | 1045 callbacks.createContextBuilder(info.folder, defaultContextOptions); |
| 1046 AnalysisOptions options = builder.getAnalysisOptions(contextRoot, | 1046 AnalysisOptions options = builder.getAnalysisOptions(contextRoot, |
| 1047 contextRoot: info?.analysisDriver?.contextRoot); | 1047 contextRoot: info.analysisDriver?.contextRoot); |
| 1048 SourceFactory factory = builder.createSourceFactory(contextRoot, options); | 1048 SourceFactory factory = builder.createSourceFactory(contextRoot, options); |
| 1049 if (enableNewAnalysisDriver) { | 1049 if (enableNewAnalysisDriver) { |
| 1050 AnalysisDriver driver = info.analysisDriver; | 1050 AnalysisDriver driver = info.analysisDriver; |
| 1051 driver.configure(analysisOptions: options, sourceFactory: factory); | 1051 driver.configure(analysisOptions: options, sourceFactory: factory); |
| 1052 } else { | 1052 } else { |
| 1053 info.context.analysisOptions = options; | 1053 info.context.analysisOptions = options; |
| 1054 info.context.sourceFactory = factory; | 1054 info.context.sourceFactory = factory; |
| 1055 } | 1055 } |
| 1056 } | 1056 } |
| 1057 } | 1057 } |
| (...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1974 } | 1974 } |
| 1975 return _embedderLocator; | 1975 return _embedderLocator; |
| 1976 } | 1976 } |
| 1977 | 1977 |
| 1978 @override | 1978 @override |
| 1979 SdkExtensionFinder getSdkExtensionFinder(ResourceProvider resourceProvider) { | 1979 SdkExtensionFinder getSdkExtensionFinder(ResourceProvider resourceProvider) { |
| 1980 return _sdkExtensionFinder ??= | 1980 return _sdkExtensionFinder ??= |
| 1981 new SdkExtensionFinder(buildPackageMap(resourceProvider)); | 1981 new SdkExtensionFinder(buildPackageMap(resourceProvider)); |
| 1982 } | 1982 } |
| 1983 } | 1983 } |
| OLD | NEW |