| 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/plugin/notification_manager.dart'; | 10 import 'package:analysis_server/src/plugin/notification_manager.dart'; |
| (...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 912 } | 912 } |
| 913 | 913 |
| 914 void _checkForPackagespecUpdate( | 914 void _checkForPackagespecUpdate( |
| 915 String path, ContextInfo info, Folder folder) { | 915 String path, ContextInfo info, Folder folder) { |
| 916 // Check to see if this is the .packages file for this context and if so, | 916 // Check to see if this is the .packages file for this context and if so, |
| 917 // update the context's source factory. | 917 // update the context's source factory. |
| 918 if (absolutePathContext.basename(path) == PACKAGE_SPEC_NAME) { | 918 if (absolutePathContext.basename(path) == PACKAGE_SPEC_NAME) { |
| 919 String contextRoot = info.folder.path; | 919 String contextRoot = info.folder.path; |
| 920 ContextBuilder builder = | 920 ContextBuilder builder = |
| 921 callbacks.createContextBuilder(info.folder, defaultContextOptions); | 921 callbacks.createContextBuilder(info.folder, defaultContextOptions); |
| 922 AnalysisOptions options = builder.getAnalysisOptions(contextRoot, | |
| 923 contextRoot: info.analysisDriver?.contextRoot); | |
| 924 SourceFactory factory = builder.createSourceFactory(contextRoot, options); | |
| 925 AnalysisDriver driver = info.analysisDriver; | 922 AnalysisDriver driver = info.analysisDriver; |
| 926 driver.configure(analysisOptions: options, sourceFactory: factory); | 923 if (driver != null) { |
| 924 AnalysisOptions options = builder.getAnalysisOptions(contextRoot, |
| 925 contextRoot: driver.contextRoot); |
| 926 SourceFactory factory = |
| 927 builder.createSourceFactory(contextRoot, options); |
| 928 driver.configure(analysisOptions: options, sourceFactory: factory); |
| 929 } |
| 927 } | 930 } |
| 928 } | 931 } |
| 929 | 932 |
| 930 /** | 933 /** |
| 931 * Compute the set of files that are being flushed, this is defined as | 934 * Compute the set of files that are being flushed, this is defined as |
| 932 * the set of sources in the removed context (context.sources), that are | 935 * the set of sources in the removed context (context.sources), that are |
| 933 * orphaned by this context being removed (no other context includes this | 936 * orphaned by this context being removed (no other context includes this |
| 934 * file.) | 937 * file.) |
| 935 */ | 938 */ |
| 936 List<String> _computeFlushedFiles(ContextInfo info) { | 939 List<String> _computeFlushedFiles(ContextInfo info) { |
| (...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1789 } | 1792 } |
| 1790 return _embedderLocator; | 1793 return _embedderLocator; |
| 1791 } | 1794 } |
| 1792 | 1795 |
| 1793 @override | 1796 @override |
| 1794 SdkExtensionFinder getSdkExtensionFinder(ResourceProvider resourceProvider) { | 1797 SdkExtensionFinder getSdkExtensionFinder(ResourceProvider resourceProvider) { |
| 1795 return _sdkExtensionFinder ??= | 1798 return _sdkExtensionFinder ??= |
| 1796 new SdkExtensionFinder(buildPackageMap(resourceProvider)); | 1799 new SdkExtensionFinder(buildPackageMap(resourceProvider)); |
| 1797 } | 1800 } |
| 1798 } | 1801 } |
| OLD | NEW |