Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(366)

Side by Side Diff: pkg/analysis_server/lib/src/context_manager.dart

Issue 1398803002: Fix DAS, use all the Analyzer plugins. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/server/driver.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 context.directory.manager; 5 library context.directory.manager;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:convert'; 9 import 'dart:convert';
10 import 'dart:core' hide Resource; 10 import 'dart:core' hide Resource;
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 /** 465 /**
466 * Process [options] for the context having info [info]. 466 * Process [options] for the context having info [info].
467 */ 467 */
468 void processOptionsForContext( 468 void processOptionsForContext(
469 ContextInfo info, Map<String, YamlNode> options) { 469 ContextInfo info, Map<String, YamlNode> options) {
470 if (options == null) { 470 if (options == null) {
471 return; 471 return;
472 } 472 }
473 473
474 // Notify options processors. 474 // Notify options processors.
475 AnalysisEngine.instance.optionsPlugin.optionsProcessors 475 AnalysisEngine.instance.optionsPlugin.optionsProcessors.forEach(
476 .forEach( 476 (OptionsProcessor p) => p.optionsProcessed(info.context, options));
477 (OptionsProcessor p) => p.optionsProcessed(options, info.context));
478 477
479 // Analysis options are processed 'in-line'. 478 // Analysis options are processed 'in-line'.
480 // TODO(pq): consider pushing exclude handling into a plugin. 479 // TODO(pq): consider pushing exclude handling into a plugin.
481 YamlMap analyzer = options['analyzer']; 480 YamlMap analyzer = options['analyzer'];
482 if (analyzer == null) { 481 if (analyzer == null) {
483 // No options for analyzer. 482 // No options for analyzer.
484 return; 483 return;
485 } 484 }
486 485
487 // Set ignore patterns. 486 // Set ignore patterns.
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 */ 817 */
819 ContextInfo _createContext( 818 ContextInfo _createContext(
820 ContextInfo parent, Folder folder, File packagespecFile) { 819 ContextInfo parent, Folder folder, File packagespecFile) {
821 ContextInfo info = new ContextInfo(this, parent, folder, packagespecFile, 820 ContextInfo info = new ContextInfo(this, parent, folder, packagespecFile,
822 normalizedPackageRoots[folder.path]); 821 normalizedPackageRoots[folder.path]);
823 822
824 try { 823 try {
825 Map<String, YamlNode> options = 824 Map<String, YamlNode> options =
826 analysisOptionsProvider.getOptions(folder); 825 analysisOptionsProvider.getOptions(folder);
827 processOptionsForContext(info, options); 826 processOptionsForContext(info, options);
828 } on Exception catch (e) { 827 } catch (e) {
829 // TODO(pquitslund): contribute plugin that sends error notification on op tions file. 828 // TODO(pquitslund): contribute plugin that sends error notification on op tions file.
830 // Related test: context_manager_test.test_analysis_options_parse_failure( ) 829 // Related test: context_manager_test.test_analysis_options_parse_failure( )
831 // AnalysisEngine.instance.optionsPlugin.optionsProcessors 830 // AnalysisEngine.instance.optionsPlugin.optionsProcessors
832 // .forEach((OptionsProcessor p) => p.onError(e)); 831 // .forEach((OptionsProcessor p) => p.onError(e));
833 } 832 }
834 833
835 FolderDisposition disposition; 834 FolderDisposition disposition;
836 List<String> dependencies = <String>[]; 835 List<String> dependencies = <String>[];
837 836
838 // Next resort to a package uri resolver. 837 // Next resort to a package uri resolver.
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
1426 var path = resourceProvider.pathContext.fromUri(uri); 1425 var path = resourceProvider.pathContext.fromUri(uri);
1427 packageMap[name] = <Folder>[resourceProvider.getFolder(path)]; 1426 packageMap[name] = <Folder>[resourceProvider.getFolder(path)];
1428 } 1427 }
1429 }); 1428 });
1430 return <UriResolver>[new SdkExtUriResolver(packageMap)]; 1429 return <UriResolver>[new SdkExtUriResolver(packageMap)];
1431 } else { 1430 } else {
1432 return const <UriResolver>[]; 1431 return const <UriResolver>[];
1433 } 1432 }
1434 } 1433 }
1435 } 1434 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/server/driver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698