| Index: pkg/analyzer/lib/src/context/builder.dart
|
| diff --git a/pkg/analyzer/lib/src/context/builder.dart b/pkg/analyzer/lib/src/context/builder.dart
|
| index 0bd531e4e9e197ddc57593fad45b9cafe9a96c34..a3e899b0922aee6f0b29e9ef58f9b3ef9c11e1c1 100644
|
| --- a/pkg/analyzer/lib/src/context/builder.dart
|
| +++ b/pkg/analyzer/lib/src/context/builder.dart
|
| @@ -60,6 +60,14 @@ import 'package:yaml/yaml.dart';
|
| */
|
| class ContextBuilder {
|
| /**
|
| + * A callback for when analysis drivers are created, which takes all the same
|
| + * arguments as the dart analysis driver constructor so that plugins may
|
| + * create their own drivers with the same tools, in theory. Here as a stopgap
|
| + * until the official plugin API is complete
|
| + */
|
| + static Function onCreateAnalysisDriver = null;
|
| +
|
| + /**
|
| * The [ResourceProvider] by which paths are converted into [Resource]s.
|
| */
|
| final ResourceProvider resourceProvider;
|
| @@ -149,6 +157,7 @@ class ContextBuilder {
|
| AnalysisDriver buildDriver(String path) {
|
| AnalysisOptions options = getAnalysisOptions(path);
|
| //_processAnalysisOptions(context, optionMap);
|
| + final sf = createSourceFactory(path, options);
|
| AnalysisDriver driver = new AnalysisDriver(
|
| analysisDriverScheduler,
|
| performanceLog,
|
| @@ -156,8 +165,13 @@ class ContextBuilder {
|
| byteStore,
|
| fileContentOverlay,
|
| path,
|
| - createSourceFactory(path, options),
|
| + sf,
|
| options);
|
| + // temporary plugin support:
|
| + if (onCreateAnalysisDriver != null) {
|
| + onCreateAnalysisDriver(driver, analysisDriverScheduler, performanceLog,
|
| + resourceProvider, byteStore, fileContentOverlay, path, sf, options);
|
| + }
|
| declareVariablesInDriver(driver);
|
| return driver;
|
| }
|
|
|