Skip to content

Commit 89a5c18

Browse files
kevmoomunificent
authored andcommitted
support the latest version of pkg/analyzer (#625)
* support the latest version of pkg/analyzer * Unskip the tests that work now outside of the repo (yay!).
1 parent d6834bb commit 89a5c18

14 files changed

+56
-39
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.0.5
2+
3+
* Support the latest version of `pkg/analyzer`.
4+
15
# 1.0.4
26

37
* Ensure formatter throws an exception instead of introducing non-whitespace

bin/format.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import 'package:dart_style/src/io.dart';
1414
import 'package:dart_style/src/source_code.dart';
1515

1616
// Note: The following line of code is modified by tool/grind.dart.
17-
const version = "1.0.4";
17+
const version = "1.0.5";
1818

1919
void main(List<String> args) {
2020
var parser = new ArgParser(allowTrailingOptions: true);

lib/src/source_visitor.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,14 +1198,14 @@ class SourceVisitor extends ThrowingAstVisitor {
11981198
visitGenericTypeAlias(GenericTypeAlias node) {
11991199
visitNodes(node.metadata, between: newline, after: newline);
12001200
_simpleStatement(node, () {
1201+
token(node.typedefKeyword);
1202+
space();
1203+
12011204
// If the typedef's type parameters split, split after the "=" too,
12021205
// mainly to ensure the function's type parameters and parameters get
12031206
// end up on successive lines with the same indentation.
12041207
builder.startRule();
12051208

1206-
token(node.typedefKeyword);
1207-
space();
1208-
12091209
visit(node.name);
12101210

12111211
visit(node.typeParameters);

pubspec.lock

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ packages:
66
name: analyzer
77
url: "https://pub.dartlang.org"
88
source: hosted
9-
version: "0.29.9"
9+
version: "0.30.0"
1010
ansicolor:
1111
description:
1212
name: ansicolor
@@ -30,7 +30,7 @@ packages:
3030
name: barback
3131
url: "https://pub.dartlang.org"
3232
source: hosted
33-
version: "0.15.2+9"
33+
version: "0.15.2+11"
3434
boolean_selector:
3535
description:
3636
name: boolean_selector
@@ -60,7 +60,7 @@ packages:
6060
name: collection
6161
url: "https://pub.dartlang.org"
6262
source: hosted
63-
version: "1.13.0"
63+
version: "1.14.0"
6464
convert:
6565
description:
6666
name: convert
@@ -78,7 +78,13 @@ packages:
7878
name: csslib
7979
url: "https://pub.dartlang.org"
8080
source: hosted
81-
version: "0.13.4"
81+
version: "0.13.5"
82+
front_end:
83+
description:
84+
name: front_end
85+
url: "https://pub.dartlang.org"
86+
source: hosted
87+
version: "0.1.0-alpha.4"
8288
glob:
8389
description:
8490
name: glob
@@ -102,7 +108,7 @@ packages:
102108
name: http
103109
url: "https://pub.dartlang.org"
104110
source: hosted
105-
version: "0.11.3+12"
111+
version: "0.11.3+13"
106112
http_multi_server:
107113
description:
108114
name: http_multi_server
@@ -127,6 +133,12 @@ packages:
127133
url: "https://pub.dartlang.org"
128134
source: hosted
129135
version: "0.6.1"
136+
kernel:
137+
description:
138+
name: kernel
139+
url: "https://pub.dartlang.org"
140+
source: hosted
141+
version: "0.3.0-alpha.1"
130142
logging:
131143
description:
132144
name: logging
@@ -144,7 +156,7 @@ packages:
144156
name: meta
145157
url: "https://pub.dartlang.org"
146158
source: hosted
147-
version: "1.0.4"
159+
version: "1.0.5"
148160
mime:
149161
description:
150162
name: mime
@@ -240,7 +252,7 @@ packages:
240252
name: source_maps
241253
url: "https://pub.dartlang.org"
242254
source: hosted
243-
version: "0.10.3"
255+
version: "0.10.4"
244256
source_span:
245257
description:
246258
name: source_span
@@ -282,7 +294,7 @@ packages:
282294
name: test
283295
url: "https://pub.dartlang.org"
284296
source: hosted
285-
version: "0.12.20+3"
297+
version: "0.12.20+12"
286298
typed_data:
287299
description:
288300
name: typed_data

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
name: dart_style
22
# Note: See tool/grind.dart for how to bump the version.
3-
version: 1.0.4
3+
version: 1.0.5
44
author: Dart Team <[email protected]>
55
description: Opinionated, automatic Dart source code formatter.
66
homepage: https://github.com/dart-lang/dart_style
77
environment:
88
sdk: ">=1.8.0 <2.0.0"
99
dependencies:
10-
analyzer: '^0.29.9'
10+
analyzer: '^0.30.0'
1111
args: '>=0.12.1 <0.14.0'
1212
path: '>=1.0.0 <2.0.0'
1313
source_span: '>=1.1.1 <2.0.0'

test/regression/0600/0616.unit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
>>> (skip: published version of analyzer doesn't support function types yet)
1+
>>>
22
import "package:expect/expect.dart";
33
int Function() x = () => 42;
44
int Function(int Function()) y = (int Function() x) => x();

test/regression/0600/0619.unit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
>>> (skip: published version of analyzer doesn't support function types yet)
1+
>>>
22
typedef F<T> = void Function(T);
33
<<<
44
typedef F<T> = void Function(T);

test/splitting/members.unit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Foo {
2626
VeryLongTypeAnnotation
2727
set veryLongSetter(v) {}
2828
}
29-
>>> do not split after "covariant" in field (at least for now) (skip: published version of analyzer doesn't support 'covariant yet')
29+
>>> do not split after "covariant" in field (at least for now)
3030
class Foo {
3131
covariant var soMuchSoVeryLongFieldNameHere;
3232
covariant VeryLongTypeAnnotation field;

test/splitting/parameters.unit

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ method(int firstArgument, int argumentTwo) => "very long body that must wrap";
1414
method(int firstArgument,
1515
int argumentTwo) =>
1616
"very long body that must wrap";
17-
>>> split before "covariant" (skip: published version of analyzer doesn't support 'covariant yet')
17+
>>> split before "covariant"
1818
class A {
1919
longMethod(covariant parameterNameHere) {}
2020
}
@@ -23,7 +23,7 @@ class A {
2323
longMethod(
2424
covariant parameterNameHere) {}
2525
}
26-
>>> split before "covariant" with multiple parameters (skip: published version of analyzer doesn't support 'covariant yet')
26+
>>> split before "covariant" with multiple parameters
2727
class A {
2828
longMethod(covariant first, second, covariant int third(parameter), fourth) {}
2929
}
@@ -35,14 +35,15 @@ class A {
3535
covariant int third(parameter),
3636
fourth) {}
3737
}
38-
>>> never split after "covariant" (at least for now) (skip: published version of analyzer doesn't support 'covariant yet')
38+
>>> never split after "covariant" (at least for now)
3939
class A {
4040
longMethod(covariant int veryLongParameterNameWow) {}
4141
}
4242
<<<
4343
class A {
4444
longMethod(
45-
covariant int veryLongParameterNameWow) {}
45+
covariant int
46+
veryLongParameterNameWow) {}
4647
}
4748
>>> split between field type and name
4849
class Foo {

test/splitting/typedef.unit

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
40 columns |
2-
>>> split type parameters (skip: published version of analyzer doesn't support function types yet)
2+
>>> split type parameters
33
typedef G = T Function<TypeOne, TypeTwo, TypeThree>();
44
<<<
55
typedef G = T Function<TypeOne, TypeTwo,
66
TypeThree>();
7-
>>> split all type parameters (skip: published version of analyzer doesn't support function types yet)
7+
>>> split all type parameters
88
typedef G = T Function<TypeOne, TypeTwo, TypeThree, TypeFour, TypeFive, TypeSix>();
99
<<<
1010
typedef G = T Function<
@@ -14,17 +14,17 @@ typedef G = T Function<
1414
TypeFour,
1515
TypeFive,
1616
TypeSix>();
17-
>>> split type and value parameters (skip: published version of analyzer doesn't support function types yet)
17+
>>> split type and value parameters
1818
typedef G = T Function<TypeOne, TypeTwo, TypeThree>(TypeOne one, TypeTwo two, TypeThree three);
1919
<<<
2020
typedef G = T Function<TypeOne, TypeTwo,
2121
TypeThree>(TypeOne one,
2222
TypeTwo two, TypeThree three);
23-
>>> generic typedef parameters on one line (skip: published version of analyzer doesn't support function types yet)
23+
>>> generic typedef parameters on one line
2424
typedef Foo<T, S> = Function();
2525
<<<
2626
typedef Foo<T, S> = Function();
27-
>>> generic typedef parameters that split (skip: published version of analyzer doesn't support function types yet)
27+
>>> generic typedef parameters that split
2828
typedef LongfunctionType<First, Second, Third, Fourth, Fifth, Sixth> = Function(First first, Second second, Third third, Fourth fourth);
2929
<<<
3030
typedef LongfunctionType<First, Second,
@@ -34,7 +34,7 @@ typedef LongfunctionType<First, Second,
3434
Second second,
3535
Third third,
3636
Fourth fourth);
37-
>>> both type parameter lists split (skip: published version of analyzer doesn't support function types yet)
37+
>>> both type parameter lists split
3838
typedef LongfunctionType<First, Second, Third, Fourth, Fifth, Sixth> = Function<Seventh>(First first, Second second, Third third, Fourth fourth);
3939
<<<
4040
typedef LongfunctionType<First, Second,
@@ -44,7 +44,7 @@ typedef LongfunctionType<First, Second,
4444
Second second,
4545
Third third,
4646
Fourth fourth);
47-
>>> all three parameter lists split (skip: published version of analyzer doesn't support function types yet)
47+
>>> all three parameter lists split
4848
typedef LongfunctionType<First, Second, Third, Fourth, Fifth, Sixth> = Function<Seventh, Eighth, Ninth, Tenth, Eleventh, Twelfth, Thirteenth>(First first, Second second, Third third, Fourth fourth);
4949
<<<
5050
typedef LongfunctionType<First, Second,

test/whitespace/classes.unit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class Foo {
100100
set g(value) => null;
101101
var h = 1;
102102
}
103-
>>> covariant field (skip: published version of analyzer doesn't support 'covariant yet')
103+
>>>
104104
class Foo {
105105
covariant var bar;
106106
covariant int baz;

test/whitespace/metadata.unit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ function(
254254
@Annotation
255255
@VeryLongMetadataAnnotation
256256
covariant longParameter) {}
257-
>>> metadata on function typedef (skip: published version of analyzer doesn't support function types yet)
257+
>>> metadata on function typedef
258258
@foo typedef Fn = Function();
259259
<<<
260260
@foo

test/whitespace/methods.unit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class A {
3535
return file;
3636
}
3737
}
38-
>>> covariant (skip: published version of analyzer doesn't support 'covariant yet')
38+
>>> covariant
3939
class A {
4040
pos( covariant int a,covariant b );
4141
opt([ covariant int a,covariant b ]);
@@ -49,7 +49,7 @@ class A {
4949
named({covariant int a, covariant b});
5050
fn(covariant int f(bool b));
5151
}
52-
>>> covariant in initializing formal (not valid, but dartfmt should accept) (skip: published version of analyzer doesn't support 'covariant yet')
52+
>>> covariant in initializing formal (not valid, but dartfmt should accept)
5353
class A {
5454
A( covariant this.foo);
5555
}

test/whitespace/typedef.unit

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
typedef Foo < T ,S >(T t,S s);
44
<<<
55
typedef Foo<T, S>(T t, S s);
6-
>>> non-generic in typedef (skip: published version of analyzer doesn't support function types yet)
6+
>>> non-generic in typedef
77
typedef SomeFunc=ReturnType Function(int param, double other);
88
<<<
99
typedef SomeFunc = ReturnType Function(
1010
int param, double other);
11-
>>> generic in typedef (skip: published version of analyzer doesn't support function types yet)
11+
>>> generic in typedef
1212
typedef Generic = T Function<T>(T param, double other);
1313
<<<
1414
typedef Generic = T Function<T>(
1515
T param, double other);
16-
>>> no return type (skip: published version of analyzer doesn't support function types yet)
16+
>>> no return type
1717
typedef SomeFunc = Function();
1818
<<<
1919
typedef SomeFunc = Function();
20-
>>> nested (skip: published version of analyzer doesn't support function types yet)
20+
>>> nested
2121
typedef SomeFunc = Function(int first, Function(int first, bool second, String third) second, String third);
2222
<<<
2323
typedef SomeFunc = Function(
@@ -26,15 +26,15 @@ typedef SomeFunc = Function(
2626
String third)
2727
second,
2828
String third);
29-
>>> without param names (skip: published version of analyzer doesn't support function types yet)
29+
>>> without param names
3030
typedef F = Function(int, bool, String);
3131
<<<
3232
typedef F = Function(int, bool, String);
33-
>>> generic (skip: published version of analyzer doesn't support function types yet)
33+
>>> generic
3434
typedef Foo < A ,B>=Function ( A a, B b );
3535
<<<
3636
typedef Foo<A, B> = Function(A a, B b);
37-
>>> generic function (skip: published version of analyzer doesn't support function types yet)
37+
>>> generic function
3838
typedef Foo =Function < A ,B > ( A a,B b );
3939
<<<
4040
typedef Foo = Function<A, B>(A a, B b);

0 commit comments

Comments
 (0)