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

Unified Diff: pkg/analysis_server/test/integration/integration_test_methods.dart

Issue 1232393005: Add notification of analyzed files (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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
Index: pkg/analysis_server/test/integration/integration_test_methods.dart
diff --git a/pkg/analysis_server/test/integration/integration_test_methods.dart b/pkg/analysis_server/test/integration/integration_test_methods.dart
index 5794acb52c9ffa4e0798bb06ba3522e31afe4f9f..4da1b0c6807d25e6294eb2adfbd95ed24c447adf 100644
--- a/pkg/analysis_server/test/integration/integration_test_methods.dart
+++ b/pkg/analysis_server/test/integration/integration_test_methods.dart
@@ -240,6 +240,9 @@ abstract class IntegrationTestMixin {
* Return library dependency information for use in client-side indexing and
* package URI resolution.
*
+ * Clients that are only using the libraries field should consider using the
+ * analyzedFiles notification instead.
+ *
* Returns
*
* libraries ( List<FilePath> )
@@ -413,6 +416,30 @@ abstract class IntegrationTestMixin {
}
/**
+ * Subscribe for general services (that is, services that are not specific to
+ * individual files). All previous subscriptions are replaced by the given
+ * set of services.
+ *
+ * It is an error if any of the elements in the list are not valid services.
+ * If there is an error, then the current subscriptions will remain
+ * unchanged.
+ *
+ * Parameters
+ *
+ * subscriptions ( List<GeneralAnalysisService> )
+ *
+ * A list of the services being subscribed to.
+ */
+ Future sendAnalysisSetGeneralSubscriptions(List<GeneralAnalysisService> subscriptions) {
+ var params = new AnalysisSetGeneralSubscriptionsParams(subscriptions).toJson();
+ return server.send("analysis.setGeneralSubscriptions", params)
+ .then((result) {
+ expect(result, isNull);
+ return null;
+ });
+ }
+
+ /**
* Set the priority files to the files in the given list. A priority file is
* a file that is given priority when scheduling which analysis work to do
* first. The list typically contains those files that are visible to the
@@ -447,11 +474,11 @@ abstract class IntegrationTestMixin {
}
/**
- * Subscribe for services. All previous subscriptions are replaced by the
- * current set of subscriptions. If a given service is not included as a key
- * in the map then no files will be subscribed to the service, exactly as if
- * the service had been included in the map with an explicit empty list of
- * files.
+ * Subscribe for services that are specific to individual files. All previous
+ * subscriptions are replaced by the current set of subscriptions. If a given
+ * service is not included as a key in the map then no files will be
+ * subscribed to the service, exactly as if the service had been included in
+ * the map with an explicit empty list of files.
*
* Note that this request determines the set of requested subscriptions. The
* actual set of subscriptions at any given time is the intersection of this
@@ -536,6 +563,26 @@ abstract class IntegrationTestMixin {
}
/**
+ * Reports the paths of the files that are being analyzed.
+ *
+ * This notification is not subscribed to by default. Clients can subscribe
+ * by including the value "ANALYZED_FILES" in the list of services passed in
+ * an analysis.setGeneralSubscriptions request.
+ *
+ * Parameters
+ *
+ * directories ( List<FilePath> )
+ *
+ * A list of the paths of the files that are being analyzed.
+ */
+ Stream<AnalysisAnalyzedFilesParams> onAnalysisAnalyzedFiles;
+
+ /**
+ * Stream controller for [onAnalysisAnalyzedFiles].
+ */
+ StreamController<AnalysisAnalyzedFilesParams> _onAnalysisAnalyzedFiles;
+
+ /**
* Reports the errors associated with a given file. The set of errors
* included in the notification is always a complete list that supersedes any
* previously reported errors.
@@ -1512,6 +1559,8 @@ abstract class IntegrationTestMixin {
onServerError = _onServerError.stream.asBroadcastStream();
_onServerStatus = new StreamController<ServerStatusParams>(sync: true);
onServerStatus = _onServerStatus.stream.asBroadcastStream();
+ _onAnalysisAnalyzedFiles = new StreamController<AnalysisAnalyzedFilesParams>(sync: true);
+ onAnalysisAnalyzedFiles = _onAnalysisAnalyzedFiles.stream.asBroadcastStream();
_onAnalysisErrors = new StreamController<AnalysisErrorsParams>(sync: true);
onAnalysisErrors = _onAnalysisErrors.stream.asBroadcastStream();
_onAnalysisFlushResults = new StreamController<AnalysisFlushResultsParams>(sync: true);
@@ -1557,6 +1606,10 @@ abstract class IntegrationTestMixin {
expect(params, isServerStatusParams);
_onServerStatus.add(new ServerStatusParams.fromJson(decoder, 'params', params));
break;
+ case "analysis.analyzedFiles":
+ expect(params, isAnalysisAnalyzedFilesParams);
+ _onAnalysisAnalyzedFiles.add(new AnalysisAnalyzedFilesParams.fromJson(decoder, 'params', params));
+ break;
case "analysis.errors":
expect(params, isAnalysisErrorsParams);
_onAnalysisErrors.add(new AnalysisErrorsParams.fromJson(decoder, 'params', params));

Powered by Google App Engine
This is Rietveld 408576698