| Index: pkg/analysis_server/lib/src/context_manager.dart
|
| diff --git a/pkg/analysis_server/lib/src/context_manager.dart b/pkg/analysis_server/lib/src/context_manager.dart
|
| index b3dbca7bbf210ee758e27abfceead5b652cc1e8b..866316e20e7b7ee02f7a71615ef0ef3c605daffd 100644
|
| --- a/pkg/analysis_server/lib/src/context_manager.dart
|
| +++ b/pkg/analysis_server/lib/src/context_manager.dart
|
| @@ -22,6 +22,7 @@ import 'package:analyzer/source/pub_package_map_provider.dart';
|
| import 'package:analyzer/source/sdk_ext.dart';
|
| import 'package:analyzer/src/context/context.dart' as context;
|
| import 'package:analyzer/src/generated/engine.dart';
|
| +import 'package:analyzer/src/generated/error.dart';
|
| import 'package:analyzer/src/generated/java_engine.dart';
|
| import 'package:analyzer/src/generated/java_io.dart';
|
| import 'package:analyzer/src/generated/source.dart';
|
| @@ -520,6 +521,10 @@ class ContextManagerImpl implements ContextManager {
|
| if (exclude != null) {
|
| setIgnorePatternsForContext(info, exclude);
|
| }
|
| +
|
| + // Set filters.
|
| + YamlList filters = analyzer['suppress'];
|
| + setFiltersForContext(info, filters ?? const []);
|
| }
|
|
|
| @override
|
| @@ -543,6 +548,15 @@ class ContextManagerImpl implements ContextManager {
|
| setRoots(includedPaths, excludedPaths, packageRoots);
|
| }
|
|
|
| + void setFiltersForContext(ContextInfo info, List<String> codes) {
|
| + // Case-insensitive.
|
| + codes = codes.map((code) => code.toUpperCase()).toList();
|
| + List<ErrorFilter> filters = codes
|
| + .map((code) => (AnalysisError error) => error.errorCode.name == code)
|
| + .toList();
|
| + info.context.setConfigurationData(CONFIGURED_ERROR_FILTERS, filters);
|
| + }
|
| +
|
| /**
|
| * Sets the [ignorePatterns] for the context having info [info].
|
| */
|
|
|