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

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

Issue 1411053003: Error code validation for error filters. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Name tweaks. Created 5 years, 1 month 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/services/linter/linter.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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 } 494 }
495 }); 495 });
496 496
497 // In case options files are removed, revert to default options. 497 // In case options files are removed, revert to default options.
498 if (optionsRemoved) { 498 if (optionsRemoved) {
499 info.context.analysisOptions = new AnalysisOptionsImpl(); 499 info.context.analysisOptions = new AnalysisOptionsImpl();
500 return; 500 return;
501 } 501 }
502 502
503 // Analysis options are processed 'in-line'. 503 // Analysis options are processed 'in-line'.
504 YamlMap analyzer = options['analyzer']; 504 YamlMap analyzer = options[AnalyzerOptions.analyzer];
505 if (analyzer == null) { 505 if (analyzer == null) {
506 // No options for analyzer. 506 // No options for analyzer.
507 return; 507 return;
508 } 508 }
509 509
510 // Set strong mode (default is false). 510 // Set strong mode (default is false).
511 bool strongMode = analyzer['strong-mode'] ?? false; 511 bool strongMode = analyzer[AnalyzerOptions.strong_mode] ?? false;
512 AnalysisContext context = info.context; 512 AnalysisContext context = info.context;
513 if (context.analysisOptions.strongMode != strongMode) { 513 if (context.analysisOptions.strongMode != strongMode) {
514 AnalysisOptionsImpl options = 514 AnalysisOptionsImpl options =
515 new AnalysisOptionsImpl.from(context.analysisOptions); 515 new AnalysisOptionsImpl.from(context.analysisOptions);
516 options.strongMode = strongMode; 516 options.strongMode = strongMode;
517 context.analysisOptions = options; 517 context.analysisOptions = options;
518 } 518 }
519 519
520 // Set ignore patterns. 520 // Set ignore patterns.
521 YamlList exclude = analyzer['exclude']; 521 YamlList exclude = analyzer[AnalyzerOptions.exclude];
522 if (exclude != null) { 522 if (exclude != null) {
523 setIgnorePatternsForContext(info, exclude); 523 setIgnorePatternsForContext(info, exclude);
524 } 524 }
525 525
526 // Set filters. 526 // Set filters.
527 YamlNode filters = analyzer['errors']; 527 YamlNode filters = analyzer[AnalyzerOptions.errors];
528 setFiltersForContext(info, filters); 528 setFiltersForContext(info, filters);
529 } 529 }
530 530
531 @override 531 @override
532 void refresh(List<Resource> roots) { 532 void refresh(List<Resource> roots) {
533 // Destroy old contexts 533 // Destroy old contexts
534 List<ContextInfo> contextInfos = _rootInfo.descendants.toList(); 534 List<ContextInfo> contextInfos = _rootInfo.descendants.toList();
535 if (roots == null) { 535 if (roots == null) {
536 contextInfos.forEach(_destroyContext); 536 contextInfos.forEach(_destroyContext);
537 } else { 537 } else {
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after
1471 var path = resourceProvider.pathContext.fromUri(uri); 1471 var path = resourceProvider.pathContext.fromUri(uri);
1472 packageMap[name] = <Folder>[resourceProvider.getFolder(path)]; 1472 packageMap[name] = <Folder>[resourceProvider.getFolder(path)];
1473 } 1473 }
1474 }); 1474 });
1475 return <UriResolver>[new SdkExtUriResolver(packageMap)]; 1475 return <UriResolver>[new SdkExtUriResolver(packageMap)];
1476 } else { 1476 } else {
1477 return const <UriResolver>[]; 1477 return const <UriResolver>[];
1478 } 1478 }
1479 } 1479 }
1480 } 1480 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/linter/linter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698