| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library test.services.completion.util; | 5 library test.services.completion.util; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/protocol.dart' as protocol show Element, | 9 import 'package:analysis_server/src/protocol.dart' as protocol show Element, |
| 10 ElementKind; | 10 ElementKind; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 (CompletionSuggestion cs) => cs.completion == completion, | 91 (CompletionSuggestion cs) => cs.completion == completion, |
| 92 orElse: () => null); | 92 orElse: () => null); |
| 93 if (suggestion != null) { | 93 if (suggestion != null) { |
| 94 failedCompletion('did not expect completion: $completion\n $suggestion'); | 94 failedCompletion('did not expect completion: $completion\n $suggestion'); |
| 95 } | 95 } |
| 96 return null; | 96 return null; |
| 97 } | 97 } |
| 98 | 98 |
| 99 CompletionSuggestion assertSuggest(String completion, | 99 CompletionSuggestion assertSuggest(String completion, |
| 100 {CompletionSuggestionKind csKind: CompletionSuggestionKind.INVOCATION, | 100 {CompletionSuggestionKind csKind: CompletionSuggestionKind.INVOCATION, |
| 101 int relevance: COMPLETION_RELEVANCE_DEFAULT, | 101 int relevance: COMPLETION_RELEVANCE_DEFAULT, protocol.ElementKind elemKind
: |
| 102 protocol.ElementKind elemKind: null, bool isDeprecated: false, bool isPote
ntial: | 102 null, bool isDeprecated: false, bool isPotential: false}) { |
| 103 false}) { | |
| 104 CompletionSuggestion cs = | 103 CompletionSuggestion cs = |
| 105 getSuggest(completion: completion, csKind: csKind, elemKind: elemKind); | 104 getSuggest(completion: completion, csKind: csKind, elemKind: elemKind); |
| 106 if (cs == null) { | 105 if (cs == null) { |
| 107 failedCompletion('expected $completion $csKind', request.suggestions); | 106 failedCompletion( |
| 107 'expected $completion $csKind $elemKind', |
| 108 request.suggestions); |
| 108 } | 109 } |
| 109 expect(cs.kind, equals(csKind)); | 110 expect(cs.kind, equals(csKind)); |
| 110 if (isDeprecated) { | 111 if (isDeprecated) { |
| 111 expect(cs.relevance, equals(COMPLETION_RELEVANCE_LOW)); | 112 expect(cs.relevance, equals(COMPLETION_RELEVANCE_LOW)); |
| 112 } else { | 113 } else { |
| 113 expect(cs.relevance, equals(relevance)); | 114 expect(cs.relevance, equals(relevance)); |
| 114 } | 115 } |
| 115 expect(cs.selectionOffset, equals(completion.length)); | 116 expect(cs.selectionOffset, equals(completion.length)); |
| 116 expect(cs.selectionLength, equals(0)); | 117 expect(cs.selectionLength, equals(0)); |
| 117 expect(cs.isDeprecated, equals(isDeprecated)); | 118 expect(cs.isDeprecated, equals(isDeprecated)); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 } | 156 } |
| 156 StringBuffer msg = new StringBuffer(); | 157 StringBuffer msg = new StringBuffer(); |
| 157 msg.writeln('Argument list not the same'); | 158 msg.writeln('Argument list not the same'); |
| 158 msg.writeln(' Expected names: $expectedNames'); | 159 msg.writeln(' Expected names: $expectedNames'); |
| 159 msg.writeln(' found: $actualNames'); | 160 msg.writeln(' found: $actualNames'); |
| 160 msg.writeln(' Expected types: $expectedTypes'); | 161 msg.writeln(' Expected types: $expectedTypes'); |
| 161 msg.writeln(' found: $actualTypes'); | 162 msg.writeln(' found: $actualTypes'); |
| 162 fail(msg.toString()); | 163 fail(msg.toString()); |
| 163 } | 164 } |
| 164 | 165 |
| 165 CompletionSuggestion assertSuggestClass(String name, | 166 CompletionSuggestion assertSuggestClass(String name, [int relevance = |
| 166 [int relevance = COMPLETION_RELEVANCE_DEFAULT, | 167 COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kind = |
| 167 CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) { | 168 CompletionSuggestionKind.INVOCATION]) { |
| 168 CompletionSuggestion cs = | 169 CompletionSuggestion cs = |
| 169 assertSuggest(name, csKind: kind, relevance: relevance); | 170 assertSuggest(name, csKind: kind, relevance: relevance); |
| 170 protocol.Element element = cs.element; | 171 protocol.Element element = cs.element; |
| 171 expect(element, isNotNull); | 172 expect(element, isNotNull); |
| 172 expect(element.kind, equals(protocol.ElementKind.CLASS)); | 173 expect(element.kind, equals(protocol.ElementKind.CLASS)); |
| 173 expect(element.name, equals(name)); | 174 expect(element.name, equals(name)); |
| 174 expect(element.parameters, isNull); | 175 expect(element.parameters, isNull); |
| 175 expect(element.returnType, isNull); | 176 expect(element.returnType, isNull); |
| 176 return cs; | 177 return cs; |
| 177 } | 178 } |
| 178 | 179 |
| 179 CompletionSuggestion assertSuggestClassTypeAlias(String name, | 180 CompletionSuggestion assertSuggestClassTypeAlias(String name, [int relevance = |
| 180 [int relevance = COMPLETION_RELEVANCE_DEFAULT, | 181 COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kind = |
| 181 CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) { | 182 CompletionSuggestionKind.INVOCATION]) { |
| 182 CompletionSuggestion cs = | 183 CompletionSuggestion cs = |
| 183 assertSuggest(name, csKind: kind, relevance: relevance); | 184 assertSuggest(name, csKind: kind, relevance: relevance); |
| 184 protocol.Element element = cs.element; | 185 protocol.Element element = cs.element; |
| 185 expect(element, isNotNull); | 186 expect(element, isNotNull); |
| 186 expect(element.kind, equals(protocol.ElementKind.CLASS_TYPE_ALIAS)); | 187 expect(element.kind, equals(protocol.ElementKind.CLASS_TYPE_ALIAS)); |
| 187 expect(element.name, equals(name)); | 188 expect(element.name, equals(name)); |
| 188 expect(element.parameters, isNull); | 189 expect(element.parameters, isNull); |
| 189 expect(element.returnType, isNull); | 190 expect(element.returnType, isNull); |
| 190 return cs; | 191 return cs; |
| 191 } | 192 } |
| 192 | 193 |
| 193 CompletionSuggestion assertSuggestField(String name, | 194 CompletionSuggestion assertSuggestField(String name, String type, |
| 194 {int relevance: COMPLETION_RELEVANCE_DEFAULT, | 195 {int relevance: COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kin
d: |
| 195 CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION, | 196 CompletionSuggestionKind.INVOCATION, bool isDeprecated: false}) { |
| 196 bool isDeprecated: false}) { | |
| 197 CompletionSuggestion cs = assertSuggest( | 197 CompletionSuggestion cs = assertSuggest( |
| 198 name, | 198 name, |
| 199 csKind: kind, | 199 csKind: kind, |
| 200 relevance: relevance, | 200 relevance: relevance, |
| 201 elemKind: protocol.ElementKind.FIELD, | 201 elemKind: protocol.ElementKind.FIELD, |
| 202 isDeprecated: isDeprecated); | 202 isDeprecated: isDeprecated); |
| 203 expect(cs.returnType, isNull); | 203 // The returnType represents the type of a field |
| 204 expect(cs.returnType, type != null ? type : 'dynamic'); |
| 204 protocol.Element element = cs.element; | 205 protocol.Element element = cs.element; |
| 205 expect(element, isNotNull); | 206 expect(element, isNotNull); |
| 206 expect(element.kind, equals(protocol.ElementKind.FIELD)); | 207 expect(element.kind, equals(protocol.ElementKind.FIELD)); |
| 207 expect(element.name, equals(name)); | 208 expect(element.name, equals(name)); |
| 208 expect(element.parameters, isNull); | 209 expect(element.parameters, isNull); |
| 209 // TODO (danrubel) return type should be null and there should be | 210 // The returnType represents the type of a field |
| 210 // something that represents the type of the field | 211 expect(element.returnType, type != null ? type : 'dynamic'); |
| 211 if (element.returnType != null) { | |
| 212 expect(element.returnType, 'dynamic'); | |
| 213 } | |
| 214 return cs; | 212 return cs; |
| 215 } | 213 } |
| 216 | 214 |
| 217 CompletionSuggestion assertSuggestFunction(String name, String returnType, | 215 CompletionSuggestion assertSuggestFunction(String name, String returnType, |
| 218 bool isDeprecated, [int relevance = COMPLETION_RELEVANCE_DEFAULT, | 216 bool isDeprecated, [int relevance = COMPLETION_RELEVANCE_DEFAULT, |
| 219 CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) { | 217 CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) { |
| 220 CompletionSuggestion cs = assertSuggest( | 218 CompletionSuggestion cs = assertSuggest( |
| 221 name, | 219 name, |
| 222 csKind: kind, | 220 csKind: kind, |
| 223 relevance: relevance, | 221 relevance: relevance, |
| 224 isDeprecated: isDeprecated); | 222 isDeprecated: isDeprecated); |
| 225 expect(cs.returnType, equals(returnType)); | 223 expect(cs.returnType, returnType != null ? returnType : 'dynamic'); |
| 226 protocol.Element element = cs.element; | 224 protocol.Element element = cs.element; |
| 227 expect(element, isNotNull); | 225 expect(element, isNotNull); |
| 228 expect(element.kind, equals(protocol.ElementKind.FUNCTION)); | 226 expect(element.kind, equals(protocol.ElementKind.FUNCTION)); |
| 229 expect(element.name, equals(name)); | 227 expect(element.name, equals(name)); |
| 230 expect(element.isDeprecated, equals(isDeprecated)); | 228 expect(element.isDeprecated, equals(isDeprecated)); |
| 231 String param = element.parameters; | 229 String param = element.parameters; |
| 232 expect(param, isNotNull); | 230 expect(param, isNotNull); |
| 233 expect(param[0], equals('(')); | 231 expect(param[0], equals('(')); |
| 234 expect(param[param.length - 1], equals(')')); | 232 expect(param[param.length - 1], equals(')')); |
| 235 expect( | 233 expect( |
| 236 element.returnType, | 234 element.returnType, |
| 237 equals(returnType != null ? returnType : 'dynamic')); | 235 equals(returnType != null ? returnType : 'dynamic')); |
| 238 return cs; | 236 return cs; |
| 239 } | 237 } |
| 240 | 238 |
| 241 CompletionSuggestion assertSuggestFunctionTypeAlias(String name, | 239 CompletionSuggestion assertSuggestFunctionTypeAlias(String name, |
| 242 String returnType, bool isDeprecated, [int relevance = | 240 String returnType, bool isDeprecated, [int relevance = |
| 243 COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kind = | 241 COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kind = |
| 244 CompletionSuggestionKind.INVOCATION]) { | 242 CompletionSuggestionKind.INVOCATION]) { |
| 245 CompletionSuggestion cs = assertSuggest( | 243 CompletionSuggestion cs = assertSuggest( |
| 246 name, | 244 name, |
| 247 csKind: kind, | 245 csKind: kind, |
| 248 relevance: relevance, | 246 relevance: relevance, |
| 249 isDeprecated: isDeprecated); | 247 isDeprecated: isDeprecated); |
| 250 expect(cs.returnType, equals(returnType)); | 248 expect(cs.returnType, returnType != null ? returnType : 'dynamic'); |
| 251 protocol.Element element = cs.element; | 249 protocol.Element element = cs.element; |
| 252 expect(element, isNotNull); | 250 expect(element, isNotNull); |
| 253 expect(element.kind, equals(protocol.ElementKind.FUNCTION_TYPE_ALIAS)); | 251 expect(element.kind, equals(protocol.ElementKind.FUNCTION_TYPE_ALIAS)); |
| 254 expect(element.name, equals(name)); | 252 expect(element.name, equals(name)); |
| 255 expect(element.isDeprecated, equals(isDeprecated)); | 253 expect(element.isDeprecated, equals(isDeprecated)); |
| 256 // TODO (danrubel) Determine why params are null | 254 // TODO (danrubel) Determine why params are null |
| 257 // String param = element.parameters; | 255 // String param = element.parameters; |
| 258 // expect(param, isNotNull); | 256 // expect(param, isNotNull); |
| 259 // expect(param[0], equals('(')); | 257 // expect(param[0], equals('(')); |
| 260 // expect(param[param.length - 1], equals(')')); | 258 // expect(param[param.length - 1], equals(')')); |
| 261 // TODO (danrubel) Determine why return type is null | 259 // TODO (danrubel) Determine why return type is null |
| 262 // expect( | 260 // expect( |
| 263 // element.returnType, | 261 // element.returnType, |
| 264 // equals(returnType != null ? returnType : 'dynamic')); | 262 // equals(returnType != null ? returnType : 'dynamic')); |
| 265 return cs; | 263 return cs; |
| 266 } | 264 } |
| 267 | 265 |
| 268 CompletionSuggestion assertSuggestGetter(String name, String returnType, | 266 CompletionSuggestion assertSuggestGetter(String name, String returnType, |
| 269 {int relevance: COMPLETION_RELEVANCE_DEFAULT, | 267 {int relevance: COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kin
d: |
| 270 CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION, | 268 CompletionSuggestionKind.INVOCATION, bool isDeprecated: false}) { |
| 271 bool isDeprecated: false}) { | |
| 272 CompletionSuggestion cs = assertSuggest( | 269 CompletionSuggestion cs = assertSuggest( |
| 273 name, | 270 name, |
| 274 csKind: kind, | 271 csKind: kind, |
| 275 relevance: relevance, | 272 relevance: relevance, |
| 276 elemKind: protocol.ElementKind.GETTER, | 273 elemKind: protocol.ElementKind.GETTER, |
| 277 isDeprecated: isDeprecated); | 274 isDeprecated: isDeprecated); |
| 278 expect(cs.returnType, equals(returnType)); | 275 expect(cs.returnType, returnType != null ? returnType : 'dynamic'); |
| 279 protocol.Element element = cs.element; | 276 protocol.Element element = cs.element; |
| 280 expect(element, isNotNull); | 277 expect(element, isNotNull); |
| 281 expect(element.kind, equals(protocol.ElementKind.GETTER)); | 278 expect(element.kind, equals(protocol.ElementKind.GETTER)); |
| 282 expect(element.name, equals(name)); | 279 expect(element.name, equals(name)); |
| 283 //TODO (danrubel) getter should have parameters | 280 //TODO (danrubel) getter should have parameters |
| 284 // but not used in code completion | 281 // but not used in code completion |
| 285 //expect(element.parameters, '()'); | 282 //expect(element.parameters, '()'); |
| 286 expect( | 283 expect( |
| 287 element.returnType, | 284 element.returnType, |
| 288 equals(returnType != null ? returnType : 'dynamic')); | 285 equals(returnType != null ? returnType : 'dynamic')); |
| 289 return cs; | 286 return cs; |
| 290 } | 287 } |
| 291 | 288 |
| 292 CompletionSuggestion assertSuggestLibraryPrefix(String prefix, | 289 CompletionSuggestion assertSuggestLibraryPrefix(String prefix, [int relevance |
| 293 [int relevance = COMPLETION_RELEVANCE_DEFAULT, | 290 = COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kind = |
| 294 CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) { | 291 CompletionSuggestionKind.INVOCATION]) { |
| 295 // Library prefix should only be suggested by ImportedComputer | 292 // Library prefix should only be suggested by ImportedComputer |
| 296 if (computer is ImportedComputer) { | 293 if (computer is ImportedComputer) { |
| 297 CompletionSuggestion cs = | 294 CompletionSuggestion cs = |
| 298 assertSuggest(prefix, csKind: kind, relevance: relevance); | 295 assertSuggest(prefix, csKind: kind, relevance: relevance); |
| 299 protocol.Element element = cs.element; | 296 protocol.Element element = cs.element; |
| 300 expect(element, isNotNull); | 297 expect(element, isNotNull); |
| 301 expect(element.kind, equals(protocol.ElementKind.LIBRARY)); | 298 expect(element.kind, equals(protocol.ElementKind.LIBRARY)); |
| 302 expect(element.parameters, isNull); | 299 expect(element.parameters, isNull); |
| 303 expect(element.returnType, isNull); | 300 expect(element.returnType, isNull); |
| 304 return cs; | 301 return cs; |
| 305 } else { | 302 } else { |
| 306 return assertNotSuggested(prefix); | 303 return assertNotSuggested(prefix); |
| 307 } | 304 } |
| 308 } | 305 } |
| 309 | 306 |
| 310 CompletionSuggestion assertSuggestLocalVariable(String name, | 307 CompletionSuggestion assertSuggestLocalVariable(String name, |
| 311 String returnType, [int relevance = COMPLETION_RELEVANCE_DEFAULT, | 308 String returnType, [int relevance = COMPLETION_RELEVANCE_DEFAULT, |
| 312 CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) { | 309 CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) { |
| 313 // Local variables should only be suggested by LocalComputer | 310 // Local variables should only be suggested by LocalComputer |
| 314 if (computer is LocalComputer) { | 311 if (computer is LocalComputer) { |
| 315 CompletionSuggestion cs = | 312 CompletionSuggestion cs = |
| 316 assertSuggest(name, csKind: kind, relevance: relevance); | 313 assertSuggest(name, csKind: kind, relevance: relevance); |
| 317 expect(cs.returnType, equals(returnType)); | 314 expect(cs.returnType, returnType != null ? returnType : 'dynamic'); |
| 318 protocol.Element element = cs.element; | 315 protocol.Element element = cs.element; |
| 319 expect(element, isNotNull); | 316 expect(element, isNotNull); |
| 320 expect(element.kind, equals(protocol.ElementKind.LOCAL_VARIABLE)); | 317 expect(element.kind, equals(protocol.ElementKind.LOCAL_VARIABLE)); |
| 321 expect(element.name, equals(name)); | 318 expect(element.name, equals(name)); |
| 322 expect(element.parameters, isNull); | 319 expect(element.parameters, isNull); |
| 323 expect( | 320 expect(element.returnType, returnType != null ? returnType : 'dynamic'); |
| 324 element.returnType, | |
| 325 equals(returnType != null ? returnType : 'dynamic')); | |
| 326 return cs; | 321 return cs; |
| 327 } else { | 322 } else { |
| 328 return assertNotSuggested(name); | 323 return assertNotSuggested(name); |
| 329 } | 324 } |
| 330 } | 325 } |
| 331 | 326 |
| 332 CompletionSuggestion assertSuggestMethod(String name, String declaringType, | 327 CompletionSuggestion assertSuggestMethod(String name, String declaringType, |
| 333 String returnType, [int relevance = COMPLETION_RELEVANCE_DEFAULT, | 328 String returnType, [int relevance = COMPLETION_RELEVANCE_DEFAULT, |
| 334 CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) { | 329 CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) { |
| 335 CompletionSuggestion cs = | 330 CompletionSuggestion cs = |
| 336 assertSuggest(name, csKind: kind, relevance: relevance); | 331 assertSuggest(name, csKind: kind, relevance: relevance); |
| 337 expect(cs.declaringType, equals(declaringType)); | 332 expect(cs.declaringType, equals(declaringType)); |
| 338 expect(cs.returnType, equals(returnType)); | 333 expect(cs.returnType, returnType != null ? returnType : 'dynamic'); |
| 339 protocol.Element element = cs.element; | 334 protocol.Element element = cs.element; |
| 340 expect(element, isNotNull); | 335 expect(element, isNotNull); |
| 341 expect(element.kind, equals(protocol.ElementKind.METHOD)); | 336 expect(element.kind, equals(protocol.ElementKind.METHOD)); |
| 342 expect(element.name, equals(name)); | 337 expect(element.name, equals(name)); |
| 343 String param = element.parameters; | 338 String param = element.parameters; |
| 344 expect(param, isNotNull); | 339 expect(param, isNotNull); |
| 345 expect(param[0], equals('(')); | 340 expect(param[0], equals('(')); |
| 346 expect(param[param.length - 1], equals(')')); | 341 expect(param[param.length - 1], equals(')')); |
| 347 expect( | 342 expect(element.returnType, returnType != null ? returnType : 'dynamic'); |
| 348 element.returnType, | |
| 349 equals(returnType != null ? returnType : 'dynamic')); | |
| 350 return cs; | 343 return cs; |
| 351 } | 344 } |
| 352 | 345 |
| 353 CompletionSuggestion assertSuggestNamedConstructor(String name, | 346 CompletionSuggestion assertSuggestNamedConstructor(String name, |
| 354 String returnType, [int relevance = COMPLETION_RELEVANCE_DEFAULT, | 347 String returnType, [int relevance = COMPLETION_RELEVANCE_DEFAULT, |
| 355 CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) { | 348 CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) { |
| 356 if (computer is InvocationComputer) { | 349 if (computer is InvocationComputer) { |
| 357 CompletionSuggestion cs = | 350 CompletionSuggestion cs = |
| 358 assertSuggest(name, csKind: kind, relevance: relevance); | 351 assertSuggest(name, csKind: kind, relevance: relevance); |
| 359 protocol.Element element = cs.element; | 352 protocol.Element element = cs.element; |
| 360 expect(element, isNotNull); | 353 expect(element, isNotNull); |
| 361 expect(element.kind, equals(protocol.ElementKind.CONSTRUCTOR)); | 354 expect(element.kind, equals(protocol.ElementKind.CONSTRUCTOR)); |
| 362 expect(element.name, equals(name)); | 355 expect(element.name, equals(name)); |
| 363 String param = element.parameters; | 356 String param = element.parameters; |
| 364 expect(param, isNotNull); | 357 expect(param, isNotNull); |
| 365 expect(param[0], equals('(')); | 358 expect(param[0], equals('(')); |
| 366 expect(param[param.length - 1], equals(')')); | 359 expect(param[param.length - 1], equals(')')); |
| 367 expect(element.returnType, equals(returnType)); | 360 expect(element.returnType, equals(returnType)); |
| 368 return cs; | 361 return cs; |
| 369 } else { | 362 } else { |
| 370 return assertNotSuggested(name); | 363 return assertNotSuggested(name); |
| 371 } | 364 } |
| 372 } | 365 } |
| 373 | 366 |
| 374 CompletionSuggestion assertSuggestParameter(String name, String returnType, | 367 CompletionSuggestion assertSuggestParameter(String name, String returnType, |
| 375 [int relevance = COMPLETION_RELEVANCE_DEFAULT, | 368 [int relevance = COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind ki
nd = |
| 376 CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) { | 369 CompletionSuggestionKind.INVOCATION]) { |
| 377 // Parameters should only be suggested by LocalComputer | 370 // Parameters should only be suggested by LocalComputer |
| 378 if (computer is LocalComputer) { | 371 if (computer is LocalComputer) { |
| 379 CompletionSuggestion cs = | 372 CompletionSuggestion cs = |
| 380 assertSuggest(name, csKind: kind, relevance: relevance); | 373 assertSuggest(name, csKind: kind, relevance: relevance); |
| 381 expect(cs.returnType, equals(returnType)); | 374 expect(cs.returnType, returnType != null ? returnType : 'dynamic'); |
| 382 protocol.Element element = cs.element; | 375 protocol.Element element = cs.element; |
| 383 expect(element, isNotNull); | 376 expect(element, isNotNull); |
| 384 expect(element.kind, equals(protocol.ElementKind.PARAMETER)); | 377 expect(element.kind, equals(protocol.ElementKind.PARAMETER)); |
| 385 expect(element.name, equals(name)); | 378 expect(element.name, equals(name)); |
| 386 expect(element.parameters, isNull); | 379 expect(element.parameters, isNull); |
| 387 expect( | 380 expect( |
| 388 element.returnType, | 381 element.returnType, |
| 389 equals(returnType != null ? returnType : 'dynamic')); | 382 equals(returnType != null ? returnType : 'dynamic')); |
| 390 return cs; | 383 return cs; |
| 391 } else { | 384 } else { |
| 392 return assertNotSuggested(name); | 385 return assertNotSuggested(name); |
| 393 } | 386 } |
| 394 } | 387 } |
| 395 | 388 |
| 396 CompletionSuggestion assertSuggestSetter(String name, | 389 CompletionSuggestion assertSuggestSetter(String name, [int relevance = |
| 397 [int relevance = COMPLETION_RELEVANCE_DEFAULT, | 390 COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kind = |
| 398 CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) { | 391 CompletionSuggestionKind.INVOCATION]) { |
| 399 CompletionSuggestion cs = assertSuggest( | 392 CompletionSuggestion cs = assertSuggest( |
| 400 name, | 393 name, |
| 401 csKind: kind, | 394 csKind: kind, |
| 402 relevance: relevance, | 395 relevance: relevance, |
| 403 elemKind: protocol.ElementKind.SETTER); | 396 elemKind: protocol.ElementKind.SETTER); |
| 404 protocol.Element element = cs.element; | 397 protocol.Element element = cs.element; |
| 405 expect(element, isNotNull); | 398 expect(element, isNotNull); |
| 406 expect(element.kind, equals(protocol.ElementKind.SETTER)); | 399 expect(element.kind, equals(protocol.ElementKind.SETTER)); |
| 407 expect(element.name, equals(name)); | 400 expect(element.name, equals(name)); |
| 408 // TODO (danrubel) assert setter param | 401 // TODO (danrubel) assert setter param |
| 409 //expect(element.parameters, isNull); | 402 //expect(element.parameters, isNull); |
| 410 // TODO (danrubel) it would be better if this was always null | 403 // TODO (danrubel) it would be better if this was always null |
| 411 if (element.returnType != null) { | 404 if (element.returnType != null) { |
| 412 expect(element.returnType, 'dynamic'); | 405 expect(element.returnType, 'dynamic'); |
| 413 } | 406 } |
| 414 return cs; | 407 return cs; |
| 415 } | 408 } |
| 416 | 409 |
| 417 CompletionSuggestion assertSuggestTopLevelVar(String name, String returnType, | 410 CompletionSuggestion assertSuggestTopLevelVar(String name, String returnType, |
| 418 [int relevance = COMPLETION_RELEVANCE_DEFAULT, | 411 [int relevance = COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind ki
nd = |
| 419 CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) { | 412 CompletionSuggestionKind.INVOCATION]) { |
| 420 CompletionSuggestion cs = | 413 CompletionSuggestion cs = |
| 421 assertSuggest(name, csKind: kind, relevance: relevance); | 414 assertSuggest(name, csKind: kind, relevance: relevance); |
| 422 expect(cs.returnType, equals(returnType)); | 415 expect(cs.returnType, returnType != null ? returnType : 'dynamic'); |
| 423 protocol.Element element = cs.element; | 416 protocol.Element element = cs.element; |
| 424 expect(element, isNotNull); | 417 expect(element, isNotNull); |
| 425 expect(element.kind, equals(protocol.ElementKind.TOP_LEVEL_VARIABLE)); | 418 expect(element.kind, equals(protocol.ElementKind.TOP_LEVEL_VARIABLE)); |
| 426 expect(element.name, equals(name)); | 419 expect(element.name, equals(name)); |
| 427 expect(element.parameters, isNull); | 420 expect(element.parameters, isNull); |
| 428 //TODO (danrubel) return type level variable 'type' but not as 'returnType' | 421 expect(element.returnType, returnType != null ? returnType : 'dynamic'); |
| 429 // expect( | |
| 430 // element.returnType, | |
| 431 // equals(returnType != null ? returnType : 'dynamic')); | |
| 432 return cs; | 422 return cs; |
| 433 } | 423 } |
| 434 | 424 |
| 435 void assertSuggestTopLevelVarGetterSetter(String name, String returnType, | 425 void assertSuggestTopLevelVarGetterSetter(String name, String returnType, |
| 436 [int relevance = COMPLETION_RELEVANCE_DEFAULT]) { | 426 [int relevance = COMPLETION_RELEVANCE_DEFAULT]) { |
| 437 if (computer is ImportedComputer) { | 427 if (computer is ImportedComputer) { |
| 438 assertSuggestGetter(name, returnType); | 428 assertSuggestGetter(name, returnType); |
| 439 assertSuggestSetter(name); | 429 assertSuggestSetter(name); |
| 440 } else { | 430 } else { |
| 441 assertNotSuggested(name); | 431 assertNotSuggested(name); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 CompletionSuggestion assertLocalSuggestMethod(String name, | 583 CompletionSuggestion assertLocalSuggestMethod(String name, |
| 594 String declaringType, String returnType, [int relevance = | 584 String declaringType, String returnType, [int relevance = |
| 595 COMPLETION_RELEVANCE_DEFAULT]) { | 585 COMPLETION_RELEVANCE_DEFAULT]) { |
| 596 if (computer is LocalComputer) { | 586 if (computer is LocalComputer) { |
| 597 return assertSuggestMethod(name, declaringType, returnType, relevance); | 587 return assertSuggestMethod(name, declaringType, returnType, relevance); |
| 598 } else { | 588 } else { |
| 599 return assertNotSuggested(name); | 589 return assertNotSuggested(name); |
| 600 } | 590 } |
| 601 } | 591 } |
| 602 | 592 |
| 603 CompletionSuggestion assertSuggestImportedClass(String name, | 593 CompletionSuggestion assertSuggestImportedClass(String name, [int relevance = |
| 604 [int relevance = COMPLETION_RELEVANCE_DEFAULT, | 594 COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kind = |
| 605 CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) { | 595 CompletionSuggestionKind.INVOCATION]) { |
| 606 if (computer is ImportedComputer) { | 596 if (computer is ImportedComputer) { |
| 607 return assertSuggestClass(name, relevance, kind); | 597 return assertSuggestClass(name, relevance, kind); |
| 608 } else { | 598 } else { |
| 609 return assertNotSuggested(name); | 599 return assertNotSuggested(name); |
| 610 } | 600 } |
| 611 } | 601 } |
| 612 | 602 |
| 613 CompletionSuggestion assertSuggestImportedField(String name, | 603 CompletionSuggestion assertSuggestImportedField(String name, String type, |
| 614 [int relevance = COMPLETION_RELEVANCE_DEFAULT]) { | 604 [int relevance = COMPLETION_RELEVANCE_DEFAULT]) { |
| 615 if (computer is ImportedComputer) { | 605 return assertNotSuggested(name); |
| 616 return assertSuggestField(name, relevance: relevance); | |
| 617 } else { | |
| 618 return assertNotSuggested(name); | |
| 619 } | |
| 620 } | 606 } |
| 621 | 607 |
| 622 CompletionSuggestion assertSuggestImportedFunction(String name, | 608 CompletionSuggestion assertSuggestImportedFunction(String name, |
| 623 String returnType, [bool isDeprecated = false, int relevance = | 609 String returnType, [bool isDeprecated = false, int relevance = |
| 624 COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kind = | 610 COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kind = |
| 625 CompletionSuggestionKind.INVOCATION]) { | 611 CompletionSuggestionKind.INVOCATION]) { |
| 626 if (computer is ImportedComputer) { | 612 if (computer is ImportedComputer) { |
| 627 return assertSuggestFunction( | 613 return assertSuggestFunction( |
| 628 name, | 614 name, |
| 629 returnType, | 615 returnType, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 645 returnType, | 631 returnType, |
| 646 isDeprecated, | 632 isDeprecated, |
| 647 relevance, | 633 relevance, |
| 648 kind); | 634 kind); |
| 649 } else { | 635 } else { |
| 650 return assertNotSuggested(name); | 636 return assertNotSuggested(name); |
| 651 } | 637 } |
| 652 } | 638 } |
| 653 | 639 |
| 654 CompletionSuggestion assertSuggestImportedGetter(String name, | 640 CompletionSuggestion assertSuggestImportedGetter(String name, |
| 655 String returnType, [int relevance = | 641 String returnType, [int relevance = COMPLETION_RELEVANCE_DEFAULT]) { |
| 656 COMPLETION_RELEVANCE_DEFAULT]) { | |
| 657 if (computer is ImportedComputer) { | 642 if (computer is ImportedComputer) { |
| 658 return assertSuggestGetter(name, returnType, relevance: relevance); | 643 return assertSuggestGetter(name, returnType, relevance: relevance); |
| 659 } else { | 644 } else { |
| 660 return assertNotSuggested(name); | 645 return assertNotSuggested(name); |
| 661 } | 646 } |
| 662 } | 647 } |
| 663 | 648 |
| 664 CompletionSuggestion assertSuggestImportedMethod(String name, | 649 CompletionSuggestion assertSuggestImportedMethod(String name, |
| 665 String declaringType, String returnType, [int relevance = | 650 String declaringType, String returnType, [int relevance = |
| 666 COMPLETION_RELEVANCE_DEFAULT]) { | 651 COMPLETION_RELEVANCE_DEFAULT]) { |
| 667 if (computer is ImportedComputer) { | 652 if (computer is ImportedComputer) { |
| 668 return assertSuggestMethod(name, declaringType, returnType, relevance); | 653 return assertSuggestMethod(name, declaringType, returnType, relevance); |
| 669 } else { | 654 } else { |
| 670 return assertNotSuggested(name); | 655 return assertNotSuggested(name); |
| 671 } | 656 } |
| 672 } | 657 } |
| 673 | 658 |
| 674 CompletionSuggestion assertSuggestImportedSetter(String name, | 659 CompletionSuggestion assertSuggestImportedSetter(String name, [int relevance = |
| 675 [int relevance = COMPLETION_RELEVANCE_DEFAULT]) { | 660 COMPLETION_RELEVANCE_DEFAULT]) { |
| 676 if (computer is ImportedComputer) { | 661 if (computer is ImportedComputer) { |
| 677 return assertSuggestSetter(name, relevance); | 662 return assertSuggestSetter(name, relevance); |
| 678 } else { | 663 } else { |
| 679 return assertNotSuggested(name); | 664 return assertNotSuggested(name); |
| 680 } | 665 } |
| 681 } | 666 } |
| 682 | 667 |
| 683 CompletionSuggestion assertSuggestImportedTopLevelVar(String name, | 668 CompletionSuggestion assertSuggestImportedTopLevelVar(String name, |
| 684 String returnType, [int relevance = COMPLETION_RELEVANCE_DEFAULT, | 669 String returnType, [int relevance = COMPLETION_RELEVANCE_DEFAULT, |
| 685 CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) { | 670 CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) { |
| 686 if (computer is ImportedComputer) { | 671 if (computer is ImportedComputer) { |
| 687 return assertSuggestTopLevelVar(name, returnType, relevance, kind); | 672 return assertSuggestTopLevelVar(name, returnType, relevance, kind); |
| 688 } else { | 673 } else { |
| 689 return assertNotSuggested(name); | 674 return assertNotSuggested(name); |
| 690 } | 675 } |
| 691 } | 676 } |
| 692 | 677 |
| 693 CompletionSuggestion assertSuggestInvocationClass(String name, | 678 CompletionSuggestion assertSuggestInvocationClass(String name, [int relevance |
| 694 [int relevance = COMPLETION_RELEVANCE_DEFAULT]) { | 679 = COMPLETION_RELEVANCE_DEFAULT]) { |
| 695 if (computer is InvocationComputer) { | 680 if (computer is InvocationComputer) { |
| 696 return assertSuggestClass(name, relevance); | 681 return assertSuggestClass(name, relevance); |
| 697 } else { | 682 } else { |
| 698 return assertNotSuggested(name); | 683 return assertNotSuggested(name); |
| 699 } | 684 } |
| 700 } | 685 } |
| 701 | 686 |
| 687 CompletionSuggestion assertSuggestInvocationField(String name, String type, |
| 688 {int relevance: COMPLETION_RELEVANCE_DEFAULT, bool isDeprecated: false}) { |
| 689 return assertNotSuggested(name); |
| 690 } |
| 691 |
| 702 CompletionSuggestion assertSuggestInvocationGetter(String name, | 692 CompletionSuggestion assertSuggestInvocationGetter(String name, |
| 703 String returnType, {int relevance: COMPLETION_RELEVANCE_DEFAULT, | 693 String returnType, {int relevance: COMPLETION_RELEVANCE_DEFAULT, |
| 704 bool isDeprecated: false}) { | 694 bool isDeprecated: false}) { |
| 705 if (computer is InvocationComputer) { | 695 if (computer is InvocationComputer) { |
| 706 return assertSuggestGetter( | 696 return assertSuggestGetter( |
| 707 name, | 697 name, |
| 708 returnType, | 698 returnType, |
| 709 relevance: relevance, | 699 relevance: relevance, |
| 710 isDeprecated: isDeprecated); | 700 isDeprecated: isDeprecated); |
| 711 } else { | 701 } else { |
| 712 return assertNotSuggested(name); | 702 return assertNotSuggested(name); |
| 713 } | 703 } |
| 714 } | 704 } |
| 715 | 705 |
| 716 CompletionSuggestion assertSuggestInvocationMethod(String name, | 706 CompletionSuggestion assertSuggestInvocationMethod(String name, |
| 717 String declaringType, String returnType, [int relevance = | 707 String declaringType, String returnType, [int relevance = |
| 718 COMPLETION_RELEVANCE_DEFAULT]) { | 708 COMPLETION_RELEVANCE_DEFAULT]) { |
| 719 if (computer is InvocationComputer) { | 709 if (computer is InvocationComputer) { |
| 720 return assertSuggestMethod(name, declaringType, returnType, relevance); | 710 return assertSuggestMethod(name, declaringType, returnType, relevance); |
| 721 } else { | 711 } else { |
| 722 return assertNotSuggested(name); | 712 return assertNotSuggested(name); |
| 723 } | 713 } |
| 724 } | 714 } |
| 725 | 715 |
| 726 CompletionSuggestion assertSuggestInvocationSetter(String name, | 716 CompletionSuggestion assertSuggestInvocationSetter(String name, [int relevance |
| 727 [int relevance = COMPLETION_RELEVANCE_DEFAULT]) { | 717 = COMPLETION_RELEVANCE_DEFAULT]) { |
| 728 if (computer is InvocationComputer) { | 718 if (computer is InvocationComputer) { |
| 729 return assertSuggestSetter(name); | 719 return assertSuggestSetter(name); |
| 730 } else { | 720 } else { |
| 731 return assertNotSuggested(name); | 721 return assertNotSuggested(name); |
| 732 } | 722 } |
| 733 } | 723 } |
| 734 | 724 |
| 735 CompletionSuggestion assertSuggestInvocationTopLevelVar(String name, | 725 CompletionSuggestion assertSuggestInvocationTopLevelVar(String name, |
| 736 String returnType, [int relevance = | 726 String returnType, [int relevance = COMPLETION_RELEVANCE_DEFAULT]) { |
| 737 COMPLETION_RELEVANCE_DEFAULT]) { | |
| 738 if (computer is InvocationComputer) { | 727 if (computer is InvocationComputer) { |
| 739 return assertSuggestTopLevelVar(name, returnType, relevance); | 728 return assertSuggestTopLevelVar(name, returnType, relevance); |
| 740 } else { | 729 } else { |
| 741 return assertNotSuggested(name); | 730 return assertNotSuggested(name); |
| 742 } | 731 } |
| 743 } | 732 } |
| 744 | 733 |
| 745 CompletionSuggestion assertSuggestLocalClass(String name, | 734 CompletionSuggestion assertSuggestLocalClass(String name, [int relevance = |
| 746 [int relevance = COMPLETION_RELEVANCE_DEFAULT]) { | 735 COMPLETION_RELEVANCE_DEFAULT]) { |
| 747 if (computer is LocalComputer) { | 736 if (computer is LocalComputer) { |
| 748 return assertSuggestClass(name, relevance); | 737 return assertSuggestClass(name, relevance); |
| 749 } else { | 738 } else { |
| 750 return assertNotSuggested(name); | 739 return assertNotSuggested(name); |
| 751 } | 740 } |
| 752 } | 741 } |
| 753 | 742 |
| 754 CompletionSuggestion assertSuggestLocalClassTypeAlias(String name, | 743 CompletionSuggestion assertSuggestLocalClassTypeAlias(String name, |
| 755 [int relevance = COMPLETION_RELEVANCE_DEFAULT]) { | 744 [int relevance = COMPLETION_RELEVANCE_DEFAULT]) { |
| 756 if (computer is LocalComputer) { | 745 if (computer is LocalComputer) { |
| 757 return assertSuggestClassTypeAlias(name, relevance); | 746 return assertSuggestClassTypeAlias(name, relevance); |
| 758 } else { | 747 } else { |
| 759 return assertNotSuggested(name); | 748 return assertNotSuggested(name); |
| 760 } | 749 } |
| 761 } | 750 } |
| 762 | 751 |
| 763 CompletionSuggestion assertSuggestLocalField(String name, | 752 CompletionSuggestion assertSuggestLocalField(String name, String type, |
| 764 [int relevance = COMPLETION_RELEVANCE_DEFAULT]) { | 753 [int relevance = COMPLETION_RELEVANCE_DEFAULT]) { |
| 765 if (computer is LocalComputer) { | 754 return assertNotSuggested(name); |
| 766 return assertSuggestField(name, relevance: relevance); | |
| 767 } else { | |
| 768 return assertNotSuggested(name); | |
| 769 } | |
| 770 } | 755 } |
| 771 | 756 |
| 772 CompletionSuggestion assertSuggestLocalFunction(String name, | 757 CompletionSuggestion assertSuggestLocalFunction(String name, |
| 773 String returnType, [bool isDeprecated = false, int relevance = | 758 String returnType, [bool isDeprecated = false, int relevance = |
| 774 COMPLETION_RELEVANCE_DEFAULT]) { | 759 COMPLETION_RELEVANCE_DEFAULT]) { |
| 775 if (computer is LocalComputer) { | 760 if (computer is LocalComputer) { |
| 776 return assertSuggestFunction(name, returnType, isDeprecated, relevance); | 761 return assertSuggestFunction(name, returnType, isDeprecated, relevance); |
| 777 } else { | 762 } else { |
| 778 return assertNotSuggested(name); | 763 return assertNotSuggested(name); |
| 779 } | 764 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 805 CompletionSuggestion assertSuggestLocalMethod(String name, | 790 CompletionSuggestion assertSuggestLocalMethod(String name, |
| 806 String declaringType, String returnType, [int relevance = | 791 String declaringType, String returnType, [int relevance = |
| 807 COMPLETION_RELEVANCE_DEFAULT]) { | 792 COMPLETION_RELEVANCE_DEFAULT]) { |
| 808 if (computer is LocalComputer) { | 793 if (computer is LocalComputer) { |
| 809 return assertSuggestMethod(name, declaringType, returnType, relevance); | 794 return assertSuggestMethod(name, declaringType, returnType, relevance); |
| 810 } else { | 795 } else { |
| 811 return assertNotSuggested(name); | 796 return assertNotSuggested(name); |
| 812 } | 797 } |
| 813 } | 798 } |
| 814 | 799 |
| 815 CompletionSuggestion assertSuggestLocalSetter(String name, | 800 CompletionSuggestion assertSuggestLocalSetter(String name, [int relevance = |
| 816 [int relevance = COMPLETION_RELEVANCE_DEFAULT]) { | 801 COMPLETION_RELEVANCE_DEFAULT]) { |
| 817 if (computer is LocalComputer) { | 802 if (computer is LocalComputer) { |
| 818 return assertSuggestSetter(name, relevance); | 803 return assertSuggestSetter(name, relevance); |
| 819 } else { | 804 } else { |
| 820 return assertNotSuggested(name); | 805 return assertNotSuggested(name); |
| 821 } | 806 } |
| 822 } | 807 } |
| 823 | 808 |
| 824 CompletionSuggestion assertSuggestLocalTopLevelVar(String name, | 809 CompletionSuggestion assertSuggestLocalTopLevelVar(String name, |
| 825 String returnType, [int relevance = | 810 String returnType, [int relevance = COMPLETION_RELEVANCE_DEFAULT]) { |
| 826 COMPLETION_RELEVANCE_DEFAULT]) { | |
| 827 if (computer is LocalComputer) { | 811 if (computer is LocalComputer) { |
| 828 return assertSuggestTopLevelVar(name, returnType, relevance); | 812 return assertSuggestTopLevelVar(name, returnType, relevance); |
| 829 } else { | 813 } else { |
| 830 return assertNotSuggested(name); | 814 return assertNotSuggested(name); |
| 831 } | 815 } |
| 832 } | 816 } |
| 833 | 817 |
| 834 CompletionSuggestion assertSuggestNonLocalClass(String name, | 818 CompletionSuggestion assertSuggestNonLocalClass(String name, [int relevance = |
| 835 [int relevance = COMPLETION_RELEVANCE_DEFAULT, | 819 COMPLETION_RELEVANCE_DEFAULT, CompletionSuggestionKind kind = |
| 836 CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) { | 820 CompletionSuggestionKind.INVOCATION]) { |
| 837 return assertSuggestImportedClass(name, relevance, kind); | 821 return assertSuggestImportedClass(name, relevance, kind); |
| 838 } | 822 } |
| 839 | 823 |
| 840 Future computeFull(assertFunction(bool result), {bool fullAnalysis: true}) { | 824 Future computeFull(assertFunction(bool result), {bool fullAnalysis: true}) { |
| 841 return super.computeFull( | 825 return super.computeFull( |
| 842 assertFunction, | 826 assertFunction, |
| 843 fullAnalysis: fullAnalysis).then(assertCachedCompute); | 827 fullAnalysis: fullAnalysis).then(assertCachedCompute); |
| 844 } | 828 } |
| 845 | 829 |
| 846 test_ArgumentList() { | 830 test_ArgumentList() { |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1298 lib B; | 1282 lib B; |
| 1299 class F { var f1; f2() { } get f3 => 0; set f4(fx) { } } | 1283 class F { var f1; f2() { } get f3 => 0; set f4(fx) { } } |
| 1300 class E extends F { var e1; e2() { } } | 1284 class E extends F { var e1; e2() { } } |
| 1301 class I { int i1; i2() { } get e1; } | 1285 class I { int i1; i2() { } get e1; } |
| 1302 class M { var m1; int m2() { } }'''); | 1286 class M { var m1; int m2() { } }'''); |
| 1303 addTestSource(''' | 1287 addTestSource(''' |
| 1304 import "/testB.dart"; | 1288 import "/testB.dart"; |
| 1305 class A extends E implements I with M {a() {^}}'''); | 1289 class A extends E implements I with M {a() {^}}'''); |
| 1306 computeFast(); | 1290 computeFast(); |
| 1307 return computeFull((bool result) { | 1291 return computeFull((bool result) { |
| 1308 assertSuggestImportedField('e1'); | 1292 assertSuggestImportedField('e1', null); |
| 1309 assertSuggestImportedField('f1'); | 1293 assertSuggestImportedField('f1', null); |
| 1310 assertSuggestImportedField('i1'); | 1294 assertSuggestImportedField('i1', 'int'); |
| 1311 assertSuggestImportedField('m1'); | 1295 assertSuggestImportedField('m1', null); |
| 1312 assertSuggestImportedGetter('f3', null); | 1296 assertSuggestImportedGetter('f3', null); |
| 1313 assertSuggestImportedSetter('f4'); | 1297 assertSuggestImportedSetter('f4'); |
| 1314 //TODO (danrubel) include declared type in suggestion | 1298 //TODO (danrubel) include declared type in suggestion |
| 1315 assertSuggestImportedMethod('e2', null, null); | 1299 assertSuggestImportedMethod('e2', null, null); |
| 1316 assertSuggestImportedMethod('f2', null, null); | 1300 assertSuggestImportedMethod('f2', null, null); |
| 1317 assertSuggestImportedMethod('i2', null, null); | 1301 assertSuggestImportedMethod('i2', null, null); |
| 1318 //assertSuggestImportedMethod('m2', null, null); | 1302 //assertSuggestImportedMethod('m2', null, null); |
| 1319 assertNotSuggested('=='); | 1303 assertNotSuggested('=='); |
| 1320 }); | 1304 }); |
| 1321 } | 1305 } |
| 1322 | 1306 |
| 1323 test_Block_inherited_local() { | 1307 test_Block_inherited_local() { |
| 1324 // Block BlockFunctionBody MethodDeclaration ClassDeclaration | 1308 // Block BlockFunctionBody MethodDeclaration ClassDeclaration |
| 1325 addTestSource(''' | 1309 addTestSource(''' |
| 1326 class F { var f1; f2() { } get f3 => 0; set f4(fx) { } } | 1310 class F { var f1; f2() { } get f3 => 0; set f4(fx) { } } |
| 1327 class E extends F { var e1; e2() { } } | 1311 class E extends F { var e1; e2() { } } |
| 1328 class I { int i1; i2() { } } | 1312 class I { int i1; i2() { } } |
| 1329 class M { var m1; int m2() { } } | 1313 class M { var m1; int m2() { } } |
| 1330 class A extends E implements I with M {a() {^}}'''); | 1314 class A extends E implements I with M {a() {^}}'''); |
| 1331 computeFast(); | 1315 computeFast(); |
| 1332 return computeFull((bool result) { | 1316 return computeFull((bool result) { |
| 1333 assertSuggestLocalField('e1'); | 1317 assertSuggestLocalField('e1', null); |
| 1334 assertSuggestLocalField('f1'); | 1318 assertSuggestLocalField('f1', null); |
| 1335 assertSuggestLocalField('i1'); | 1319 assertSuggestLocalField('i1', 'int'); |
| 1336 assertSuggestLocalField('m1'); | 1320 assertSuggestLocalField('m1', null); |
| 1337 assertSuggestLocalGetter('f3', null); | 1321 assertSuggestLocalGetter('f3', null); |
| 1338 assertSuggestLocalSetter('f4'); | 1322 assertSuggestLocalSetter('f4'); |
| 1339 assertSuggestLocalMethod('e2', 'E', null); | 1323 assertSuggestLocalMethod('e2', 'E', null); |
| 1340 assertSuggestLocalMethod('f2', 'F', null); | 1324 assertSuggestLocalMethod('f2', 'F', null); |
| 1341 assertSuggestLocalMethod('i2', 'I', null); | 1325 assertSuggestLocalMethod('i2', 'I', null); |
| 1342 assertSuggestLocalMethod('m2', 'M', 'int'); | 1326 assertSuggestLocalMethod('m2', 'M', 'int'); |
| 1343 }); | 1327 }); |
| 1344 } | 1328 } |
| 1345 | 1329 |
| 1346 test_CascadeExpression_selector1() { | 1330 test_CascadeExpression_selector1() { |
| 1347 // PropertyAccess CascadeExpression ExpressionStatement Block | 1331 // PropertyAccess CascadeExpression ExpressionStatement Block |
| 1348 addSource('/testB.dart', ''' | 1332 addSource('/testB.dart', ''' |
| 1349 class B { }'''); | 1333 class B { }'''); |
| 1350 addTestSource(''' | 1334 addTestSource(''' |
| 1351 import "/testB.dart"; | 1335 import "/testB.dart"; |
| 1352 class A {var b; X _c;} | 1336 class A {var b; X _c;} |
| 1353 class X{} | 1337 class X{} |
| 1354 // looks like a cascade to the parser | 1338 // looks like a cascade to the parser |
| 1355 // but the user is trying to get completions for a non-cascade | 1339 // but the user is trying to get completions for a non-cascade |
| 1356 main() {A a; a.^.z}'''); | 1340 main() {A a; a.^.z}'''); |
| 1357 computeFast(); | 1341 computeFast(); |
| 1358 return computeFull((bool result) { | 1342 return computeFull((bool result) { |
| 1359 assertSuggestInvocationGetter('b', null); | 1343 assertSuggestInvocationField('b', null); |
| 1360 assertSuggestInvocationGetter('_c', 'X'); | 1344 assertSuggestInvocationField('_c', 'X'); |
| 1361 assertNotSuggested('Object'); | 1345 assertNotSuggested('Object'); |
| 1362 assertNotSuggested('A'); | 1346 assertNotSuggested('A'); |
| 1363 assertNotSuggested('B'); | 1347 assertNotSuggested('B'); |
| 1364 assertNotSuggested('X'); | 1348 assertNotSuggested('X'); |
| 1365 assertNotSuggested('z'); | 1349 assertNotSuggested('z'); |
| 1366 assertNotSuggested('=='); | 1350 assertNotSuggested('=='); |
| 1367 }); | 1351 }); |
| 1368 } | 1352 } |
| 1369 | 1353 |
| 1370 test_CascadeExpression_selector2() { | 1354 test_CascadeExpression_selector2() { |
| 1371 // SimpleIdentifier PropertyAccess CascadeExpression ExpressionStatement | 1355 // SimpleIdentifier PropertyAccess CascadeExpression ExpressionStatement |
| 1372 addSource('/testB.dart', ''' | 1356 addSource('/testB.dart', ''' |
| 1373 class B { }'''); | 1357 class B { }'''); |
| 1374 addTestSource(''' | 1358 addTestSource(''' |
| 1375 import "/testB.dart"; | 1359 import "/testB.dart"; |
| 1376 class A {var b; X _c;} | 1360 class A {var b; X _c;} |
| 1377 class X{} | 1361 class X{} |
| 1378 main() {A a; a..^z}'''); | 1362 main() {A a; a..^z}'''); |
| 1379 computeFast(); | 1363 computeFast(); |
| 1380 return computeFull((bool result) { | 1364 return computeFull((bool result) { |
| 1381 assertSuggestInvocationGetter('b', null); | 1365 assertSuggestInvocationField('b', null); |
| 1382 assertSuggestInvocationGetter('_c', 'X'); | 1366 assertSuggestInvocationField('_c', 'X'); |
| 1383 assertNotSuggested('Object'); | 1367 assertNotSuggested('Object'); |
| 1384 assertNotSuggested('A'); | 1368 assertNotSuggested('A'); |
| 1385 assertNotSuggested('B'); | 1369 assertNotSuggested('B'); |
| 1386 assertNotSuggested('X'); | 1370 assertNotSuggested('X'); |
| 1387 assertNotSuggested('z'); | 1371 assertNotSuggested('z'); |
| 1388 assertNotSuggested('=='); | 1372 assertNotSuggested('=='); |
| 1389 }); | 1373 }); |
| 1390 } | 1374 } |
| 1391 | 1375 |
| 1392 test_CascadeExpression_selector2_withTrailingReturn() { | 1376 test_CascadeExpression_selector2_withTrailingReturn() { |
| 1393 // PropertyAccess CascadeExpression ExpressionStatement Block | 1377 // PropertyAccess CascadeExpression ExpressionStatement Block |
| 1394 addSource('/testB.dart', ''' | 1378 addSource('/testB.dart', ''' |
| 1395 class B { }'''); | 1379 class B { }'''); |
| 1396 addTestSource(''' | 1380 addTestSource(''' |
| 1397 import "/testB.dart"; | 1381 import "/testB.dart"; |
| 1398 class A {var b; X _c;} | 1382 class A {var b; X _c;} |
| 1399 class X{} | 1383 class X{} |
| 1400 main() {A a; a..^ return}'''); | 1384 main() {A a; a..^ return}'''); |
| 1401 computeFast(); | 1385 computeFast(); |
| 1402 return computeFull((bool result) { | 1386 return computeFull((bool result) { |
| 1403 assertSuggestInvocationGetter('b', null); | 1387 assertSuggestInvocationField('b', null); |
| 1404 assertSuggestInvocationGetter('_c', 'X'); | 1388 assertSuggestInvocationField('_c', 'X'); |
| 1405 assertNotSuggested('Object'); | 1389 assertNotSuggested('Object'); |
| 1406 assertNotSuggested('A'); | 1390 assertNotSuggested('A'); |
| 1407 assertNotSuggested('B'); | 1391 assertNotSuggested('B'); |
| 1408 assertNotSuggested('X'); | 1392 assertNotSuggested('X'); |
| 1409 assertNotSuggested('z'); | 1393 assertNotSuggested('z'); |
| 1410 assertNotSuggested('=='); | 1394 assertNotSuggested('=='); |
| 1411 }); | 1395 }); |
| 1412 } | 1396 } |
| 1413 | 1397 |
| 1414 test_CascadeExpression_target() { | 1398 test_CascadeExpression_target() { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1538 assertNoSuggestions(); | 1522 assertNoSuggestions(); |
| 1539 }); | 1523 }); |
| 1540 } | 1524 } |
| 1541 | 1525 |
| 1542 test_ConditionalExpression_empty() { | 1526 test_ConditionalExpression_empty() { |
| 1543 // SimpleIdentifier PrefixIdentifier IfStatement | 1527 // SimpleIdentifier PrefixIdentifier IfStatement |
| 1544 addTestSource(''' | 1528 addTestSource(''' |
| 1545 class A {var b; X _c; foo() {A a; if (^) something}}'''); | 1529 class A {var b; X _c; foo() {A a; if (^) something}}'''); |
| 1546 computeFast(); | 1530 computeFast(); |
| 1547 return computeFull((bool result) { | 1531 return computeFull((bool result) { |
| 1548 assertSuggestLocalField('b'); | 1532 assertSuggestLocalField('b', null); |
| 1549 assertSuggestLocalField('_c'); | 1533 assertSuggestLocalField('_c', 'X'); |
| 1550 assertSuggestImportedClass('Object'); | 1534 assertSuggestImportedClass('Object'); |
| 1551 assertSuggestLocalClass('A'); | 1535 assertSuggestLocalClass('A'); |
| 1552 assertNotSuggested('=='); | 1536 assertNotSuggested('=='); |
| 1553 }); | 1537 }); |
| 1554 } | 1538 } |
| 1555 | 1539 |
| 1556 test_ConditionalExpression_invocation() { | 1540 test_ConditionalExpression_invocation() { |
| 1557 // SimpleIdentifier PrefixIdentifier IfStatement | 1541 // SimpleIdentifier PrefixIdentifier IfStatement |
| 1558 addTestSource(''' | 1542 addTestSource(''' |
| 1559 main() {var a; if (a.^) something}'''); | 1543 main() {var a; if (a.^) something}'''); |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2041 // Block BlockFunctionBody MethodDeclaration | 2025 // Block BlockFunctionBody MethodDeclaration |
| 2042 addTestSource('class A {@deprecated X f; Z _a() {^} var _g;}'); | 2026 addTestSource('class A {@deprecated X f; Z _a() {^} var _g;}'); |
| 2043 computeFast(); | 2027 computeFast(); |
| 2044 return computeFull((bool result) { | 2028 return computeFull((bool result) { |
| 2045 CompletionSuggestion methodA = assertSuggestLocalMethod('_a', 'A', 'Z'); | 2029 CompletionSuggestion methodA = assertSuggestLocalMethod('_a', 'A', 'Z'); |
| 2046 if (methodA != null) { | 2030 if (methodA != null) { |
| 2047 expect(methodA.element.isDeprecated, isFalse); | 2031 expect(methodA.element.isDeprecated, isFalse); |
| 2048 expect(methodA.element.isPrivate, isTrue); | 2032 expect(methodA.element.isPrivate, isTrue); |
| 2049 } | 2033 } |
| 2050 CompletionSuggestion getterF = | 2034 CompletionSuggestion getterF = |
| 2051 assertSuggestLocalField('f', COMPLETION_RELEVANCE_LOW); | 2035 assertSuggestLocalField('f', 'X', COMPLETION_RELEVANCE_LOW); |
| 2052 if (getterF != null) { | 2036 if (getterF != null) { |
| 2053 expect(getterF.element.isDeprecated, isTrue); | 2037 expect(getterF.element.isDeprecated, isTrue); |
| 2054 expect(getterF.element.isPrivate, isFalse); | 2038 expect(getterF.element.isPrivate, isFalse); |
| 2055 expect(getterF.element.parameters, isNull); | 2039 expect(getterF.element.parameters, isNull); |
| 2056 } | 2040 } |
| 2057 CompletionSuggestion getterG = assertSuggestLocalField('_g'); | 2041 CompletionSuggestion getterG = assertSuggestLocalField('_g', null); |
| 2058 if (getterG != null) { | 2042 if (getterG != null) { |
| 2059 expect(getterG.element.isDeprecated, isFalse); | 2043 expect(getterG.element.isDeprecated, isFalse); |
| 2060 expect(getterG.element.isPrivate, isTrue); | 2044 expect(getterG.element.isPrivate, isTrue); |
| 2061 expect(getterF.element.parameters, isNull); | 2045 expect(getterF.element.parameters, isNull); |
| 2062 } | 2046 } |
| 2063 assertSuggestImportedClass('bool'); | 2047 assertSuggestImportedClass('bool'); |
| 2064 }); | 2048 }); |
| 2065 } | 2049 } |
| 2066 | 2050 |
| 2067 test_MethodDeclaration_parameters_named() { | 2051 test_MethodDeclaration_parameters_named() { |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2210 m(X x) {} I _n(X x) {}} | 2194 m(X x) {} I _n(X x) {}} |
| 2211 class X{}'''); | 2195 class X{}'''); |
| 2212 addTestSource(''' | 2196 addTestSource(''' |
| 2213 import "/testB.dart"; | 2197 import "/testB.dart"; |
| 2214 class A extends B { | 2198 class A extends B { |
| 2215 static const String scA = 'foo'; | 2199 static const String scA = 'foo'; |
| 2216 w() { }} | 2200 w() { }} |
| 2217 main() {A.^}'''); | 2201 main() {A.^}'''); |
| 2218 computeFast(); | 2202 computeFast(); |
| 2219 return computeFull((bool result) { | 2203 return computeFull((bool result) { |
| 2220 assertSuggestInvocationGetter('scA', 'String'); | 2204 assertSuggestInvocationField('scA', 'String'); |
| 2221 assertSuggestInvocationGetter('scB', 'int'); | 2205 assertSuggestInvocationField('scB', 'int'); |
| 2222 assertSuggestInvocationGetter('scI', null); | 2206 assertSuggestInvocationField('scI', null); |
| 2223 assertNotSuggested('b'); | 2207 assertNotSuggested('b'); |
| 2224 assertNotSuggested('_c'); | 2208 assertNotSuggested('_c'); |
| 2225 assertNotSuggested('d'); | 2209 assertNotSuggested('d'); |
| 2226 assertNotSuggested('_e'); | 2210 assertNotSuggested('_e'); |
| 2227 assertNotSuggested('f'); | 2211 assertNotSuggested('f'); |
| 2228 assertNotSuggested('_g'); | 2212 assertNotSuggested('_g'); |
| 2229 assertNotSuggested('s1'); | 2213 assertNotSuggested('s1'); |
| 2230 assertNotSuggested('_s2'); | 2214 assertNotSuggested('_s2'); |
| 2231 assertNotSuggested('m'); | 2215 assertNotSuggested('m'); |
| 2232 assertNotSuggested('_n'); | 2216 assertNotSuggested('_n'); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 2249 @deprecated var b; X _c; | 2233 @deprecated var b; X _c; |
| 2250 X get d => new A();get _e => new A(); | 2234 X get d => new A();get _e => new A(); |
| 2251 set s1(I x) {} set _s2(I x) {} | 2235 set s1(I x) {} set _s2(I x) {} |
| 2252 m(X x) {} I _n(X x) {}} | 2236 m(X x) {} I _n(X x) {}} |
| 2253 class X{}'''); | 2237 class X{}'''); |
| 2254 addTestSource(''' | 2238 addTestSource(''' |
| 2255 import "/testB.dart"; | 2239 import "/testB.dart"; |
| 2256 main() {A a; a.^}'''); | 2240 main() {A a; a.^}'''); |
| 2257 computeFast(); | 2241 computeFast(); |
| 2258 return computeFull((bool result) { | 2242 return computeFull((bool result) { |
| 2259 assertSuggestInvocationGetter('sc', 'int'); | 2243 assertSuggestInvocationField('sc', 'int'); |
| 2260 assertSuggestInvocationGetter('b', null, isDeprecated: true); | 2244 assertSuggestInvocationField('b', null, isDeprecated: true); |
| 2261 assertNotSuggested('_c'); | 2245 assertNotSuggested('_c'); |
| 2262 assertSuggestInvocationGetter('d', 'X'); | 2246 assertSuggestInvocationGetter('d', 'X'); |
| 2263 assertNotSuggested('_e'); | 2247 assertNotSuggested('_e'); |
| 2264 assertSuggestInvocationGetter('f', 'X'); | 2248 assertSuggestInvocationGetter('f', 'X'); |
| 2265 assertNotSuggested('_g'); | 2249 assertNotSuggested('_g'); |
| 2266 assertSuggestInvocationSetter('s1'); | 2250 assertSuggestInvocationSetter('s1'); |
| 2267 assertNotSuggested('_s2'); | 2251 assertNotSuggested('_s2'); |
| 2268 assertSuggestInvocationMethod('m', 'A', null); | 2252 assertSuggestInvocationMethod('m', 'A', null); |
| 2269 assertNotSuggested('_n'); | 2253 assertNotSuggested('_n'); |
| 2270 assertNotSuggested('a'); | 2254 assertNotSuggested('a'); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2282 class I {X get f => new A();get _g => new A();} | 2266 class I {X get f => new A();get _g => new A();} |
| 2283 class A implements I { | 2267 class A implements I { |
| 2284 static const int sc = 12; | 2268 static const int sc = 12; |
| 2285 var b; X _c; | 2269 var b; X _c; |
| 2286 X get d => new A();get _e => new A(); | 2270 X get d => new A();get _e => new A(); |
| 2287 set s1(I x) {} set _s2(I x) {} | 2271 set s1(I x) {} set _s2(I x) {} |
| 2288 m(X x) {} I _n(X x) {}} | 2272 m(X x) {} I _n(X x) {}} |
| 2289 class X{}'''); | 2273 class X{}'''); |
| 2290 computeFast(); | 2274 computeFast(); |
| 2291 return computeFull((bool result) { | 2275 return computeFull((bool result) { |
| 2292 assertSuggestInvocationGetter('sc', 'int'); | 2276 assertSuggestInvocationField('sc', 'int'); |
| 2293 assertSuggestInvocationGetter('b', null); | 2277 assertSuggestInvocationField('b', null); |
| 2294 assertSuggestInvocationGetter('_c', 'X'); | 2278 assertSuggestInvocationField('_c', 'X'); |
| 2295 assertSuggestInvocationGetter('d', 'X'); | 2279 assertSuggestInvocationGetter('d', 'X'); |
| 2296 assertSuggestInvocationGetter('_e', null); | 2280 assertSuggestInvocationGetter('_e', null); |
| 2297 assertSuggestInvocationGetter('f', 'X'); | 2281 assertSuggestInvocationGetter('f', 'X'); |
| 2298 assertSuggestInvocationGetter('_g', null); | 2282 assertSuggestInvocationGetter('_g', null); |
| 2299 assertSuggestInvocationSetter('s1'); | 2283 assertSuggestInvocationSetter('s1'); |
| 2300 assertSuggestInvocationSetter('_s2'); | 2284 assertSuggestInvocationSetter('_s2'); |
| 2301 assertSuggestInvocationMethod('m', 'A', null); | 2285 assertSuggestInvocationMethod('m', 'A', null); |
| 2302 assertSuggestInvocationMethod('_n', 'A', 'I'); | 2286 assertSuggestInvocationMethod('_n', 'A', 'I'); |
| 2303 assertNotSuggested('a'); | 2287 assertNotSuggested('a'); |
| 2304 assertNotSuggested('A'); | 2288 assertNotSuggested('A'); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2338 addSource('/testB.dart', ''' | 2322 addSource('/testB.dart', ''' |
| 2339 lib B; | 2323 lib B; |
| 2340 class _W {M y; var _z;} | 2324 class _W {M y; var _z;} |
| 2341 class X extends _W {} | 2325 class X extends _W {} |
| 2342 class M{}'''); | 2326 class M{}'''); |
| 2343 addTestSource(''' | 2327 addTestSource(''' |
| 2344 import "/testB.dart"; | 2328 import "/testB.dart"; |
| 2345 foo(X x) {x.^}'''); | 2329 foo(X x) {x.^}'''); |
| 2346 computeFast(); | 2330 computeFast(); |
| 2347 return computeFull((bool result) { | 2331 return computeFull((bool result) { |
| 2348 assertSuggestInvocationGetter('y', 'M'); | 2332 assertSuggestInvocationField('y', 'M'); |
| 2349 assertNotSuggested('_z'); | 2333 assertNotSuggested('_z'); |
| 2350 assertNotSuggested('=='); | 2334 assertNotSuggested('=='); |
| 2351 }); | 2335 }); |
| 2352 } | 2336 } |
| 2353 | 2337 |
| 2354 test_PrefixedIdentifier_prefix() { | 2338 test_PrefixedIdentifier_prefix() { |
| 2355 // SimpleIdentifier PrefixedIdentifier ExpressionStatement | 2339 // SimpleIdentifier PrefixedIdentifier ExpressionStatement |
| 2356 addSource('/testA.dart', ''' | 2340 addSource('/testA.dart', ''' |
| 2357 class A {static int bar = 10;} | 2341 class A {static int bar = 10;} |
| 2358 _B() {}'''); | 2342 _B() {}'''); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2424 A() {} | 2408 A() {} |
| 2425 A.z() {} | 2409 A.z() {} |
| 2426 var b; X _c; | 2410 var b; X _c; |
| 2427 X get d => new A();get _e => new A(); | 2411 X get d => new A();get _e => new A(); |
| 2428 // no semicolon between completion point and next statement | 2412 // no semicolon between completion point and next statement |
| 2429 set s1(I x) {} set _s2(I x) {this.^ m(null);} | 2413 set s1(I x) {} set _s2(I x) {this.^ m(null);} |
| 2430 m(X x) {} I _n(X x) {}} | 2414 m(X x) {} I _n(X x) {}} |
| 2431 class X{}'''); | 2415 class X{}'''); |
| 2432 computeFast(); | 2416 computeFast(); |
| 2433 return computeFull((bool result) { | 2417 return computeFull((bool result) { |
| 2434 assertSuggestInvocationGetter('b', null); | 2418 assertSuggestInvocationField('b', null); |
| 2435 assertSuggestInvocationGetter('_c', 'X'); | 2419 assertSuggestInvocationField('_c', 'X'); |
| 2436 assertSuggestInvocationGetter('d', 'X'); | 2420 assertSuggestInvocationGetter('d', 'X'); |
| 2437 assertSuggestInvocationGetter('_e', null); | 2421 assertSuggestInvocationGetter('_e', null); |
| 2438 assertSuggestInvocationGetter('f', 'X'); | 2422 assertSuggestInvocationGetter('f', 'X'); |
| 2439 assertSuggestInvocationGetter('_g', null); | 2423 assertSuggestInvocationGetter('_g', null); |
| 2440 assertSuggestInvocationMethod('m', 'A', null); | 2424 assertSuggestInvocationMethod('m', 'A', null); |
| 2441 assertSuggestInvocationMethod('_n', 'A', 'I'); | 2425 assertSuggestInvocationMethod('_n', 'A', 'I'); |
| 2442 assertSuggestInvocationSetter('s1'); | 2426 assertSuggestInvocationSetter('s1'); |
| 2443 assertSuggestInvocationSetter('_s2'); | 2427 assertSuggestInvocationSetter('_s2'); |
| 2444 assertNotSuggested('z'); | 2428 assertNotSuggested('z'); |
| 2445 assertNotSuggested('I'); | 2429 assertNotSuggested('I'); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 2459 A() {this.^} | 2443 A() {this.^} |
| 2460 A.z() {} | 2444 A.z() {} |
| 2461 var b; X _c; | 2445 var b; X _c; |
| 2462 X get d => new A();get _e => new A(); | 2446 X get d => new A();get _e => new A(); |
| 2463 // no semicolon between completion point and next statement | 2447 // no semicolon between completion point and next statement |
| 2464 set s1(I x) {} set _s2(I x) {m(null);} | 2448 set s1(I x) {} set _s2(I x) {m(null);} |
| 2465 m(X x) {} I _n(X x) {}} | 2449 m(X x) {} I _n(X x) {}} |
| 2466 class X{}'''); | 2450 class X{}'''); |
| 2467 computeFast(); | 2451 computeFast(); |
| 2468 return computeFull((bool result) { | 2452 return computeFull((bool result) { |
| 2469 assertSuggestInvocationGetter('b', null); | 2453 assertSuggestInvocationField('b', null); |
| 2470 assertSuggestInvocationGetter('_c', 'X'); | 2454 assertSuggestInvocationField('_c', 'X'); |
| 2471 assertSuggestInvocationGetter('d', 'X'); | 2455 assertSuggestInvocationGetter('d', 'X'); |
| 2472 assertSuggestInvocationGetter('_e', null); | 2456 assertSuggestInvocationGetter('_e', null); |
| 2473 assertSuggestInvocationGetter('f', 'X'); | 2457 assertSuggestInvocationGetter('f', 'X'); |
| 2474 assertSuggestInvocationGetter('_g', null); | 2458 assertSuggestInvocationGetter('_g', null); |
| 2475 assertSuggestInvocationMethod('m', 'A', null); | 2459 assertSuggestInvocationMethod('m', 'A', null); |
| 2476 assertSuggestInvocationMethod('_n', 'A', 'I'); | 2460 assertSuggestInvocationMethod('_n', 'A', 'I'); |
| 2477 assertSuggestInvocationSetter('s1'); | 2461 assertSuggestInvocationSetter('s1'); |
| 2478 assertSuggestInvocationSetter('_s2'); | 2462 assertSuggestInvocationSetter('_s2'); |
| 2479 assertNotSuggested('z'); | 2463 assertNotSuggested('z'); |
| 2480 assertNotSuggested('I'); | 2464 assertNotSuggested('I'); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2571 assertNotSuggested('bar2'); | 2555 assertNotSuggested('bar2'); |
| 2572 assertNotSuggested('_B'); | 2556 assertNotSuggested('_B'); |
| 2573 assertSuggestLocalClass('Y'); | 2557 assertSuggestLocalClass('Y'); |
| 2574 assertSuggestLocalClass('C'); | 2558 assertSuggestLocalClass('C'); |
| 2575 assertSuggestLocalVariable('f', null); | 2559 assertSuggestLocalVariable('f', null); |
| 2576 assertNotSuggested('x'); | 2560 assertNotSuggested('x'); |
| 2577 assertNotSuggested('e'); | 2561 assertNotSuggested('e'); |
| 2578 }); | 2562 }); |
| 2579 } | 2563 } |
| 2580 } | 2564 } |
| OLD | NEW |