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

Unified Diff: pkg/analysis_server/lib/src/operation/operation_analysis.dart

Issue 1410983003: Index Dart CompilationUnit(s) with the correct context. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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/src/analysis_server.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/operation/operation_analysis.dart
diff --git a/pkg/analysis_server/lib/src/operation/operation_analysis.dart b/pkg/analysis_server/lib/src/operation/operation_analysis.dart
index 973b831d2393dc55b5543a93510e63b1b2ef6181..1e430d500850906c5e4bc6b21a21e0c68c97cfed 100644
--- a/pkg/analysis_server/lib/src/operation/operation_analysis.dart
+++ b/pkg/analysis_server/lib/src/operation/operation_analysis.dart
@@ -64,9 +64,10 @@ scheduleImplementedNotification(
/**
* Schedules indexing of the given [file] using the resolved [dartUnit].
*/
-void scheduleIndexOperation(AnalysisServer server, String file,
- AnalysisContext context, CompilationUnit dartUnit) {
+void scheduleIndexOperation(
+ AnalysisServer server, String file, CompilationUnit dartUnit) {
if (server.index != null) {
+ AnalysisContext context = dartUnit.element.context;
server.addOperation(new _DartIndexOperation(context, file, dartUnit));
}
}
@@ -414,7 +415,7 @@ class PerformAnalysisOperation extends ServerOperation {
try {
CompilationUnit dartUnit = notice.resolvedDartUnit;
if (dartUnit != null) {
- server.addOperation(new _DartIndexOperation(context, file, dartUnit));
+ scheduleIndexOperation(server, file, dartUnit);
}
} catch (exception, stackTrace) {
server.sendServerErrorNotification(exception, stackTrace);
@@ -459,6 +460,7 @@ class _DartIndexOperation extends _SingleFileOperation {
ServerPerformanceStatistics.indexOperation.makeCurrentWhile(() {
try {
Index index = server.index;
+ AnalysisContext context = unit.element.context;
index.index(context, unit);
} catch (exception, stackTrace) {
server.sendServerErrorNotification(exception, stackTrace);
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698