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

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

Issue 1403983002: AS strong-mode .analysis_options awareness. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: check-fix 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/test/context_manager_test.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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 (OptionsProcessor p) => p.optionsProcessed(info.context, options)); 477 (OptionsProcessor p) => p.optionsProcessed(info.context, options));
478 478
479 // Analysis options are processed 'in-line'. 479 // Analysis options are processed 'in-line'.
480 // TODO(pq): consider pushing exclude handling into a plugin. 480 // TODO(pq): consider pushing exclude handling into a plugin.
481 YamlMap analyzer = options['analyzer']; 481 YamlMap analyzer = options['analyzer'];
482 if (analyzer == null) { 482 if (analyzer == null) {
483 // No options for analyzer. 483 // No options for analyzer.
484 return; 484 return;
485 } 485 }
486 486
487 // Set strong mode.
488 var strongMode = analyzer['strong-mode'];
489 if (strongMode == true) {
490 AnalysisContext context = info.context;
491 AnalysisOptionsImpl options =
492 new AnalysisOptionsImpl.from(context.analysisOptions);
493 options.strongMode = true;
494 context.analysisOptions = options;
495 }
496
487 // Set ignore patterns. 497 // Set ignore patterns.
488 YamlList exclude = analyzer['exclude']; 498 YamlList exclude = analyzer['exclude'];
489 if (exclude != null) { 499 if (exclude != null) {
490 setIgnorePatternsForContext(info, exclude); 500 setIgnorePatternsForContext(info, exclude);
491 } 501 }
492 } 502 }
493 503
494 @override 504 @override
495 void refresh(List<Resource> roots) { 505 void refresh(List<Resource> roots) {
496 // Destroy old contexts 506 // Destroy old contexts
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
1432 var path = resourceProvider.pathContext.fromUri(uri); 1442 var path = resourceProvider.pathContext.fromUri(uri);
1433 packageMap[name] = <Folder>[resourceProvider.getFolder(path)]; 1443 packageMap[name] = <Folder>[resourceProvider.getFolder(path)];
1434 } 1444 }
1435 }); 1445 });
1436 return <UriResolver>[new SdkExtUriResolver(packageMap)]; 1446 return <UriResolver>[new SdkExtUriResolver(packageMap)];
1437 } else { 1447 } else {
1438 return const <UriResolver>[]; 1448 return const <UriResolver>[];
1439 } 1449 }
1440 } 1450 }
1441 } 1451 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/context_manager_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698