Index: pkg/analysis_server/test/services/correction/assist_test.dart |
diff --git a/pkg/analysis_server/test/services/correction/assist_test.dart b/pkg/analysis_server/test/services/correction/assist_test.dart |
index bdcdda72b56b5a656c9d1550ea0dbf3d1d8ad8f3..7cab51e58bde4d09f1a21e9a0988eaedd29722e3 100644 |
--- a/pkg/analysis_server/test/services/correction/assist_test.dart |
+++ b/pkg/analysis_server/test/services/correction/assist_test.dart |
@@ -128,9 +128,7 @@ class AssistProcessorTest extends AbstractSingleUnitTest { |
} |
test_addTypeAnnotation_BAD_privateType_closureParameter() async { |
- addSource( |
- '/my_lib.dart', |
- ''' |
+ addSource('/my_lib.dart', ''' |
library my_lib; |
class A {} |
class _B extends A {} |
@@ -146,9 +144,7 @@ main() { |
} |
test_addTypeAnnotation_BAD_privateType_declaredIdentifier() async { |
- addSource( |
- '/my_lib.dart', |
- ''' |
+ addSource('/my_lib.dart', ''' |
library my_lib; |
class A {} |
class _B extends A {} |
@@ -169,9 +165,7 @@ class A<T> { |
test_addTypeAnnotation_BAD_privateType_list() async { |
// This is now failing because we're suggesting "List" rather than nothing. |
// Is it really better to produce nothing? |
- addSource( |
- '/my_lib.dart', |
- ''' |
+ addSource('/my_lib.dart', ''' |
library my_lib; |
class A {} |
class _B extends A {} |
@@ -183,10 +177,7 @@ main() { |
var v = getValues(); |
} |
'''); |
- await assertHasAssistAt( |
- 'var ', |
- DartAssistKind.ADD_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('var ', DartAssistKind.ADD_TYPE_ANNOTATION, ''' |
import 'my_lib.dart'; |
main() { |
List v = getValues(); |
@@ -195,9 +186,7 @@ main() { |
} |
test_addTypeAnnotation_BAD_privateType_variable() async { |
- addSource( |
- '/my_lib.dart', |
- ''' |
+ addSource('/my_lib.dart', ''' |
library my_lib; |
class A {} |
class _B extends A {} |
@@ -218,10 +207,7 @@ class A { |
final f = 0; |
} |
'''); |
- await assertHasAssistAt( |
- 'final ', |
- DartAssistKind.ADD_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('final ', DartAssistKind.ADD_TYPE_ANNOTATION, ''' |
class A { |
final int f = 0; |
} |
@@ -235,9 +221,7 @@ class A { |
} |
'''); |
await await assertHasAssistAt( |
- 'var ', |
- DartAssistKind.ADD_TYPE_ANNOTATION, |
- ''' |
+ 'var ', DartAssistKind.ADD_TYPE_ANNOTATION, ''' |
class A { |
int f = 0; |
} |
@@ -285,10 +269,7 @@ class A<T> { |
} |
} |
'''); |
- await assertHasAssistAt( |
- 'item in', |
- DartAssistKind.ADD_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('item in', DartAssistKind.ADD_TYPE_ANNOTATION, ''' |
class A<T> { |
main(List<List<T>> items) { |
for (List<T> item in items) { |
@@ -306,20 +287,14 @@ main(List<String> items) { |
} |
'''); |
// on identifier |
- await assertHasAssistAt( |
- 'item in', |
- DartAssistKind.ADD_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('item in', DartAssistKind.ADD_TYPE_ANNOTATION, ''' |
main(List<String> items) { |
for (String item in items) { |
} |
} |
'''); |
// on "for" |
- await assertHasAssistAt( |
- 'for (', |
- DartAssistKind.ADD_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('for (', DartAssistKind.ADD_TYPE_ANNOTATION, ''' |
main(List<String> items) { |
for (String item in items) { |
} |
@@ -328,9 +303,7 @@ main(List<String> items) { |
} |
test_addTypeAnnotation_declaredIdentifier_OK_addImport_dartUri() async { |
- addSource( |
- '/my_lib.dart', |
- r''' |
+ addSource('/my_lib.dart', r''' |
import 'dart:async'; |
List<Future<int>> getFutures() => null; |
'''); |
@@ -341,10 +314,7 @@ main() { |
} |
} |
'''); |
- await assertHasAssistAt( |
- 'future in', |
- DartAssistKind.ADD_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('future in', DartAssistKind.ADD_TYPE_ANNOTATION, ''' |
import 'dart:async'; |
import 'my_lib.dart'; |
@@ -362,10 +332,7 @@ main(List<String> items) { |
} |
} |
'''); |
- await assertHasAssistAt( |
- 'item in', |
- DartAssistKind.ADD_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('item in', DartAssistKind.ADD_TYPE_ANNOTATION, ''' |
main(List<String> items) { |
for (final String item in items) { |
} |
@@ -446,10 +413,7 @@ class A { |
} |
} |
'''); |
- await assertHasAssistAt( |
- 'v =', |
- DartAssistKind.ADD_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('v =', DartAssistKind.ADD_TYPE_ANNOTATION, ''' |
class A { |
main(List<int> items) { |
List<int> v = items; |
@@ -466,10 +430,7 @@ class A<T> { |
} |
} |
'''); |
- await assertHasAssistAt( |
- 'v =', |
- DartAssistKind.ADD_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('v =', DartAssistKind.ADD_TYPE_ANNOTATION, ''' |
class A<T> { |
main(List<T> items) { |
List<T> v = items; |
@@ -479,9 +440,7 @@ class A<T> { |
} |
test_addTypeAnnotation_local_OK_addImport_dartUri() async { |
- addSource( |
- '/my_lib.dart', |
- r''' |
+ addSource('/my_lib.dart', r''' |
import 'dart:async'; |
Future<int> getFutureInt() => null; |
'''); |
@@ -491,10 +450,7 @@ main() { |
var v = getFutureInt(); |
} |
'''); |
- await assertHasAssistAt( |
- 'v =', |
- DartAssistKind.ADD_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('v =', DartAssistKind.ADD_TYPE_ANNOTATION, ''' |
import 'dart:async'; |
import 'my_lib.dart'; |
@@ -506,9 +462,7 @@ main() { |
test_addTypeAnnotation_local_OK_addImport_notLibraryUnit() async { |
// prepare library |
- addSource( |
- '/my_lib.dart', |
- r''' |
+ addSource('/my_lib.dart', r''' |
import 'dart:async'; |
Future<int> getFutureInt() => null; |
'''); |
@@ -537,9 +491,7 @@ main() { |
{ |
var testFileEdit = change.getFileEdit('/app.dart'); |
var resultCode = SourceEdit.applySequence(appCode, testFileEdit.edits); |
- expect( |
- resultCode, |
- ''' |
+ expect(resultCode, ''' |
library my_app; |
import 'dart:async'; |
@@ -550,9 +502,7 @@ part 'test.dart'; |
{ |
var testFileEdit = change.getFileEdit('/test.dart'); |
var resultCode = SourceEdit.applySequence(testCode, testFileEdit.edits); |
- expect( |
- resultCode, |
- ''' |
+ expect(resultCode, ''' |
part of my_app; |
main() { |
Future<int> v = getFutureInt(); |
@@ -562,14 +512,10 @@ main() { |
} |
test_addTypeAnnotation_local_OK_addImport_relUri() async { |
- addSource( |
- '/aa/bbb/lib_a.dart', |
- r''' |
+ addSource('/aa/bbb/lib_a.dart', r''' |
class MyClass {} |
'''); |
- addSource( |
- '/ccc/lib_b.dart', |
- r''' |
+ addSource('/ccc/lib_b.dart', r''' |
import '../aa/bbb/lib_a.dart'; |
MyClass newMyClass() => null; |
'''); |
@@ -579,10 +525,7 @@ main() { |
var v = newMyClass(); |
} |
'''); |
- await assertHasAssistAt( |
- 'v =', |
- DartAssistKind.ADD_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('v =', DartAssistKind.ADD_TYPE_ANNOTATION, ''' |
import 'aa/bbb/lib_a.dart'; |
import 'ccc/lib_b.dart'; |
main() { |
@@ -597,10 +540,7 @@ main() { |
var v = () => 1; |
} |
'''); |
- await assertHasAssistAt( |
- 'v =', |
- DartAssistKind.ADD_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('v =', DartAssistKind.ADD_TYPE_ANNOTATION, ''' |
main() { |
Function v = () => 1; |
} |
@@ -613,10 +553,7 @@ main() { |
var v = 0; |
} |
'''); |
- await assertHasAssistAt( |
- 'v =', |
- DartAssistKind.ADD_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('v =', DartAssistKind.ADD_TYPE_ANNOTATION, ''' |
main() { |
int v = 0; |
} |
@@ -629,10 +566,7 @@ main() { |
var v = <String>[]; |
} |
'''); |
- await assertHasAssistAt( |
- 'v =', |
- DartAssistKind.ADD_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('v =', DartAssistKind.ADD_TYPE_ANNOTATION, ''' |
main() { |
List<String> v = <String>[]; |
} |
@@ -647,10 +581,7 @@ main() { |
var x = f(); |
} |
'''); |
- await assertHasAssistAt( |
- 'x =', |
- DartAssistKind.ADD_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('x =', DartAssistKind.ADD_TYPE_ANNOTATION, ''' |
class C {} |
C f() => null; |
main() { |
@@ -665,10 +596,7 @@ main() { |
var abc = 0; |
} |
'''); |
- await assertHasAssistAt( |
- 'bc', |
- DartAssistKind.ADD_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('bc', DartAssistKind.ADD_TYPE_ANNOTATION, ''' |
main() { |
int abc = 0; |
} |
@@ -681,10 +609,7 @@ main() { |
var v = 0; |
} |
'''); |
- await assertHasAssistAt( |
- 'var ', |
- DartAssistKind.ADD_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('var ', DartAssistKind.ADD_TYPE_ANNOTATION, ''' |
main() { |
int v = 0; |
} |
@@ -699,10 +624,7 @@ main() { |
var v = getValue(); |
} |
'''); |
- await assertHasAssistAt( |
- 'var ', |
- DartAssistKind.ADD_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('var ', DartAssistKind.ADD_TYPE_ANNOTATION, ''' |
class _A {} |
_A getValue() => new _A(); |
main() { |
@@ -738,10 +660,7 @@ main() { |
foo((test) {}); |
} |
'''); |
- await assertHasAssistAt( |
- 'test', |
- DartAssistKind.ADD_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('test', DartAssistKind.ADD_TYPE_ANNOTATION, ''' |
foo(f(int p)) {} |
main() { |
foo((int test) {}); |
@@ -767,10 +686,7 @@ var V; |
await resolveTestUnit(''' |
var V = 0; |
'''); |
- await assertHasAssistAt( |
- 'var ', |
- DartAssistKind.ADD_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('var ', DartAssistKind.ADD_TYPE_ANNOTATION, ''' |
int V = 0; |
'''); |
} |
@@ -784,9 +700,7 @@ main() { |
List<int> readBytes() => <int>[]; |
'''); |
await assertHasAssistAt( |
- 'readBytes();', |
- DartAssistKind.ASSIGN_TO_LOCAL_VARIABLE, |
- ''' |
+ 'readBytes();', DartAssistKind.ASSIGN_TO_LOCAL_VARIABLE, ''' |
main() { |
List<int> bytes; |
var readBytes = readBytes(); |
@@ -818,10 +732,7 @@ main() { |
}); |
} |
'''); |
- await assertHasAssistAt( |
- '345', |
- DartAssistKind.ASSIGN_TO_LOCAL_VARIABLE, |
- ''' |
+ await assertHasAssistAt('345', DartAssistKind.ASSIGN_TO_LOCAL_VARIABLE, ''' |
main() { |
print(() { |
var i = 12345; |
@@ -890,9 +801,7 @@ class A { |
} |
'''); |
await assertHasAssistAt( |
- 'AAAAA', |
- DartAssistKind.CONVERT_DOCUMENTATION_INTO_BLOCK, |
- ''' |
+ 'AAAAA', DartAssistKind.CONVERT_DOCUMENTATION_INTO_BLOCK, ''' |
class A { |
/** |
* AAAAA |
@@ -911,9 +820,7 @@ class A { |
class A {} |
'''); |
await assertHasAssistAt( |
- 'nt]', |
- DartAssistKind.CONVERT_DOCUMENTATION_INTO_BLOCK, |
- ''' |
+ 'nt]', DartAssistKind.CONVERT_DOCUMENTATION_INTO_BLOCK, ''' |
/** |
* AAAAAAA [int] AAAAAAA |
*/ |
@@ -931,9 +838,7 @@ class A { |
} |
'''); |
await assertHasAssistAt( |
- 'AAA [', |
- DartAssistKind.CONVERT_DOCUMENTATION_INTO_BLOCK, |
- ''' |
+ 'AAA [', DartAssistKind.CONVERT_DOCUMENTATION_INTO_BLOCK, ''' |
class A { |
/** |
* AAAAAAA [int] AAAAAAA |
@@ -971,9 +876,7 @@ class A {} |
class A {} |
'''); |
await assertHasAssistAt( |
- 'nt]', |
- DartAssistKind.CONVERT_DOCUMENTATION_INTO_LINE, |
- ''' |
+ 'nt]', DartAssistKind.CONVERT_DOCUMENTATION_INTO_LINE, ''' |
/// AAAAAAA [int] AAAAAAA |
class A {} |
'''); |
@@ -991,9 +894,7 @@ class A { |
} |
'''); |
await assertHasAssistAt( |
- 'AAA [', |
- DartAssistKind.CONVERT_DOCUMENTATION_INTO_LINE, |
- ''' |
+ 'AAA [', DartAssistKind.CONVERT_DOCUMENTATION_INTO_LINE, ''' |
class A { |
/// AAAAAAA [int] AAAAAAA |
/// BBBBBBBB BBBB BBBB |
@@ -1014,9 +915,7 @@ class A { |
} |
'''); |
await assertHasAssistAt( |
- 'AAA [', |
- DartAssistKind.CONVERT_DOCUMENTATION_INTO_LINE, |
- ''' |
+ 'AAA [', DartAssistKind.CONVERT_DOCUMENTATION_INTO_LINE, ''' |
class A { |
/// AAAAAAA [int] AAAAAAA |
/// BBBBBBBB BBBB BBBB |
@@ -1047,9 +946,7 @@ build() { |
} |
'''); |
_setCaretLocation(); |
- await assertHasAssist( |
- DartAssistKind.CONVERT_FLUTTER_CHILD, |
- ''' |
+ await assertHasAssist(DartAssistKind.CONVERT_FLUTTER_CHILD, ''' |
import 'package:flutter/src/widgets/framework.dart'; |
build() { |
return new Scaffold( |
@@ -1092,9 +989,7 @@ build() { |
} |
'''); |
_setCaretLocation(); |
- await assertHasAssist( |
- DartAssistKind.CONVERT_FLUTTER_CHILD, |
- ''' |
+ await assertHasAssist(DartAssistKind.CONVERT_FLUTTER_CHILD, ''' |
import 'package:flutter/src/widgets/framework.dart'; |
build() { |
return new Scaffold( |
@@ -1132,9 +1027,7 @@ build() { |
} |
'''); |
_setCaretLocation(); |
- await assertHasAssist( |
- DartAssistKind.CONVERT_FLUTTER_CHILD, |
- ''' |
+ await assertHasAssist(DartAssistKind.CONVERT_FLUTTER_CHILD, ''' |
import 'package:flutter/src/widgets/framework.dart'; |
build() { |
return new Scaffold( |
@@ -1171,10 +1064,7 @@ class A { |
mmm() async => 123; |
} |
'''); |
- await assertHasAssistAt( |
- 'mmm()', |
- DartAssistKind.CONVERT_INTO_BLOCK_BODY, |
- ''' |
+ await assertHasAssistAt('mmm()', DartAssistKind.CONVERT_INTO_BLOCK_BODY, ''' |
class A { |
mmm() async { |
return 123; |
@@ -1191,9 +1081,7 @@ main() { |
} |
'''); |
await assertHasAssistAt( |
- '() => 42', |
- DartAssistKind.CONVERT_INTO_BLOCK_BODY, |
- ''' |
+ '() => 42', DartAssistKind.CONVERT_INTO_BLOCK_BODY, ''' |
setup(x) {} |
main() { |
setup(() { |
@@ -1217,9 +1105,7 @@ main() { |
} |
'''); |
await assertHasAssistAt( |
- '() => print', |
- DartAssistKind.CONVERT_INTO_BLOCK_BODY, |
- ''' |
+ '() => print', DartAssistKind.CONVERT_INTO_BLOCK_BODY, ''' |
setup(x) {} |
main() { |
setup(() { |
@@ -1241,10 +1127,7 @@ class A { |
factory A() => null; |
} |
'''); |
- await assertHasAssistAt( |
- 'A()', |
- DartAssistKind.CONVERT_INTO_BLOCK_BODY, |
- ''' |
+ await assertHasAssistAt('A()', DartAssistKind.CONVERT_INTO_BLOCK_BODY, ''' |
class A { |
factory A() { |
return null; |
@@ -1259,10 +1142,7 @@ class A { |
mmm() => 123; |
} |
'''); |
- await assertHasAssistAt( |
- 'mmm()', |
- DartAssistKind.CONVERT_INTO_BLOCK_BODY, |
- ''' |
+ await assertHasAssistAt('mmm()', DartAssistKind.CONVERT_INTO_BLOCK_BODY, ''' |
class A { |
mmm() { |
return 123; |
@@ -1275,10 +1155,7 @@ class A { |
await resolveTestUnit(''' |
fff() => 123; |
'''); |
- await assertHasAssistAt( |
- 'fff()', |
- DartAssistKind.CONVERT_INTO_BLOCK_BODY, |
- ''' |
+ await assertHasAssistAt('fff()', DartAssistKind.CONVERT_INTO_BLOCK_BODY, ''' |
fff() { |
return 123; |
} |
@@ -1289,10 +1166,7 @@ fff() { |
await resolveTestUnit(''' |
fff() => 123; |
'''); |
- await assertHasAssistAt( |
- '23;', |
- DartAssistKind.CONVERT_INTO_BLOCK_BODY, |
- ''' |
+ await assertHasAssistAt('23;', DartAssistKind.CONVERT_INTO_BLOCK_BODY, ''' |
fff() { |
return 123; |
} |
@@ -1354,9 +1228,7 @@ class A { |
} |
'''); |
await assertHasAssistAt( |
- 'mmm', |
- DartAssistKind.CONVERT_INTO_EXPRESSION_BODY, |
- ''' |
+ 'mmm', DartAssistKind.CONVERT_INTO_EXPRESSION_BODY, ''' |
class A { |
mmm() async => 42; |
} |
@@ -1373,9 +1245,7 @@ main() { |
} |
'''); |
await assertHasAssistAt( |
- '42;', |
- DartAssistKind.CONVERT_INTO_EXPRESSION_BODY, |
- ''' |
+ '42;', DartAssistKind.CONVERT_INTO_EXPRESSION_BODY, ''' |
setup(x) {} |
main() { |
setup(() => 42); |
@@ -1393,9 +1263,7 @@ main() { |
} |
'''); |
await assertHasAssistAt( |
- 'print(', |
- DartAssistKind.CONVERT_INTO_EXPRESSION_BODY, |
- ''' |
+ 'print(', DartAssistKind.CONVERT_INTO_EXPRESSION_BODY, ''' |
setup(x) {} |
main() { |
setup(() => print('test')); |
@@ -1412,9 +1280,7 @@ class A { |
} |
'''); |
await assertHasAssistAt( |
- 'A()', |
- DartAssistKind.CONVERT_INTO_EXPRESSION_BODY, |
- ''' |
+ 'A()', DartAssistKind.CONVERT_INTO_EXPRESSION_BODY, ''' |
class A { |
factory A() => null; |
} |
@@ -1428,9 +1294,7 @@ fff() { |
} |
'''); |
await assertHasAssistAt( |
- '{', |
- DartAssistKind.CONVERT_INTO_EXPRESSION_BODY, |
- ''' |
+ '{', DartAssistKind.CONVERT_INTO_EXPRESSION_BODY, ''' |
fff() => 42; |
'''); |
} |
@@ -1442,9 +1306,7 @@ fff() { |
} |
'''); |
await assertHasAssistAt( |
- 'ff()', |
- DartAssistKind.CONVERT_INTO_EXPRESSION_BODY, |
- ''' |
+ 'ff()', DartAssistKind.CONVERT_INTO_EXPRESSION_BODY, ''' |
fff() => 42; |
'''); |
} |
@@ -1458,9 +1320,7 @@ class A { |
} |
'''); |
await assertHasAssistAt( |
- '{ // marker', |
- DartAssistKind.CONVERT_INTO_EXPRESSION_BODY, |
- ''' |
+ '{ // marker', DartAssistKind.CONVERT_INTO_EXPRESSION_BODY, ''' |
class A { |
m() => 42; |
} |
@@ -1474,9 +1334,7 @@ fff() { |
} |
'''); |
await assertHasAssistAt( |
- 'return', |
- DartAssistKind.CONVERT_INTO_EXPRESSION_BODY, |
- ''' |
+ 'return', DartAssistKind.CONVERT_INTO_EXPRESSION_BODY, ''' |
fff() => 42; |
'''); |
} |
@@ -1511,9 +1369,7 @@ class A { |
} |
'''); |
await assertHasAssistAt( |
- 'aaa, ', |
- DartAssistKind.CONVERT_TO_FIELD_PARAMETER, |
- ''' |
+ 'aaa, ', DartAssistKind.CONVERT_TO_FIELD_PARAMETER, ''' |
class A { |
int aaa2; |
int bbb2; |
@@ -1531,9 +1387,7 @@ class A { |
} |
'''); |
await assertHasAssistAt( |
- 'test {', |
- DartAssistKind.CONVERT_TO_FIELD_PARAMETER, |
- ''' |
+ 'test {', DartAssistKind.CONVERT_TO_FIELD_PARAMETER, ''' |
class A { |
int test2; |
A(this.test2) { |
@@ -1551,9 +1405,7 @@ class A { |
} |
'''); |
await assertHasAssistAt( |
- 'test)', |
- DartAssistKind.CONVERT_TO_FIELD_PARAMETER, |
- ''' |
+ 'test)', DartAssistKind.CONVERT_TO_FIELD_PARAMETER, ''' |
class A { |
int test; |
A(this.test) { |
@@ -1571,9 +1423,7 @@ class A { |
} |
'''); |
await assertHasAssistAt( |
- 'bbb)', |
- DartAssistKind.CONVERT_TO_FIELD_PARAMETER, |
- ''' |
+ 'bbb)', DartAssistKind.CONVERT_TO_FIELD_PARAMETER, ''' |
class A { |
int aaa2; |
int bbb2; |
@@ -1622,9 +1472,7 @@ class A { |
} |
'''); |
await assertHasAssistAt( |
- 'get foo', |
- DartAssistKind.CONVERT_INTO_FINAL_FIELD, |
- ''' |
+ 'get foo', DartAssistKind.CONVERT_INTO_FINAL_FIELD, ''' |
class A { |
final int foo = 1 + 2; |
} |
@@ -1640,9 +1488,7 @@ class A { |
} |
'''); |
await assertHasAssistAt( |
- 'get foo', |
- DartAssistKind.CONVERT_INTO_FINAL_FIELD, |
- ''' |
+ 'get foo', DartAssistKind.CONVERT_INTO_FINAL_FIELD, ''' |
const myAnnotation = const Object(); |
class A { |
@myAnnotation |
@@ -1661,9 +1507,7 @@ class B extends A { |
} |
'''); |
await assertHasAssistAt( |
- 'get foo', |
- DartAssistKind.CONVERT_INTO_FINAL_FIELD, |
- ''' |
+ 'get foo', DartAssistKind.CONVERT_INTO_FINAL_FIELD, ''' |
class A { |
void set foo(_) {} |
} |
@@ -1680,9 +1524,7 @@ class A { |
} |
'''); |
await assertHasAssistAt( |
- 'get foo', |
- DartAssistKind.CONVERT_INTO_FINAL_FIELD, |
- ''' |
+ 'get foo', DartAssistKind.CONVERT_INTO_FINAL_FIELD, ''' |
class A { |
final int foo = 1 + 2; |
} |
@@ -1696,9 +1538,7 @@ class A { |
} |
'''); |
await assertHasAssistAt( |
- 'get foo', |
- DartAssistKind.CONVERT_INTO_FINAL_FIELD, |
- ''' |
+ 'get foo', DartAssistKind.CONVERT_INTO_FINAL_FIELD, ''' |
class A { |
final int foo; |
} |
@@ -1711,10 +1551,7 @@ class A { |
int get foo => 42; |
} |
'''); |
- await assertHasAssistAt( |
- 'foo', |
- DartAssistKind.CONVERT_INTO_FINAL_FIELD, |
- ''' |
+ await assertHasAssistAt('foo', DartAssistKind.CONVERT_INTO_FINAL_FIELD, ''' |
class A { |
final int foo = 42; |
} |
@@ -1728,9 +1565,7 @@ class A { |
} |
'''); |
await assertHasAssistAt( |
- 'nt> get', |
- DartAssistKind.CONVERT_INTO_FINAL_FIELD, |
- ''' |
+ 'nt> get', DartAssistKind.CONVERT_INTO_FINAL_FIELD, ''' |
class A { |
final List<int> foo; |
} |
@@ -1744,9 +1579,7 @@ class A { |
} |
'''); |
await assertHasAssistAt( |
- 'int get', |
- DartAssistKind.CONVERT_INTO_FINAL_FIELD, |
- ''' |
+ 'int get', DartAssistKind.CONVERT_INTO_FINAL_FIELD, ''' |
class A { |
final int foo = 42; |
} |
@@ -1821,9 +1654,7 @@ main(List<String> items) { |
} |
'''); |
await assertHasAssistAt( |
- 'item in', |
- DartAssistKind.CONVERT_INTO_FOR_INDEX, |
- ''' |
+ 'item in', DartAssistKind.CONVERT_INTO_FOR_INDEX, ''' |
main(List<String> items) { |
for (int i = 0; i < items.length; i++) { |
String item = items[i]; |
@@ -1842,9 +1673,7 @@ main(List<String> items) { |
} |
'''); |
await assertHasAssistAt( |
- 'tring item', |
- DartAssistKind.CONVERT_INTO_FOR_INDEX, |
- ''' |
+ 'tring item', DartAssistKind.CONVERT_INTO_FOR_INDEX, ''' |
main(List<String> items) { |
for (int i = 0; i < items.length; i++) { |
String item = items[i]; |
@@ -1863,9 +1692,7 @@ main(List<String> items) { |
} |
'''); |
await assertHasAssistAt( |
- 'for (String', |
- DartAssistKind.CONVERT_INTO_FOR_INDEX, |
- ''' |
+ 'for (String', DartAssistKind.CONVERT_INTO_FOR_INDEX, ''' |
main(List<String> items) { |
for (int i = 0; i < items.length; i++) { |
String item = items[i]; |
@@ -1884,9 +1711,7 @@ main(List<String> items) { |
} |
'''); |
await assertHasAssistAt( |
- 'for (String', |
- DartAssistKind.CONVERT_INTO_FOR_INDEX, |
- ''' |
+ 'for (String', DartAssistKind.CONVERT_INTO_FOR_INDEX, ''' |
main(List<String> items) { |
for (int j = 0; j < items.length; j++) { |
String item = items[j]; |
@@ -1906,9 +1731,7 @@ main(List<String> items) { |
} |
'''); |
await assertHasAssistAt( |
- 'for (String', |
- DartAssistKind.CONVERT_INTO_FOR_INDEX, |
- ''' |
+ 'for (String', DartAssistKind.CONVERT_INTO_FOR_INDEX, ''' |
main(List<String> items) { |
for (int k = 0; k < items.length; k++) { |
String item = items[k]; |
@@ -1955,10 +1778,7 @@ class A { |
final int foo = 1 + 2; |
} |
'''); |
- await assertHasAssistAt( |
- 'foo =', |
- DartAssistKind.CONVERT_INTO_GETTER, |
- ''' |
+ await assertHasAssistAt('foo =', DartAssistKind.CONVERT_INTO_GETTER, ''' |
const myAnnotation = const Object(); |
class A { |
@myAnnotation |
@@ -1973,10 +1793,7 @@ class A { |
final foo = 42; |
} |
'''); |
- await assertHasAssistAt( |
- 'foo =', |
- DartAssistKind.CONVERT_INTO_GETTER, |
- ''' |
+ await assertHasAssistAt('foo =', DartAssistKind.CONVERT_INTO_GETTER, ''' |
class A { |
get foo => 42; |
} |
@@ -2072,10 +1889,7 @@ main(p) { |
!(p is String); |
} |
'''); |
- await assertHasAssistAt( |
- 'p is', |
- DartAssistKind.CONVERT_INTO_IS_NOT, |
- ''' |
+ await assertHasAssistAt('p is', DartAssistKind.CONVERT_INTO_IS_NOT, ''' |
main(p) { |
p is! String; |
} |
@@ -2088,10 +1902,7 @@ main(p) { |
!(p is String); |
} |
'''); |
- await assertHasAssistAt( |
- 'String)', |
- DartAssistKind.CONVERT_INTO_IS_NOT, |
- ''' |
+ await assertHasAssistAt('String)', DartAssistKind.CONVERT_INTO_IS_NOT, ''' |
main(p) { |
p is! String; |
} |
@@ -2104,10 +1915,7 @@ main(p) { |
!(p is String); |
} |
'''); |
- await assertHasAssistAt( |
- 'is String', |
- DartAssistKind.CONVERT_INTO_IS_NOT, |
- ''' |
+ await assertHasAssistAt('is String', DartAssistKind.CONVERT_INTO_IS_NOT, ''' |
main(p) { |
p is! String; |
} |
@@ -2120,10 +1928,7 @@ main(p) { |
!!(p is String); |
} |
'''); |
- await assertHasAssistAt( |
- 'is String', |
- DartAssistKind.CONVERT_INTO_IS_NOT, |
- ''' |
+ await assertHasAssistAt('is String', DartAssistKind.CONVERT_INTO_IS_NOT, ''' |
main(p) { |
!(p is! String); |
} |
@@ -2136,10 +1941,7 @@ main(p) { |
!!(p is String); |
} |
'''); |
- await assertHasAssistAt( |
- '!(p', |
- DartAssistKind.CONVERT_INTO_IS_NOT, |
- ''' |
+ await assertHasAssistAt('!(p', DartAssistKind.CONVERT_INTO_IS_NOT, ''' |
main(p) { |
!(p is! String); |
} |
@@ -2152,10 +1954,7 @@ main(p) { |
!(p is String); |
} |
'''); |
- await assertHasAssistAt( |
- '!(p', |
- DartAssistKind.CONVERT_INTO_IS_NOT, |
- ''' |
+ await assertHasAssistAt('!(p', DartAssistKind.CONVERT_INTO_IS_NOT, ''' |
main(p) { |
p is! String; |
} |
@@ -2168,10 +1967,7 @@ main(p) { |
!(p is String); |
} |
'''); |
- await assertHasAssistAt( |
- '(p is', |
- DartAssistKind.CONVERT_INTO_IS_NOT, |
- ''' |
+ await assertHasAssistAt('(p is', DartAssistKind.CONVERT_INTO_IS_NOT, ''' |
main(p) { |
p is! String; |
} |
@@ -2228,9 +2024,7 @@ main(String str) { |
} |
'''); |
await assertHasAssistAt( |
- 'isEmpty', |
- DartAssistKind.CONVERT_INTO_IS_NOT_EMPTY, |
- ''' |
+ 'isEmpty', DartAssistKind.CONVERT_INTO_IS_NOT_EMPTY, ''' |
main(String str) { |
str.isNotEmpty; |
} |
@@ -2244,9 +2038,7 @@ main(String str) { |
} |
'''); |
await assertHasAssistAt( |
- 'str.', |
- DartAssistKind.CONVERT_INTO_IS_NOT_EMPTY, |
- ''' |
+ 'str.', DartAssistKind.CONVERT_INTO_IS_NOT_EMPTY, ''' |
main(String str) { |
str.isNotEmpty; |
} |
@@ -2260,9 +2052,7 @@ main(String str) { |
} |
'''); |
await assertHasAssistAt( |
- 'isEmpty', |
- DartAssistKind.CONVERT_INTO_IS_NOT_EMPTY, |
- ''' |
+ 'isEmpty', DartAssistKind.CONVERT_INTO_IS_NOT_EMPTY, ''' |
main(String str) { |
'text'.isNotEmpty; |
} |
@@ -2278,9 +2068,7 @@ class A { |
} |
'''); |
await assertHasAssistAt( |
- 'test)', |
- DartAssistKind.CONVERT_TO_NORMAL_PARAMETER, |
- ''' |
+ 'test)', DartAssistKind.CONVERT_TO_NORMAL_PARAMETER, ''' |
class A { |
var test; |
A(test) : test = test { |
@@ -2298,9 +2086,7 @@ class A { |
} |
'''); |
await assertHasAssistAt( |
- 'test)', |
- DartAssistKind.CONVERT_TO_NORMAL_PARAMETER, |
- ''' |
+ 'test)', DartAssistKind.CONVERT_TO_NORMAL_PARAMETER, ''' |
class A { |
int test; |
A(int test) : test = test { |
@@ -2318,9 +2104,7 @@ class A { |
} |
'''); |
await assertHasAssistAt( |
- 'bbb)', |
- DartAssistKind.CONVERT_TO_NORMAL_PARAMETER, |
- ''' |
+ 'bbb)', DartAssistKind.CONVERT_TO_NORMAL_PARAMETER, ''' |
class A { |
double aaa; |
int bbb; |
@@ -2403,10 +2187,7 @@ main(A a) { |
print(a.test); |
} |
'''); |
- await assertHasAssistAt( |
- 'test = 42', |
- DartAssistKind.ENCAPSULATE_FIELD, |
- ''' |
+ await assertHasAssistAt('test = 42', DartAssistKind.ENCAPSULATE_FIELD, ''' |
class A { |
int _test = 42; |
@@ -2432,10 +2213,7 @@ main(A a) { |
print(a.test); |
} |
'''); |
- await assertHasAssistAt( |
- 'test = 42', |
- DartAssistKind.ENCAPSULATE_FIELD, |
- ''' |
+ await assertHasAssistAt('test = 42', DartAssistKind.ENCAPSULATE_FIELD, ''' |
class A { |
var _test = 42; |
@@ -2493,9 +2271,7 @@ bool main(int a, int b) { |
} |
'''); |
await assertHasAssistAt( |
- initialOperator, |
- DartAssistKind.EXCHANGE_OPERANDS, |
- ''' |
+ initialOperator, DartAssistKind.EXCHANGE_OPERANDS, ''' |
bool main(int a, int b) { |
return b $resultOperator a; |
} |
@@ -2509,10 +2285,7 @@ main() { |
1 * 2 * 3 + 4; |
} |
'''); |
- await assertHasAssistAt( |
- '* 2', |
- DartAssistKind.EXCHANGE_OPERANDS, |
- ''' |
+ await assertHasAssistAt('* 2', DartAssistKind.EXCHANGE_OPERANDS, ''' |
main() { |
2 * 3 * 1 + 4; |
} |
@@ -2525,10 +2298,7 @@ main() { |
1 + 2 - 3 + 4; |
} |
'''); |
- await assertHasAssistAt( |
- '+ 2', |
- DartAssistKind.EXCHANGE_OPERANDS, |
- ''' |
+ await assertHasAssistAt('+ 2', DartAssistKind.EXCHANGE_OPERANDS, ''' |
main() { |
2 + 1 - 3 + 4; |
} |
@@ -2541,10 +2311,7 @@ main() { |
1 + 2 + 3; |
} |
'''); |
- await assertHasAssistAt( |
- '+ 2', |
- DartAssistKind.EXCHANGE_OPERANDS, |
- ''' |
+ await assertHasAssistAt('+ 2', DartAssistKind.EXCHANGE_OPERANDS, ''' |
main() { |
2 + 3 + 1; |
} |
@@ -2557,10 +2324,7 @@ main() { |
1 + 2 + 3; |
} |
'''); |
- await assertHasAssistAt( |
- '+ 3', |
- DartAssistKind.EXCHANGE_OPERANDS, |
- ''' |
+ await assertHasAssistAt('+ 3', DartAssistKind.EXCHANGE_OPERANDS, ''' |
main() { |
3 + 1 + 2; |
} |
@@ -2573,10 +2337,7 @@ main() { |
1 + 2; |
} |
'''); |
- await assertHasAssistAt( |
- ' 2', |
- DartAssistKind.EXCHANGE_OPERANDS, |
- ''' |
+ await assertHasAssistAt(' 2', DartAssistKind.EXCHANGE_OPERANDS, ''' |
main() { |
2 + 1; |
} |
@@ -2589,10 +2350,7 @@ main() { |
1 + 2; |
} |
'''); |
- await assertHasAssistAt( |
- '+ 2', |
- DartAssistKind.EXCHANGE_OPERANDS, |
- ''' |
+ await assertHasAssistAt('+ 2', DartAssistKind.EXCHANGE_OPERANDS, ''' |
main() { |
2 + 1; |
} |
@@ -2606,10 +2364,7 @@ main() { |
} |
'''); |
length = '1 + 2'.length; |
- await assertHasAssistAt( |
- '1 + 2', |
- DartAssistKind.EXCHANGE_OPERANDS, |
- ''' |
+ await assertHasAssistAt('1 + 2', DartAssistKind.EXCHANGE_OPERANDS, ''' |
main() { |
2 + 1; |
} |
@@ -2623,10 +2378,7 @@ main() { |
} |
'''); |
length = 2; |
- await assertHasAssistAt( |
- '+ 2', |
- DartAssistKind.EXCHANGE_OPERANDS, |
- ''' |
+ await assertHasAssistAt('+ 2', DartAssistKind.EXCHANGE_OPERANDS, ''' |
main() { |
2 + 1; |
} |
@@ -2666,10 +2418,7 @@ main(x) { |
return x.foo(); |
} |
'''); |
- await assertHasAssistAt( |
- 'import ', |
- DartAssistKind.IMPORT_ADD_SHOW, |
- ''' |
+ await assertHasAssistAt('import ', DartAssistKind.IMPORT_ADD_SHOW, ''' |
import 'dart:math' show PI; |
main(x) { |
PI; |
@@ -2687,10 +2436,7 @@ main() { |
max(1, 2); |
} |
'''); |
- await assertHasAssistAt( |
- 'import ', |
- DartAssistKind.IMPORT_ADD_SHOW, |
- ''' |
+ await assertHasAssistAt('import ', DartAssistKind.IMPORT_ADD_SHOW, ''' |
import 'dart:math' show E, PI, max; |
main() { |
PI; |
@@ -2709,10 +2455,7 @@ main() { |
max(1, 2); |
} |
'''); |
- await assertHasAssistAt( |
- 'art:math', |
- DartAssistKind.IMPORT_ADD_SHOW, |
- ''' |
+ await assertHasAssistAt('art:math', DartAssistKind.IMPORT_ADD_SHOW, ''' |
import 'dart:math' show E, PI, max; |
main() { |
PI; |
@@ -2851,10 +2594,7 @@ main() { |
} |
} |
'''); |
- await assertHasAssistAt( |
- 'if (', |
- DartAssistKind.INVERT_IF_STATEMENT, |
- ''' |
+ await assertHasAssistAt('if (', DartAssistKind.INVERT_IF_STATEMENT, ''' |
main() { |
if (false) { |
1; |
@@ -2874,10 +2614,7 @@ main() { |
1; |
} |
'''); |
- await assertHasAssistAt( |
- 'if (', |
- DartAssistKind.INVERT_IF_STATEMENT, |
- ''' |
+ await assertHasAssistAt('if (', DartAssistKind.INVERT_IF_STATEMENT, ''' |
main() { |
if (false) |
1; |
@@ -2975,10 +2712,7 @@ main() { |
} |
} |
'''); |
- await assertHasAssistAt( |
- 'if (1 ==', |
- DartAssistKind.JOIN_IF_WITH_INNER, |
- ''' |
+ await assertHasAssistAt('if (1 ==', DartAssistKind.JOIN_IF_WITH_INNER, ''' |
main() { |
if (1 == 1 && (2 == 2 || 3 == 3)) { |
print(0); |
@@ -2999,9 +2733,7 @@ main() { |
bool isCheck() => false; |
'''); |
await assertHasAssistAt( |
- 'if (isCheck', |
- DartAssistKind.JOIN_IF_WITH_INNER, |
- ''' |
+ 'if (isCheck', DartAssistKind.JOIN_IF_WITH_INNER, ''' |
main() { |
if (isCheck() && 2 == 2) { |
print(0); |
@@ -3021,10 +2753,7 @@ main() { |
} |
} |
'''); |
- await assertHasAssistAt( |
- 'if (1 ==', |
- DartAssistKind.JOIN_IF_WITH_INNER, |
- ''' |
+ await assertHasAssistAt('if (1 ==', DartAssistKind.JOIN_IF_WITH_INNER, ''' |
main() { |
if ((1 == 1 || 2 == 2) && 3 == 3) { |
print(0); |
@@ -3043,10 +2772,7 @@ main() { |
} |
} |
'''); |
- await assertHasAssistAt( |
- '1 ==', |
- DartAssistKind.JOIN_IF_WITH_INNER, |
- ''' |
+ await assertHasAssistAt('1 ==', DartAssistKind.JOIN_IF_WITH_INNER, ''' |
main() { |
if (1 == 1 && 2 == 2) { |
print(0); |
@@ -3065,10 +2791,7 @@ main() { |
} |
} |
'''); |
- await assertHasAssistAt( |
- 'if (1 ==', |
- DartAssistKind.JOIN_IF_WITH_INNER, |
- ''' |
+ await assertHasAssistAt('if (1 ==', DartAssistKind.JOIN_IF_WITH_INNER, ''' |
main() { |
if (1 == 1 && 2 == 2) { |
print(0); |
@@ -3086,10 +2809,7 @@ main() { |
} |
} |
'''); |
- await assertHasAssistAt( |
- 'if (1 ==', |
- DartAssistKind.JOIN_IF_WITH_INNER, |
- ''' |
+ await assertHasAssistAt('if (1 ==', DartAssistKind.JOIN_IF_WITH_INNER, ''' |
main() { |
if (1 == 1 && 2 == 2) { |
print(0); |
@@ -3110,10 +2830,7 @@ main() { |
} |
} |
'''); |
- await assertHasAssistAt( |
- 'if (1 ==', |
- DartAssistKind.JOIN_IF_WITH_INNER, |
- ''' |
+ await assertHasAssistAt('if (1 ==', DartAssistKind.JOIN_IF_WITH_INNER, ''' |
main() { |
if (1 == 1 && 2 == 2) { |
print(1); |
@@ -3133,10 +2850,7 @@ main() { |
} |
} |
'''); |
- await assertHasAssistAt( |
- 'if (1 ==', |
- DartAssistKind.JOIN_IF_WITH_INNER, |
- ''' |
+ await assertHasAssistAt('if (1 ==', DartAssistKind.JOIN_IF_WITH_INNER, ''' |
main() { |
if (1 == 1 && 2 == 2) { |
print(0); |
@@ -3233,10 +2947,7 @@ main() { |
} |
} |
'''); |
- await assertHasAssistAt( |
- 'if (2 ==', |
- DartAssistKind.JOIN_IF_WITH_OUTER, |
- ''' |
+ await assertHasAssistAt('if (2 ==', DartAssistKind.JOIN_IF_WITH_OUTER, ''' |
main() { |
if (1 == 1 && (2 == 2 || 3 == 3)) { |
print(0); |
@@ -3257,9 +2968,7 @@ main() { |
bool isCheck() => false; |
'''); |
await assertHasAssistAt( |
- 'if (isCheck', |
- DartAssistKind.JOIN_IF_WITH_OUTER, |
- ''' |
+ 'if (isCheck', DartAssistKind.JOIN_IF_WITH_OUTER, ''' |
main() { |
if (1 == 1 && isCheck()) { |
print(0); |
@@ -3279,10 +2988,7 @@ main() { |
} |
} |
'''); |
- await assertHasAssistAt( |
- 'if (3 == 3', |
- DartAssistKind.JOIN_IF_WITH_OUTER, |
- ''' |
+ await assertHasAssistAt('if (3 == 3', DartAssistKind.JOIN_IF_WITH_OUTER, ''' |
main() { |
if ((1 == 1 || 2 == 2) && 3 == 3) { |
print(0); |
@@ -3301,10 +3007,7 @@ main() { |
} |
} |
'''); |
- await assertHasAssistAt( |
- 'if (2 == 2', |
- DartAssistKind.JOIN_IF_WITH_OUTER, |
- ''' |
+ await assertHasAssistAt('if (2 == 2', DartAssistKind.JOIN_IF_WITH_OUTER, ''' |
main() { |
if (1 == 1 && 2 == 2) { |
print(0); |
@@ -3323,10 +3026,7 @@ main() { |
} |
} |
'''); |
- await assertHasAssistAt( |
- 'if (2 == 2', |
- DartAssistKind.JOIN_IF_WITH_OUTER, |
- ''' |
+ await assertHasAssistAt('if (2 == 2', DartAssistKind.JOIN_IF_WITH_OUTER, ''' |
main() { |
if (1 == 1 && 2 == 2) { |
print(0); |
@@ -3344,10 +3044,7 @@ main() { |
} |
} |
'''); |
- await assertHasAssistAt( |
- 'if (2 == 2', |
- DartAssistKind.JOIN_IF_WITH_OUTER, |
- ''' |
+ await assertHasAssistAt('if (2 == 2', DartAssistKind.JOIN_IF_WITH_OUTER, ''' |
main() { |
if (1 == 1 && 2 == 2) { |
print(0); |
@@ -3368,10 +3065,7 @@ main() { |
} |
} |
'''); |
- await assertHasAssistAt( |
- 'if (2 == 2', |
- DartAssistKind.JOIN_IF_WITH_OUTER, |
- ''' |
+ await assertHasAssistAt('if (2 == 2', DartAssistKind.JOIN_IF_WITH_OUTER, ''' |
main() { |
if (1 == 1 && 2 == 2) { |
print(1); |
@@ -3391,10 +3085,7 @@ main() { |
} |
} |
'''); |
- await assertHasAssistAt( |
- 'if (2 == 2', |
- DartAssistKind.JOIN_IF_WITH_OUTER, |
- ''' |
+ await assertHasAssistAt('if (2 == 2', DartAssistKind.JOIN_IF_WITH_OUTER, ''' |
main() { |
if (1 == 1 && 2 == 2) { |
print(0); |
@@ -3494,10 +3185,7 @@ main() { |
v = 1; |
} |
'''); |
- await assertHasAssistAt( |
- 'v =', |
- DartAssistKind.JOIN_VARIABLE_DECLARATION, |
- ''' |
+ await assertHasAssistAt('v =', DartAssistKind.JOIN_VARIABLE_DECLARATION, ''' |
main() { |
var v = 1; |
} |
@@ -3571,10 +3259,7 @@ main() { |
v = 1; |
} |
'''); |
- await assertHasAssistAt( |
- 'v;', |
- DartAssistKind.JOIN_VARIABLE_DECLARATION, |
- ''' |
+ await assertHasAssistAt('v;', DartAssistKind.JOIN_VARIABLE_DECLARATION, ''' |
main() { |
var v = 1; |
} |
@@ -3589,9 +3274,7 @@ main() { |
} |
'''); |
await assertHasAssistAt( |
- 'int v', |
- DartAssistKind.JOIN_VARIABLE_DECLARATION, |
- ''' |
+ 'int v', DartAssistKind.JOIN_VARIABLE_DECLARATION, ''' |
main() { |
int v = 1; |
} |
@@ -3606,9 +3289,7 @@ main() { |
} |
'''); |
await assertHasAssistAt( |
- 'var v', |
- DartAssistKind.JOIN_VARIABLE_DECLARATION, |
- ''' |
+ 'var v', DartAssistKind.JOIN_VARIABLE_DECLARATION, ''' |
main() { |
var v = 1; |
} |
@@ -3640,9 +3321,7 @@ build() { |
startResize() {} |
'''); |
_setCaretLocation(); |
- await assertHasAssist( |
- DartAssistKind.MOVE_FLUTTER_WIDGET_DOWN, |
- ''' |
+ await assertHasAssist(DartAssistKind.MOVE_FLUTTER_WIDGET_DOWN, ''' |
import 'package:flutter/src/widgets/framework.dart'; |
build() { |
return new Scaffold( |
@@ -3689,9 +3368,7 @@ build() { |
startResize() {} |
'''); |
_setCaretLocation(); |
- await assertHasAssist( |
- DartAssistKind.MOVE_FLUTTER_WIDGET_UP, |
- ''' |
+ await assertHasAssist(DartAssistKind.MOVE_FLUTTER_WIDGET_UP, ''' |
import 'package:flutter/src/widgets/framework.dart'; |
build() { |
return new Scaffold( |
@@ -3719,10 +3396,7 @@ class A { |
int v = 1; |
} |
'''); |
- await assertHasAssistAt( |
- 'v = ', |
- DartAssistKind.REMOVE_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('v = ', DartAssistKind.REMOVE_TYPE_ANNOTATION, ''' |
class A { |
var v = 1; |
} |
@@ -3735,10 +3409,7 @@ class A { |
final int v = 1; |
} |
'''); |
- await assertHasAssistAt( |
- 'v = ', |
- DartAssistKind.REMOVE_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('v = ', DartAssistKind.REMOVE_TYPE_ANNOTATION, ''' |
class A { |
final v = 1; |
} |
@@ -3760,10 +3431,7 @@ main() { |
int a = 1, b = 2; |
} |
'''); |
- await assertHasAssistAt( |
- 'int ', |
- DartAssistKind.REMOVE_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('int ', DartAssistKind.REMOVE_TYPE_ANNOTATION, ''' |
main() { |
var a = 1, b = 2; |
} |
@@ -3776,10 +3444,7 @@ main() { |
const int v = 1; |
} |
'''); |
- await assertHasAssistAt( |
- 'int ', |
- DartAssistKind.REMOVE_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('int ', DartAssistKind.REMOVE_TYPE_ANNOTATION, ''' |
main() { |
const v = 1; |
} |
@@ -3792,10 +3457,7 @@ main() { |
final int v = 1; |
} |
'''); |
- await assertHasAssistAt( |
- 'int ', |
- DartAssistKind.REMOVE_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('int ', DartAssistKind.REMOVE_TYPE_ANNOTATION, ''' |
main() { |
final v = 1; |
} |
@@ -3814,10 +3476,7 @@ MyType |
await resolveTestUnit(''' |
int V = 1; |
'''); |
- await assertHasAssistAt( |
- 'int ', |
- DartAssistKind.REMOVE_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('int ', DartAssistKind.REMOVE_TYPE_ANNOTATION, ''' |
var V = 1; |
'''); |
} |
@@ -3826,10 +3485,7 @@ var V = 1; |
await resolveTestUnit(''' |
final int V = 1; |
'''); |
- await assertHasAssistAt( |
- 'int ', |
- DartAssistKind.REMOVE_TYPE_ANNOTATION, |
- ''' |
+ await assertHasAssistAt('int ', DartAssistKind.REMOVE_TYPE_ANNOTATION, ''' |
final V = 1; |
'''); |
} |
@@ -3899,9 +3555,7 @@ build() { |
} |
'''); |
_setCaretLocation(); |
- await assertHasAssist( |
- DartAssistKind.REPARENT_FLUTTER_LIST, |
- ''' |
+ await assertHasAssist(DartAssistKind.REPARENT_FLUTTER_LIST, ''' |
import 'package:flutter/src/widgets/framework.dart'; |
build() { |
return new Container( |
@@ -3977,9 +3631,7 @@ class FakeFlutter { |
} |
'''); |
_setCaretLocation(); |
- await assertHasAssist( |
- DartAssistKind.REPARENT_FLUTTER_WIDGET, |
- ''' |
+ await assertHasAssist(DartAssistKind.REPARENT_FLUTTER_WIDGET, ''' |
import 'package:flutter/src/widgets/framework.dart'; |
class FakeFlutter { |
main() { |
@@ -4026,9 +3678,7 @@ class FakeFlutter {\r |
}\r |
'''); |
_setCaretLocation(); |
- await assertHasAssist( |
- DartAssistKind.REPARENT_FLUTTER_WIDGET, |
- ''' |
+ await assertHasAssist(DartAssistKind.REPARENT_FLUTTER_WIDGET, ''' |
import 'package:flutter/src/widgets/framework.dart';\r |
class FakeFlutter {\r |
main() {\r |
@@ -4066,9 +3716,7 @@ class FakeFlutter { |
} |
'''); |
_setCaretLocation(); |
- await assertHasAssist( |
- DartAssistKind.REPARENT_FLUTTER_WIDGET, |
- ''' |
+ await assertHasAssist(DartAssistKind.REPARENT_FLUTTER_WIDGET, ''' |
import 'package:flutter/src/widgets/framework.dart'; |
class FakeFlutter { |
main() { |
@@ -4095,9 +3743,7 @@ class FakeFlutter { |
} |
'''); |
_setCaretLocation(); |
- await assertHasAssist( |
- DartAssistKind.REPARENT_FLUTTER_WIDGET, |
- ''' |
+ await assertHasAssist(DartAssistKind.REPARENT_FLUTTER_WIDGET, ''' |
import 'package:flutter/src/widgets/framework.dart'; |
class FakeFlutter { |
main() { |
@@ -4136,9 +3782,7 @@ main() { |
'''); |
// on conditional |
await assertHasAssistAt( |
- '11 :', |
- DartAssistKind.REPLACE_CONDITIONAL_WITH_IF_ELSE, |
- ''' |
+ '11 :', DartAssistKind.REPLACE_CONDITIONAL_WITH_IF_ELSE, ''' |
main() { |
var v; |
if (true) { |
@@ -4150,9 +3794,7 @@ main() { |
'''); |
// on variable |
await assertHasAssistAt( |
- 'v =', |
- DartAssistKind.REPLACE_CONDITIONAL_WITH_IF_ELSE, |
- ''' |
+ 'v =', DartAssistKind.REPLACE_CONDITIONAL_WITH_IF_ELSE, ''' |
main() { |
var v; |
if (true) { |
@@ -4171,9 +3813,7 @@ main() { |
} |
'''); |
await assertHasAssistAt( |
- 'return ', |
- DartAssistKind.REPLACE_CONDITIONAL_WITH_IF_ELSE, |
- ''' |
+ 'return ', DartAssistKind.REPLACE_CONDITIONAL_WITH_IF_ELSE, ''' |
main() { |
if (true) { |
return 111; |
@@ -4191,9 +3831,7 @@ main() { |
} |
'''); |
await assertHasAssistAt( |
- '11 :', |
- DartAssistKind.REPLACE_CONDITIONAL_WITH_IF_ELSE, |
- ''' |
+ '11 :', DartAssistKind.REPLACE_CONDITIONAL_WITH_IF_ELSE, ''' |
main() { |
int a = 1, vvv, b = 2; |
if (true) { |
@@ -4258,9 +3896,7 @@ main() { |
} |
'''); |
await assertHasAssistAt( |
- 'if (true)', |
- DartAssistKind.REPLACE_IF_ELSE_WITH_CONDITIONAL, |
- ''' |
+ 'if (true)', DartAssistKind.REPLACE_IF_ELSE_WITH_CONDITIONAL, ''' |
main() { |
int vvv; |
vvv = true ? 111 : 222; |
@@ -4279,9 +3915,7 @@ main() { |
} |
'''); |
await assertHasAssistAt( |
- 'if (true)', |
- DartAssistKind.REPLACE_IF_ELSE_WITH_CONDITIONAL, |
- ''' |
+ 'if (true)', DartAssistKind.REPLACE_IF_ELSE_WITH_CONDITIONAL, ''' |
main() { |
return true ? 111 : 222; |
} |
@@ -4344,10 +3978,7 @@ main() { |
} |
} |
'''); |
- await assertHasAssistAt( |
- '&& 2 == 2', |
- DartAssistKind.SPLIT_AND_CONDITION, |
- ''' |
+ await assertHasAssistAt('&& 2 == 2', DartAssistKind.SPLIT_AND_CONDITION, ''' |
main() { |
if (1 == 1) { |
if (2 == 2 && 3 == 3) { |
@@ -4369,10 +4000,7 @@ main() { |
} |
} |
'''); |
- await assertHasAssistAt( |
- '&& false', |
- DartAssistKind.SPLIT_AND_CONDITION, |
- ''' |
+ await assertHasAssistAt('&& false', DartAssistKind.SPLIT_AND_CONDITION, ''' |
main() { |
if (true) { |
if (false) { |
@@ -4393,10 +4021,7 @@ main() { |
print(0); |
} |
'''); |
- await assertHasAssistAt( |
- '&& false', |
- DartAssistKind.SPLIT_AND_CONDITION, |
- ''' |
+ await assertHasAssistAt('&& false', DartAssistKind.SPLIT_AND_CONDITION, ''' |
main() { |
if (true) |
if (false) |
@@ -4439,9 +4064,7 @@ main() { |
} |
'''); |
await assertHasAssistAt( |
- 'v =', |
- DartAssistKind.SPLIT_VARIABLE_DECLARATION, |
- ''' |
+ 'v =', DartAssistKind.SPLIT_VARIABLE_DECLARATION, ''' |
main() { |
var v; |
v = 1; |
@@ -4456,9 +4079,7 @@ main() { |
} |
'''); |
await assertHasAssistAt( |
- 'int ', |
- DartAssistKind.SPLIT_VARIABLE_DECLARATION, |
- ''' |
+ 'int ', DartAssistKind.SPLIT_VARIABLE_DECLARATION, ''' |
main() { |
int v; |
v = 1; |
@@ -4473,9 +4094,7 @@ main() { |
} |
'''); |
await assertHasAssistAt( |
- 'var ', |
- DartAssistKind.SPLIT_VARIABLE_DECLARATION, |
- ''' |
+ 'var ', DartAssistKind.SPLIT_VARIABLE_DECLARATION, ''' |
main() { |
var v; |
v = 1; |
@@ -4493,9 +4112,7 @@ main() { |
} |
'''); |
_setStartEndSelection(); |
- await assertHasAssist( |
- DartAssistKind.SURROUND_WITH_BLOCK, |
- ''' |
+ await assertHasAssist(DartAssistKind.SURROUND_WITH_BLOCK, ''' |
main() { |
// start |
{ |
@@ -4517,9 +4134,7 @@ main() { |
} |
'''); |
_setStartEndSelection(); |
- await assertHasAssist( |
- DartAssistKind.SURROUND_WITH_DO_WHILE, |
- ''' |
+ await assertHasAssist(DartAssistKind.SURROUND_WITH_DO_WHILE, ''' |
main() { |
// start |
do { |
@@ -4541,9 +4156,7 @@ main() { |
} |
'''); |
_setStartEndSelection(); |
- await assertHasAssist( |
- DartAssistKind.SURROUND_WITH_FOR, |
- ''' |
+ await assertHasAssist(DartAssistKind.SURROUND_WITH_FOR, ''' |
main() { |
// start |
for (var v = init; condition; increment) { |
@@ -4565,9 +4178,7 @@ main() { |
} |
'''); |
_setStartEndSelection(); |
- await assertHasAssist( |
- DartAssistKind.SURROUND_WITH_FOR_IN, |
- ''' |
+ await assertHasAssist(DartAssistKind.SURROUND_WITH_FOR_IN, ''' |
main() { |
// start |
for (var item in iterable) { |
@@ -4589,9 +4200,7 @@ main() { |
} |
'''); |
_setStartEndSelection(); |
- await assertHasAssist( |
- DartAssistKind.SURROUND_WITH_IF, |
- ''' |
+ await assertHasAssist(DartAssistKind.SURROUND_WITH_IF, ''' |
main() { |
// start |
if (condition) { |
@@ -4613,9 +4222,7 @@ main() { |
} |
'''); |
_setStartEndSelection(); |
- await assertHasAssist( |
- DartAssistKind.SURROUND_WITH_TRY_CATCH, |
- ''' |
+ await assertHasAssist(DartAssistKind.SURROUND_WITH_TRY_CATCH, ''' |
main() { |
// start |
try { |
@@ -4639,9 +4246,7 @@ main() { |
} |
'''); |
_setStartEndSelection(); |
- await assertHasAssist( |
- DartAssistKind.SURROUND_WITH_TRY_FINALLY, |
- ''' |
+ await assertHasAssist(DartAssistKind.SURROUND_WITH_TRY_FINALLY, ''' |
main() { |
// start |
try { |
@@ -4665,9 +4270,7 @@ main() { |
} |
'''); |
_setStartEndSelection(); |
- await assertHasAssist( |
- DartAssistKind.SURROUND_WITH_WHILE, |
- ''' |
+ await assertHasAssist(DartAssistKind.SURROUND_WITH_WHILE, ''' |
main() { |
// start |
while (condition) { |