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

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

Issue 769963003: Add paging support (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 251adc51fa5945e083876522d0d59681f8ef2ac8..b0786b6029257b7ec1f4bc2a40b54533d3470799 100644
--- a/pkg/analysis_server/test/integration/integration_test_methods.dart
+++ b/pkg/analysis_server/test/integration/integration_test_methods.dart
@@ -224,6 +224,59 @@ abstract class IntegrationTestMixin {
}
/**
+ * Return the navigation information associated with the given region of the
+ * given file.
+ *
+ * If a navigation region is partially contained in (but extends either
+ * before or after) the given region of the file it will be included in the
+ * result. This means that it is theoretically possible to get the same
+ * navigation region in response to multiple requests. Clients can avoid this
+ * by always choosing a region that starts at the beginning of a line and
+ * ends at the end of a line in the file.
+ *
+ * Parameters
+ *
+ * file ( FilePath )
+ *
+ * The file in which navigation information is being requested.
+ *
+ * start ( int )
+ *
+ * The offset of the start of the region for which hover information is
+ * being requested.
+ *
+ * end ( int )
+ *
+ * The offset of the end of the region for which hover information is being
+ * requested.
+ *
+ * Returns
+ *
+ * files ( List<FilePath> )
+ *
+ * A list of the paths of files that are referenced by the navigation
+ * targets.
+ *
+ * targets ( List<NavigationTarget> )
+ *
+ * A list of the navigation targets that are referenced by the navigation
+ * regions.
+ *
+ * regions ( List<NavigationRegion> )
+ *
+ * A list of the navigation regions within the requested region of the
+ * file.
+ */
+ Future<AnalysisGetNavigationResult> sendAnalysisGetNavigation(String file, int start, int end) {
+ var params = new AnalysisGetNavigationParams(file, start, end).toJson();
+ return server.send("analysis.getNavigation", params)
+ .then((result) {
+ ResponseDecoder decoder = new ResponseDecoder(null);
+ return new AnalysisGetNavigationResult.fromJson(decoder, 'result', result);
+ });
+ }
+
+ /**
* Force the re-analysis of everything contained in the existing analysis
* roots. This will cause all previously computed analysis results to be
* discarded and recomputed, and will cause all subscribed notifications to
@@ -522,6 +575,41 @@ abstract class IntegrationTestMixin {
StreamController<AnalysisHighlightsParams> _onAnalysisHighlights;
/**
+ * Reports that the navigation information associated with a region of a
+ * single file has become invalid and should be re-requested.
+ *
+ * This notification is not subscribed to by default. Clients can subscribe
+ * by including the value "INVALIDATE" in the list of services passed in an
+ * analysis.setSubscriptions request.
+ *
+ * Parameters
+ *
+ * file ( FilePath )
+ *
+ * The file whose information has been invalidated.
+ *
+ * start ( int )
+ *
+ * The offset of the start of the invalidated region.
+ *
+ * end ( int )
+ *
+ * The offset of the end of the invalidated region.
+ *
+ * delta ( int )
+ *
+ * The delta to be applied to the offsets in information that follows the
+ * invalidated region in order to update it so that it doesn't need to be
+ * re-requested.
+ */
+ Stream<AnalysisInvalidateParams> onAnalysisInvalidate;
+
+ /**
+ * Stream controller for [onAnalysisInvalidate].
+ */
+ StreamController<AnalysisInvalidateParams> _onAnalysisInvalidate;
+
+ /**
* Reports the navigation targets associated with a given file.
*
* This notification is not subscribed to by default. Clients can subscribe
@@ -1289,6 +1377,8 @@ abstract class IntegrationTestMixin {
onAnalysisFolding = _onAnalysisFolding.stream.asBroadcastStream();
_onAnalysisHighlights = new StreamController<AnalysisHighlightsParams>(sync: true);
onAnalysisHighlights = _onAnalysisHighlights.stream.asBroadcastStream();
+ _onAnalysisInvalidate = new StreamController<AnalysisInvalidateParams>(sync: true);
+ onAnalysisInvalidate = _onAnalysisInvalidate.stream.asBroadcastStream();
_onAnalysisNavigation = new StreamController<AnalysisNavigationParams>(sync: true);
onAnalysisNavigation = _onAnalysisNavigation.stream.asBroadcastStream();
_onAnalysisOccurrences = new StreamController<AnalysisOccurrencesParams>(sync: true);
@@ -1340,6 +1430,10 @@ abstract class IntegrationTestMixin {
expect(params, isAnalysisHighlightsParams);
_onAnalysisHighlights.add(new AnalysisHighlightsParams.fromJson(decoder, 'params', params));
break;
+ case "analysis.invalidate":
+ expect(params, isAnalysisInvalidateParams);
+ _onAnalysisInvalidate.add(new AnalysisInvalidateParams.fromJson(decoder, 'params', params));
+ break;
case "analysis.navigation":
expect(params, isAnalysisNavigationParams);
_onAnalysisNavigation.add(new AnalysisNavigationParams.fromJson(decoder, 'params', params));

Powered by Google App Engine
This is Rietveld 408576698