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

Unified Diff: pkg/analyzer/lib/src/generated/engine.dart

Issue 1465983004: Revert "Clean-up the registration of plugins" (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/test/analysis_abstract.dart ('k') | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
*/
« no previous file with comments | « pkg/analysis_server/test/analysis_abstract.dart ('k') | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698