| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import 'package:analysis_server/plugin/protocol/protocol.dart' as server; | 5 import 'package:analysis_server/plugin/protocol/protocol.dart' as server; |
| 6 import 'package:analyzer_plugin/protocol/protocol.dart' as plugin; | 6 import 'package:analyzer_plugin/protocol/protocol.dart' as plugin; |
| 7 import 'package:analyzer_plugin/protocol/protocol_constants.dart' as plugin; | 7 import 'package:analyzer_plugin/protocol/protocol_constants.dart' as plugin; |
| 8 import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin; | 8 import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin; |
| 9 | 9 |
| 10 class ProtocolTestUtilities { | 10 class ProtocolTestUtilities { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 /** | 104 /** |
| 105 * On return, increment [stringIndex] by 1 and [intIndex] by 4. | 105 * On return, increment [stringIndex] by 1 and [intIndex] by 4. |
| 106 */ | 106 */ |
| 107 plugin.Location pluginLocation(int stringIndex, int intIndex, | 107 plugin.Location pluginLocation(int stringIndex, int intIndex, |
| 108 {String file}) => | 108 {String file}) => |
| 109 new plugin.Location(file ?? fileName(stringIndex), intIndex++, intIndex++, | 109 new plugin.Location(file ?? fileName(stringIndex), intIndex++, intIndex++, |
| 110 intIndex++, intIndex++); | 110 intIndex++, intIndex++); |
| 111 | 111 |
| 112 /** | 112 /** |
| 113 * On return, increment [stringIndex] by 2 (or 3 if no [file] name is | 113 * On return, increment [stringIndex] by 2 (or 3 if no [file] name is |
| 114 * provided) and [intIndex] by 6. | 114 * provided) and [intIndex] by 4. |
| 115 */ | 115 */ |
| 116 plugin.AnalysisNavigationParams pluginNavigationParams( | 116 plugin.AnalysisNavigationParams pluginNavigationParams( |
| 117 int stringIndex, int intIndex, {String file}) => | 117 int stringIndex, int intIndex, {String file}) => |
| 118 new plugin.AnalysisNavigationParams( | 118 new plugin.AnalysisNavigationParams( |
| 119 file ?? fileName(stringIndex++), <plugin.NavigationRegion>[ | 119 file ?? fileName(stringIndex++), <plugin.NavigationRegion>[ |
| 120 new plugin.NavigationRegion(intIndex++, intIndex++, <int>[0]) | 120 new plugin.NavigationRegion(intIndex++, 2, <int>[0]) |
| 121 ], <plugin.NavigationTarget>[ | 121 ], <plugin.NavigationTarget>[ |
| 122 new plugin.NavigationTarget(plugin.ElementKind.FIELD, 0, intIndex++, | 122 new plugin.NavigationTarget( |
| 123 intIndex++, intIndex++, intIndex++) | 123 plugin.ElementKind.FIELD, 0, intIndex++, 2, intIndex++, intIndex++) |
| 124 ], <String>[ | 124 ], <String>[ |
| 125 strings[stringIndex++], | 125 strings[stringIndex++], |
| 126 strings[stringIndex++] | 126 strings[stringIndex++] |
| 127 ]); | 127 ]); |
| 128 | 128 |
| 129 /** | 129 /** |
| 130 * On return, increment [stringIndex] by 5 and [intIndex] by 7. | 130 * On return, increment [stringIndex] by 5 and [intIndex] by 7. |
| 131 */ | 131 */ |
| 132 plugin.Occurrences pluginOccurrences(int stringIndex, int intIndex) { | 132 plugin.Occurrences pluginOccurrences(int stringIndex, int intIndex) { |
| 133 plugin.Element element = pluginElement(stringIndex, intIndex); | 133 plugin.Element element = pluginElement(stringIndex, intIndex); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 /** | 223 /** |
| 224 * On return, increment [stringIndex] by 1 and [intIndex] by 4. | 224 * On return, increment [stringIndex] by 1 and [intIndex] by 4. |
| 225 */ | 225 */ |
| 226 server.Location serverLocation(int stringIndex, int intIndex, | 226 server.Location serverLocation(int stringIndex, int intIndex, |
| 227 {String file}) => | 227 {String file}) => |
| 228 new server.Location(file ?? fileName(stringIndex), intIndex++, intIndex++, | 228 new server.Location(file ?? fileName(stringIndex), intIndex++, intIndex++, |
| 229 intIndex++, intIndex++); | 229 intIndex++, intIndex++); |
| 230 | 230 |
| 231 /** | 231 /** |
| 232 * On return, increment [stringIndex] by 2 (or 3 if no [file] name is | 232 * On return, increment [stringIndex] by 2 (or 3 if no [file] name is |
| 233 * provided) and [intIndex] by 6. | 233 * provided) and [intIndex] by 4. |
| 234 */ | 234 */ |
| 235 server.AnalysisNavigationParams serverNavigationParams( | 235 server.AnalysisNavigationParams serverNavigationParams( |
| 236 int stringIndex, int intIndex, {String file}) => | 236 int stringIndex, int intIndex, {String file}) => |
| 237 new server.AnalysisNavigationParams( | 237 new server.AnalysisNavigationParams( |
| 238 file ?? fileName(stringIndex++), <server.NavigationRegion>[ | 238 file ?? fileName(stringIndex++), <server.NavigationRegion>[ |
| 239 new server.NavigationRegion(intIndex++, intIndex++, <int>[0]) | 239 new server.NavigationRegion(intIndex++, 2, <int>[0]) |
| 240 ], <server.NavigationTarget>[ | 240 ], <server.NavigationTarget>[ |
| 241 new server.NavigationTarget(server.ElementKind.FIELD, 0, intIndex++, | 241 new server.NavigationTarget( |
| 242 intIndex++, intIndex++, intIndex++) | 242 server.ElementKind.FIELD, 0, intIndex++, 2, intIndex++, intIndex++) |
| 243 ], <String>[ | 243 ], <String>[ |
| 244 strings[stringIndex++], | 244 strings[stringIndex++], |
| 245 strings[stringIndex++] | 245 strings[stringIndex++] |
| 246 ]); | 246 ]); |
| 247 | 247 |
| 248 /** | 248 /** |
| 249 * On return, increment [stringIndex] by 5 and [intIndex] by 7. | 249 * On return, increment [stringIndex] by 5 and [intIndex] by 7. |
| 250 */ | 250 */ |
| 251 server.Occurrences serverOccurrences(int stringIndex, int intIndex) { | 251 server.Occurrences serverOccurrences(int stringIndex, int intIndex) { |
| 252 server.Element element = serverElement(stringIndex, intIndex); | 252 server.Element element = serverElement(stringIndex, intIndex); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 new server.Position(fileName(stringIndex), intIndex++) | 295 new server.Position(fileName(stringIndex), intIndex++) |
| 296 ], | 296 ], |
| 297 intIndex++, | 297 intIndex++, |
| 298 <server.LinkedEditSuggestion>[ | 298 <server.LinkedEditSuggestion>[ |
| 299 new server.LinkedEditSuggestion(strings[stringIndex++], | 299 new server.LinkedEditSuggestion(strings[stringIndex++], |
| 300 server.LinkedEditSuggestionKind.METHOD) | 300 server.LinkedEditSuggestionKind.METHOD) |
| 301 ]) | 301 ]) |
| 302 ], | 302 ], |
| 303 selection: new server.Position(fileName(stringIndex), intIndex++)); | 303 selection: new server.Position(fileName(stringIndex), intIndex++)); |
| 304 } | 304 } |
| OLD | NEW |