Chromium Code Reviews| 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'package:analysis_server/plugin/edit/assist/assist_core.dart'; | 7 import 'package:analysis_server/plugin/edit/assist/assist_core.dart'; |
| 8 import 'package:analysis_server/plugin/edit/assist/assist_dart.dart'; | 8 import 'package:analysis_server/plugin/edit/assist/assist_dart.dart'; |
| 9 import 'package:analysis_server/src/plugin/server_plugin.dart'; | 9 import 'package:analysis_server/src/plugin/server_plugin.dart'; |
| 10 import 'package:analysis_server/src/services/correction/assist.dart'; | 10 import 'package:analysis_server/src/services/correction/assist.dart'; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 159 class A<T> { | 159 class A<T> { |
| 160 main() { | 160 main() { |
| 161 for (var item in getValues()) { | 161 for (var item in getValues()) { |
| 162 } | 162 } |
| 163 } | 163 } |
| 164 } | 164 } |
| 165 '''); | 165 '''); |
| 166 await assertNoAssistAt('var item', DartAssistKind.ADD_TYPE_ANNOTATION); | 166 await assertNoAssistAt('var item', DartAssistKind.ADD_TYPE_ANNOTATION); |
| 167 } | 167 } |
| 168 | 168 |
| 169 @failingTest | |
| 169 test_addTypeAnnotation_BAD_privateType_list() async { | 170 test_addTypeAnnotation_BAD_privateType_list() async { |
| 171 // This is now failing because we're suggesting "List" rather than nothing. | |
| 172 // Is it really better to produce nothing? | |
|
scheglov
2017/07/01 15:31:18
"List" would also be OK.
| |
| 170 addSource( | 173 addSource( |
| 171 '/my_lib.dart', | 174 '/my_lib.dart', |
| 172 ''' | 175 ''' |
| 173 library my_lib; | 176 library my_lib; |
| 174 class A {} | 177 class A {} |
| 175 class _B extends A {} | 178 class _B extends A {} |
| 176 List<_B> getValues() => []; | 179 List<_B> getValues() => []; |
| 177 '''); | 180 '''); |
| 178 await resolveTestUnit(''' | 181 await resolveTestUnit(''' |
| 179 import 'my_lib.dart'; | 182 import 'my_lib.dart'; |
| (...skipping 4580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4760 | 4763 |
| 4761 @override | 4764 @override |
| 4762 final AstProvider astProvider; | 4765 final AstProvider astProvider; |
| 4763 | 4766 |
| 4764 @override | 4767 @override |
| 4765 final CompilationUnit unit; | 4768 final CompilationUnit unit; |
| 4766 | 4769 |
| 4767 _DartAssistContextForValues(this.source, this.selectionOffset, | 4770 _DartAssistContextForValues(this.source, this.selectionOffset, |
| 4768 this.selectionLength, this.analysisDriver, this.astProvider, this.unit); | 4771 this.selectionLength, this.analysisDriver, this.astProvider, this.unit); |
| 4769 } | 4772 } |
| OLD | NEW |