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

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

Issue 482573004: Change analysis server protocol to omit empty lists when optional. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 0e13d4b4fa926b2d76d4a39dc04fb25c44032202..9c1392865259d6ee9062600210db6abe3c7698f6 100644
--- a/pkg/analysis_server/test/integration/integration_test_methods.dart
+++ b/pkg/analysis_server/test/integration/integration_test_methods.dart
@@ -71,13 +71,15 @@ abstract class IntegrationTestMixin {
*
* Parameters
*
- * subscriptions ( List<ServerService> )
+ * subscriptions ( optional List<ServerService> )
*
* A list of the services being subscribed to.
*/
- Future sendServerSetSubscriptions(List<String> subscriptions, {bool checkTypes: true}) {
+ Future sendServerSetSubscriptions({List<String> subscriptions, bool checkTypes: true}) {
Map<String, dynamic> params = {};
- params["subscriptions"] = subscriptions;
+ if (subscriptions != null) {
+ params["subscriptions"] = subscriptions;
+ }
if (checkTypes) {
expect(params, isServerSetSubscriptionsParams);
}
@@ -180,7 +182,7 @@ abstract class IntegrationTestMixin {
*
* Returns
*
- * errors ( List<AnalysisError> )
+ * errors ( optional List<AnalysisError> )
*
* The errors associated with the file.
*/
@@ -216,10 +218,10 @@ abstract class IntegrationTestMixin {
*
* Returns
*
- * hovers ( List<HoverInformation> )
+ * hovers ( optional List<HoverInformation> )
*
* The hover information associated with the location. The list will be
- * empty if no information could be determined for the location. The list
+ * omitted if no information could be determined for the location. The list
* can contain multiple items if the file is being analyzed in multiple
* contexts in conflicting ways (such as a part that is included in
* multiple libraries).
@@ -280,19 +282,23 @@ abstract class IntegrationTestMixin {
*
* Parameters
*
- * included ( List<FilePath> )
+ * included ( optional List<FilePath> )
*
* A list of the files and directories that should be analyzed.
*
- * excluded ( List<FilePath> )
+ * excluded ( optional List<FilePath> )
*
* A list of the files and directories within the included directories that
* should not be analyzed.
*/
- Future sendAnalysisSetAnalysisRoots(List<String> included, List<String> excluded, {bool checkTypes: true}) {
+ Future sendAnalysisSetAnalysisRoots({List<String> included, List<String> excluded, bool checkTypes: true}) {
Map<String, dynamic> params = {};
- params["included"] = included;
- params["excluded"] = excluded;
+ if (included != null) {
+ params["included"] = included;
+ }
+ if (excluded != null) {
+ params["excluded"] = excluded;
+ }
if (checkTypes) {
expect(params, isAnalysisSetAnalysisRootsParams);
}
@@ -326,13 +332,15 @@ abstract class IntegrationTestMixin {
*
* Parameters
*
- * files ( List<FilePath> )
+ * files ( optional List<FilePath> )
*
* The files that are to be a priority for analysis.
*/
- Future sendAnalysisSetPriorityFiles(List<String> files, {bool checkTypes: true}) {
+ Future sendAnalysisSetPriorityFiles({List<String> files, bool checkTypes: true}) {
Map<String, dynamic> params = {};
- params["files"] = files;
+ if (files != null) {
+ params["files"] = files;
+ }
if (checkTypes) {
expect(params, isAnalysisSetPriorityFilesParams);
}
@@ -464,7 +472,7 @@ abstract class IntegrationTestMixin {
*
* The file containing the errors.
*
- * errors ( List<AnalysisError> )
+ * errors ( optional List<AnalysisError> )
*
* The errors contained in the file.
*/
@@ -490,7 +498,7 @@ abstract class IntegrationTestMixin {
*
* Parameters
*
- * files ( List<FilePath> )
+ * files ( optional List<FilePath> )
*
* The files that are no longer being analyzed.
*/
@@ -517,7 +525,7 @@ abstract class IntegrationTestMixin {
*
* The file containing the folding regions.
*
- * regions ( List<FoldingRegion> )
+ * regions ( optional List<FoldingRegion> )
*
* The folding regions contained in the file.
*/
@@ -541,7 +549,7 @@ abstract class IntegrationTestMixin {
*
* The file containing the highlight regions.
*
- * regions ( List<HighlightRegion> )
+ * regions ( optional List<HighlightRegion> )
*
* The highlight regions contained in the file. Each highlight region
* represents a particular syntactic or semantic meaning associated with
@@ -569,7 +577,7 @@ abstract class IntegrationTestMixin {
*
* The file containing the navigation regions.
*
- * regions ( List<NavigationRegion> )
+ * regions ( optional List<NavigationRegion> )
*
* The navigation regions contained in the file. Each navigation region
* represents a list of targets associated with some range. The lists will
@@ -599,7 +607,7 @@ abstract class IntegrationTestMixin {
*
* The file in which the references occur.
*
- * occurrences ( List<Occurrences> )
+ * occurrences ( optional List<Occurrences> )
*
* The occurrences of references to elements within the file.
*/
@@ -647,7 +655,7 @@ abstract class IntegrationTestMixin {
*
* The file with which the overrides are associated.
*
- * overrides ( List<Override> )
+ * overrides ( optional List<Override> )
*
* The overrides associated with the file.
*/
@@ -719,7 +727,7 @@ abstract class IntegrationTestMixin {
* containing the cursor is to be replaced when the suggestion is applied
* (that is, the number of characters in the existing identifier).
*
- * results ( List<CompletionSuggestion> )
+ * results ( optional List<CompletionSuggestion> )
*
* The completion suggestions being reported. The notification contains all
* possible completions at the requested cursor position, even those that
@@ -956,7 +964,7 @@ abstract class IntegrationTestMixin {
*
* The id associated with the search.
*
- * results ( List<SearchResult> )
+ * results ( optional List<SearchResult> )
*
* The search results being reported.
*
@@ -994,7 +1002,7 @@ abstract class IntegrationTestMixin {
*
* Returns
*
- * assists ( List<SourceChange> )
+ * assists ( optional List<SourceChange> )
*
* The assists that are available at the given location.
*/
@@ -1035,7 +1043,7 @@ abstract class IntegrationTestMixin {
*
* Returns
*
- * kinds ( List<RefactoringKind> )
+ * kinds ( optional List<RefactoringKind> )
*
* The kinds of refactorings that are valid for the given selection.
*/
@@ -1072,7 +1080,7 @@ abstract class IntegrationTestMixin {
*
* Returns
*
- * fixes ( List<ErrorFixes> )
+ * fixes ( optional List<ErrorFixes> )
*
* The fixes that are available for each of the analysis errors. There is a
* one-to-one correspondence between the analysis errors in the request and
@@ -1133,7 +1141,7 @@ abstract class IntegrationTestMixin {
*
* Returns
*
- * status ( List<RefactoringProblem> )
+ * status ( optional List<RefactoringProblem> )
*
* The status of the refactoring. The array will be empty if there are no
* known problems.
@@ -1307,13 +1315,15 @@ abstract class IntegrationTestMixin {
*
* Parameters
*
- * subscriptions ( List<DebugService> )
+ * subscriptions ( optional List<DebugService> )
*
* A list of the services being subscribed to.
*/
- Future sendDebugSetSubscriptions(List<String> subscriptions, {bool checkTypes: true}) {
+ Future sendDebugSetSubscriptions({List<String> subscriptions, bool checkTypes: true}) {
Map<String, dynamic> params = {};
- params["subscriptions"] = subscriptions;
+ if (subscriptions != null) {
+ params["subscriptions"] = subscriptions;
+ }
if (checkTypes) {
expect(params, isDebugSetSubscriptionsParams);
}
@@ -1336,7 +1346,7 @@ abstract class IntegrationTestMixin {
*
* Parameters
*
- * executables ( List<ExecutableFile> )
+ * executables ( optional List<ExecutableFile> )
*
* A list of the files that are executable in the given context. This list
* replaces any previous list provided for the given context.

Powered by Google App Engine
This is Rietveld 408576698