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

Unified Diff: pkg/analyzer/lib/src/context/builder.dart

Issue 2742343006: Formalizing the hacks letting the angular analyzer plugin run for now. (Closed)
Patch Set: Rename variable not method Created 3 years, 9 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 | « pkg/analysis_server/lib/starter.dart ('k') | pkg/analyzer/lib/src/dart/analysis/driver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « pkg/analysis_server/lib/starter.dart ('k') | pkg/analyzer/lib/src/dart/analysis/driver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698