mirror of
https://github.com/dart-lang/sdk
synced 2024-10-03 19:32:47 +00:00
Add fix-all in file fixes for the 2 additional dart analysis server fix types: USE_NOT_EQ_NULL and USE_EQ_EQ_NULL
Change-Id: Ic8da1d1737145dbd3ddbf5939c327f882a74be24 Reviewed-on: https://dart-review.googlesource.com/57680 Reviewed-by: Jaime Wren <jwren@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Jaime Wren <jwren@google.com>
This commit is contained in:
parent
eb82559db2
commit
7e899d04ab
|
@ -250,12 +250,16 @@ class DartFixKind {
|
|||
'USE_EFFECTIVE_INTEGER_DIVISION',
|
||||
50,
|
||||
"Use effective integer division ~/");
|
||||
static const USE_EQ_EQ_NULL =
|
||||
const FixKind('USE_EQ_EQ_NULL', 50, "Use == null instead of 'is Null'");
|
||||
static const USE_EQ_EQ_NULL = const FixKind(
|
||||
'USE_EQ_EQ_NULL', 50, "Use == null instead of 'is Null'",
|
||||
appliedTogetherMessage:
|
||||
"Use == null instead of 'is Null' everywhere in file");
|
||||
static const USE_IS_NOT_EMPTY = const FixKind(
|
||||
'USE_NOT_EMPTY', 50, "Use x.isNotEmpty instead of '!x.isEmpty'");
|
||||
static const USE_NOT_EQ_NULL =
|
||||
const FixKind('USE_NOT_EQ_NULL', 50, "Use != null instead of 'is! Null'");
|
||||
static const USE_NOT_EQ_NULL = const FixKind(
|
||||
'USE_NOT_EQ_NULL', 50, "Use != null instead of 'is! Null'",
|
||||
appliedTogetherMessage:
|
||||
"Use != null instead of 'is! Null' everywhere in file");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -5136,6 +5136,22 @@ main(p) {
|
|||
''');
|
||||
}
|
||||
|
||||
test_isNotNull_all() async {
|
||||
await resolveTestUnit('''
|
||||
main(p, q) {
|
||||
p is! Null;
|
||||
q is! Null;
|
||||
}
|
||||
''');
|
||||
await assertHasFixAllFix(
|
||||
HintCode.TYPE_CHECK_IS_NOT_NULL, DartFixKind.USE_NOT_EQ_NULL, '''
|
||||
main(p, q) {
|
||||
p != null;
|
||||
q != null;
|
||||
}
|
||||
''');
|
||||
}
|
||||
|
||||
test_isNull() async {
|
||||
await resolveTestUnit('''
|
||||
main(p) {
|
||||
|
@ -5149,6 +5165,22 @@ main(p) {
|
|||
''');
|
||||
}
|
||||
|
||||
test_isNull_all() async {
|
||||
await resolveTestUnit('''
|
||||
main(p, q) {
|
||||
p is Null;
|
||||
q is Null;
|
||||
}
|
||||
''');
|
||||
await assertHasFixAllFix(
|
||||
HintCode.TYPE_CHECK_IS_NULL, DartFixKind.USE_EQ_EQ_NULL, '''
|
||||
main(p, q) {
|
||||
p == null;
|
||||
q == null;
|
||||
}
|
||||
''');
|
||||
}
|
||||
|
||||
test_makeEnclosingClassAbstract_declaresAbstractMethod() async {
|
||||
await resolveTestUnit('''
|
||||
class A {
|
||||
|
|
Loading…
Reference in a new issue