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

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

Issue 1311843004: AnalysisEngine.userDefinedPlugins setter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | 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 0e8f9c831b9d99678f39e38a5996be780e3cc176..5eccbf7ee5b33c7932856815551ae5e221f02f47 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -556,7 +556,8 @@ abstract class AnalysisContext {
* Perform work until the given [result] has been computed for the given
* [target]. Return the computed value.
*/
- Object /*V*/ computeResult(AnalysisTarget target, ResultDescriptor /*<V>*/ result);
+ Object /*V*/ computeResult(
+ AnalysisTarget target, ResultDescriptor /*<V>*/ result);
/**
* Notifies the context that the client is going to stop using this context.
@@ -729,7 +730,8 @@ abstract class AnalysisContext {
* If the corresponding [target] does not exist, or the [result] is not
* computed yet, then the default value is returned.
*/
- Object /*V*/ getResult(AnalysisTarget target, ResultDescriptor /*<V>*/ result);
+ Object /*V*/ getResult(
+ AnalysisTarget target, ResultDescriptor /*<V>*/ result);
/**
* Return a list of the sources being analyzed in this context whose full path
@@ -5903,6 +5905,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;
@@ -5951,6 +5958,7 @@ class AnalysisEngine {
commandLinePlugin,
optionsPlugin
];
+ _supportedPlugins.addAll(_userDefinedPlugins);
}
return _supportedPlugins;
}
@@ -5960,10 +5968,7 @@ class AnalysisEngine {
*/
TaskManager get taskManager {
if (_taskManager == null) {
- if (enginePlugin.taskExtensionPoint == null) {
- // The plugin wasn't used, so tasks are not registered.
- new ExtensionManager().processPlugins([enginePlugin]);
- }
+ new ExtensionManager().processPlugins(supportedPlugins);
_taskManager = new TaskManager();
_taskManager.addTaskDescriptors(enginePlugin.taskDescriptors);
// TODO(brianwilkerson) Create a way to associate different results with
@@ -5974,6 +5979,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.
*/
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698