| 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 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1007 } | 1007 } |
| 1008 | 1008 |
| 1009 void _checkForAnalysisOptionsUpdate( | 1009 void _checkForAnalysisOptionsUpdate( |
| 1010 String path, ContextInfo info, ChangeType changeType) { | 1010 String path, ContextInfo info, ChangeType changeType) { |
| 1011 if (AnalysisEngine.isAnalysisOptionsFileName(path, pathContext)) { | 1011 if (AnalysisEngine.isAnalysisOptionsFileName(path, pathContext)) { |
| 1012 if (enableNewAnalysisDriver) { | 1012 if (enableNewAnalysisDriver) { |
| 1013 AnalysisDriver driver = info.analysisDriver; | 1013 AnalysisDriver driver = info.analysisDriver; |
| 1014 String contextRoot = info.folder.path; | 1014 String contextRoot = info.folder.path; |
| 1015 ContextBuilder builder = | 1015 ContextBuilder builder = |
| 1016 callbacks.createContextBuilder(info.folder, defaultContextOptions); | 1016 callbacks.createContextBuilder(info.folder, defaultContextOptions); |
| 1017 AnalysisOptions options = builder.getAnalysisOptions(contextRoot); | 1017 AnalysisOptions options = builder.getAnalysisOptions(contextRoot, |
| 1018 contextRoot: driver.contextRoot); |
| 1018 SourceFactory factory = | 1019 SourceFactory factory = |
| 1019 builder.createSourceFactory(contextRoot, options); | 1020 builder.createSourceFactory(contextRoot, options); |
| 1020 driver.configure(analysisOptions: options, sourceFactory: factory); | 1021 driver.configure(analysisOptions: options, sourceFactory: factory); |
| 1021 // TODO(brianwilkerson) Set exclusion patterns. | 1022 // TODO(brianwilkerson) Set exclusion patterns. |
| 1022 } else { | 1023 } else { |
| 1023 var analysisContext = info.context; | 1024 var analysisContext = info.context; |
| 1024 if (analysisContext is context.AnalysisContextImpl) { | 1025 if (analysisContext is context.AnalysisContextImpl) { |
| 1025 Map<String, Object> options = | 1026 Map<String, Object> options = |
| 1026 readOptions(info.folder, info.disposition.packages); | 1027 readOptions(info.folder, info.disposition.packages); |
| 1027 processOptionsForContext(info, options, | 1028 processOptionsForContext(info, options, |
| 1028 optionsRemoved: changeType == ChangeType.REMOVE); | 1029 optionsRemoved: changeType == ChangeType.REMOVE); |
| 1029 analysisContext.sourceFactory = _createSourceFactory( | 1030 analysisContext.sourceFactory = _createSourceFactory( |
| 1030 analysisContext, analysisContext.analysisOptions, info.folder); | 1031 analysisContext, analysisContext.analysisOptions, info.folder); |
| 1031 callbacks.applyChangesToContext(info.folder, new ChangeSet()); | 1032 callbacks.applyChangesToContext(info.folder, new ChangeSet()); |
| 1032 } | 1033 } |
| 1033 } | 1034 } |
| 1034 } | 1035 } |
| 1035 } | 1036 } |
| 1036 | 1037 |
| 1037 void _checkForPackagespecUpdate( | 1038 void _checkForPackagespecUpdate( |
| 1038 String path, ContextInfo info, Folder folder) { | 1039 String path, ContextInfo info, Folder folder) { |
| 1039 // 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, |
| 1040 // update the context's source factory. | 1041 // update the context's source factory. |
| 1041 if (absolutePathContext.basename(path) == PACKAGE_SPEC_NAME) { | 1042 if (absolutePathContext.basename(path) == PACKAGE_SPEC_NAME) { |
| 1042 String contextRoot = info.folder.path; | 1043 String contextRoot = info.folder.path; |
| 1043 ContextBuilder builder = | 1044 ContextBuilder builder = |
| 1044 callbacks.createContextBuilder(info.folder, defaultContextOptions); | 1045 callbacks.createContextBuilder(info.folder, defaultContextOptions); |
| 1045 AnalysisOptions options = builder.getAnalysisOptions(contextRoot); | 1046 AnalysisOptions options = builder.getAnalysisOptions(contextRoot, |
| 1047 contextRoot: info.analysisDriver.contextRoot); |
| 1046 SourceFactory factory = builder.createSourceFactory(contextRoot, options); | 1048 SourceFactory factory = builder.createSourceFactory(contextRoot, options); |
| 1047 if (enableNewAnalysisDriver) { | 1049 if (enableNewAnalysisDriver) { |
| 1048 AnalysisDriver driver = info.analysisDriver; | 1050 AnalysisDriver driver = info.analysisDriver; |
| 1049 driver.configure(analysisOptions: options, sourceFactory: factory); | 1051 driver.configure(analysisOptions: options, sourceFactory: factory); |
| 1050 } else { | 1052 } else { |
| 1051 info.context.analysisOptions = options; | 1053 info.context.analysisOptions = options; |
| 1052 info.context.sourceFactory = factory; | 1054 info.context.sourceFactory = factory; |
| 1053 } | 1055 } |
| 1054 } | 1056 } |
| 1055 } | 1057 } |
| (...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1972 } | 1974 } |
| 1973 return _embedderLocator; | 1975 return _embedderLocator; |
| 1974 } | 1976 } |
| 1975 | 1977 |
| 1976 @override | 1978 @override |
| 1977 SdkExtensionFinder getSdkExtensionFinder(ResourceProvider resourceProvider) { | 1979 SdkExtensionFinder getSdkExtensionFinder(ResourceProvider resourceProvider) { |
| 1978 return _sdkExtensionFinder ??= | 1980 return _sdkExtensionFinder ??= |
| 1979 new SdkExtensionFinder(buildPackageMap(resourceProvider)); | 1981 new SdkExtensionFinder(buildPackageMap(resourceProvider)); |
| 1980 } | 1982 } |
| 1981 } | 1983 } |
| OLD | NEW |