| Index: pkg/analyzer/lib/src/generated/engine.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
|
| index ac626cc4cbba289bb06027e19913e4dacc754f57..597d3819955bd14e5fb190d9804c795455079bfc 100644
|
| --- a/pkg/analyzer/lib/src/generated/engine.dart
|
| +++ b/pkg/analyzer/lib/src/generated/engine.dart
|
| @@ -5925,6 +5925,11 @@ class AnalysisEngine {
|
| InstrumentationService.NULL_SERVICE;
|
|
|
| /**
|
| + * The list of supported plugins for processing by clients.
|
| + */
|
| + List<Plugin> _supportedPlugins;
|
| +
|
| + /**
|
| * The partition manager being used to manage the shared partitions.
|
| */
|
| final PartitionManager partitionManager = new PartitionManager();
|
| @@ -5948,6 +5953,11 @@ class AnalysisEngine {
|
| bool limitInvalidationInTaskModel = false;
|
|
|
| /**
|
| + * The plugins that are defined outside the `analyzer` package.
|
| + */
|
| + List<Plugin> _userDefinedPlugins = <Plugin>[];
|
| +
|
| + /**
|
| * The task manager used to manage the tasks used to analyze code.
|
| */
|
| TaskManager _taskManager;
|
| @@ -5989,18 +5999,24 @@ class AnalysisEngine {
|
| /**
|
| * Return the list of supported plugins for processing by clients.
|
| */
|
| - List<Plugin> get supportedPlugins =>
|
| - <Plugin>[enginePlugin, commandLinePlugin, optionsPlugin];
|
| + List<Plugin> get supportedPlugins {
|
| + if (_supportedPlugins == null) {
|
| + _supportedPlugins = <Plugin>[
|
| + enginePlugin,
|
| + commandLinePlugin,
|
| + optionsPlugin
|
| + ];
|
| + _supportedPlugins.addAll(_userDefinedPlugins);
|
| + }
|
| + return _supportedPlugins;
|
| + }
|
|
|
| /**
|
| * Return the task manager used to manage the tasks used to analyze code.
|
| */
|
| TaskManager get taskManager {
|
| if (_taskManager == null) {
|
| - if (enginePlugin.taskExtensionPoint == null) {
|
| - throw new IllegalStateException(
|
| - 'The analysis engine plugin has not been registered');
|
| - }
|
| + new ExtensionManager().processPlugins(supportedPlugins);
|
| _taskManager = new TaskManager();
|
| _taskManager.addTaskDescriptors(enginePlugin.taskDescriptors);
|
| // TODO(brianwilkerson) Create a way to associate different results with
|
| @@ -6011,6 +6027,18 @@ class AnalysisEngine {
|
| }
|
|
|
| /**
|
| + * Set plugins that are defined outside the `analyzer` package.
|
| + */
|
| + void set userDefinedPlugins(List<Plugin> plugins) {
|
| + if (plugins == null) {
|
| + plugins = <Plugin>[];
|
| + }
|
| + _userDefinedPlugins = plugins;
|
| + _supportedPlugins = null;
|
| + _taskManager = null;
|
| + }
|
| +
|
| + /**
|
| * Clear any caches holding on to analysis results so that a full re-analysis
|
| * will be performed the next time an analysis context is created.
|
| */
|
| @@ -9423,7 +9451,7 @@ abstract class InternalAnalysisContext implements AnalysisContext {
|
|
|
| /// Get the [EmbedderYamlLocator] for this context.
|
| EmbedderYamlLocator get embedderYamlLocator;
|
| -
|
| +
|
| /**
|
| * A factory to override how [ResolverVisitor] is created.
|
| */
|
|
|