Skip to content

Commit 0261e9b

Browse files
Merge pull request #65 from Workiva/analyzer_5
Update to analyzer 5
2 parents 3e53f89 + 0a96123 commit 0261e9b

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

.github/workflows/dart_ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
sdk: [ 2.13.4, 2.18.7, stable, beta ]
17+
sdk: [ 2.18.7, 2.19.6, stable ]
1818
steps:
1919
- uses: actions/checkout@v2
2020
- uses: dart-lang/setup-dart@v1

lib/src/analyzer_helpers.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ String _copyFieldDeclaration(FieldDeclaration decl, String initializer) {
172172
if (decl.staticKeyword != null) {
173173
result = '${decl.staticKeyword} $result';
174174
}
175-
result = '$result ${decl.fields.variables.first.name.name}';
175+
result = '$result ${decl.fields.variables.first.name.lexeme}';
176176
if (initializer.isNotEmpty) {
177177
result = '$result = $initializer;';
178178
} else {
@@ -192,7 +192,7 @@ String _copyGetterDeclaration(MethodDeclaration decl, String body) {
192192
result = 'static $result';
193193
}
194194

195-
result = '$result ${decl.name.name}';
195+
result = '$result ${decl.name.lexeme}';
196196
if (decl.body.keyword != null) {
197197
result = '$result ${decl.body.keyword}${decl.body.star ?? ''}';
198198
}
@@ -205,12 +205,12 @@ String _copySetterDeclaration(MethodDeclaration decl, String body) {
205205
if (decl.isStatic) {
206206
result = 'static $result';
207207
}
208-
result = '$result ${decl.name.name}${decl.parameters} {\n$body\n }';
208+
result = '$result ${decl.name.lexeme}${decl.parameters} {\n$body\n }';
209209
return result;
210210
}
211211

212212
String _copyMethodDeclaration(MethodDeclaration decl, String body) {
213-
var result = '${decl.name.name}';
213+
var result = '${decl.name.lexeme}';
214214
if (decl.returnType != null) {
215215
result = '${decl.returnType} $result';
216216
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ environment:
77
sdk: ">=2.12.0 <3.0.0"
88

99
dependencies:
10-
analyzer: '>=2.0.0 <5.0.0'
10+
analyzer: ^5.0.0
1111
build: ^2.0.3
1212
collection: ^1.15.0
1313
path: ^1.8.0

test/test_utils.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class TestAnnotation {
3131
ConstructorDeclaration? getConstructor(ClassDeclaration classDecl,
3232
{String? name}) {
3333
for (var member in classDecl.members) {
34-
if (member is ConstructorDeclaration && member.name?.name == name) {
34+
if (member is ConstructorDeclaration && member.name?.lexeme == name) {
3535
return member;
3636
}
3737
}
@@ -41,7 +41,7 @@ ConstructorDeclaration? getConstructor(ClassDeclaration classDecl,
4141
FieldDeclaration? getFieldByName(ClassDeclaration classDecl, String name) {
4242
for (var member in classDecl.members) {
4343
if (member is FieldDeclaration &&
44-
member.fields.variables.first.name.name == name) {
44+
member.fields.variables.first.name.lexeme == name) {
4545
return member;
4646
}
4747
}
@@ -50,7 +50,7 @@ FieldDeclaration? getFieldByName(ClassDeclaration classDecl, String name) {
5050

5151
MethodDeclaration? getMethodByName(ClassDeclaration classDecl, String name) {
5252
for (var member in classDecl.members) {
53-
if (member is MethodDeclaration && member.name.name == name) {
53+
if (member is MethodDeclaration && member.name.lexeme == name) {
5454
return member;
5555
}
5656
}

0 commit comments

Comments
 (0)