diff --git a/CHANGELOG.md b/CHANGELOG.md index cf06f4c..9056603 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ +## 1.2.3 (2023-09-11) + +- Removed support for `inline class` keyword and added support for `extension type`. + ## 1.2.2 (2023-06-28) -- Added support for `inline` keyword. +- Added support for `inline class`. ## 1.2.1 (2023-05-04) diff --git a/grammars/dart.json b/grammars/dart.json index c6c1bfd..55df9d6 100644 --- a/grammars/dart.json +++ b/grammars/dart.json @@ -1,6 +1,6 @@ { "name": "Dart", - "version": "1.2.2", + "version": "1.2.3", "fileTypes": [ "dart" ], @@ -336,7 +336,7 @@ }, { "name": "keyword.declaration.dart", - "match": "(?// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash.dart +>// for details. All rights reserved. Use of this source code is governed by a +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash.dart +>// BSD-style license that can be found in the LICENSE file. +#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash.dart +> +>extension type MyInt(int it) { +#^^^^^^^^^^^^^^ keyword.declaration.dart +# ^^^^^ support.class.dart +# ^^^ support.class.dart +> void foo() { print(it.isEven); } +# ^^^^ storage.type.primitive.dart +# ^^^ entity.name.function.dart +# ^^^^^ entity.name.function.dart +# ^ punctuation.dot.dart +# ^ punctuation.terminator.dart +>} +> +>final extension = 1; +#^^^^^ storage.modifier.dart +# ^^^^^^^^^ keyword.declaration.dart +# ^ keyword.operator.assignment.dart +# ^ constant.numeric.dart +# ^ punctuation.terminator.dart +>int get extension => 1; +#^^^ support.class.dart +# ^^^ keyword.declaration.dart +# ^^^^^^^^^ keyword.declaration.dart +# ^^ keyword.operator.closure.dart +# ^ constant.numeric.dart +# ^ punctuation.terminator.dart +>set extension(int value) {} +#^^^ keyword.declaration.dart +# ^^^^^^^^^ keyword.declaration.dart +# ^^^ support.class.dart +>void extension() { +#^^^^ storage.type.primitive.dart +# ^^^^^^^^^ keyword.declaration.dart +> var extension = 1; +# ^^^ storage.type.primitive.dart +# ^^^^^^^^^ keyword.declaration.dart +# ^ keyword.operator.assignment.dart +# ^ constant.numeric.dart +# ^ punctuation.terminator.dart +>} +> +>final type = 1; +#^^^^^ storage.modifier.dart +# ^ keyword.operator.assignment.dart +# ^ constant.numeric.dart +# ^ punctuation.terminator.dart +>int get type => 1; +#^^^ support.class.dart +# ^^^ keyword.declaration.dart +# ^^ keyword.operator.closure.dart +# ^ constant.numeric.dart +# ^ punctuation.terminator.dart +>set type(int value) {} +#^^^ keyword.declaration.dart +# ^^^^ entity.name.function.dart +# ^^^ support.class.dart +>void type() { +#^^^^ storage.type.primitive.dart +# ^^^^ entity.name.function.dart +> var type = 1; +# ^^^ storage.type.primitive.dart +# ^ keyword.operator.assignment.dart +# ^ constant.numeric.dart +# ^ punctuation.terminator.dart +>} diff --git a/test/goldens/inline.dart.golden b/test/goldens/inline.dart.golden deleted file mode 100644 index a309174..0000000 --- a/test/goldens/inline.dart.golden +++ /dev/null @@ -1,53 +0,0 @@ ->// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash.dart ->// for details. All rights reserved. Use of this source code is governed by a -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash.dart ->// BSD-style license that can be found in the LICENSE file. -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash.dart -> ->inline class MyInt { -#^^^^^^^^^^^^ keyword.declaration.dart -# ^^^^^ support.class.dart -> final int it; -# ^^^^^ storage.modifier.dart -# ^^^ support.class.dart -# ^ punctuation.terminator.dart -> MyInt(this.it); -# ^^^^^ support.class.dart -# ^^^^ variable.language.dart -# ^ punctuation.dot.dart -# ^ punctuation.terminator.dart -> void foo() { print('MyInt.foo'); } -# ^^^^ storage.type.primitive.dart -# ^^^ entity.name.function.dart -# ^^^^^ entity.name.function.dart -# ^^^^^^^^^^^ string.interpolated.single.dart -# ^ punctuation.terminator.dart ->} -> ->final inline = 1; -#^^^^^ storage.modifier.dart -# ^ keyword.operator.assignment.dart -# ^ constant.numeric.dart -# ^ punctuation.terminator.dart -> ->int get inline => 1; -#^^^ support.class.dart -# ^^^ keyword.declaration.dart -# ^^ keyword.operator.closure.dart -# ^ constant.numeric.dart -# ^ punctuation.terminator.dart ->set inline(int value) {} -#^^^ keyword.declaration.dart -# ^^^^^^ entity.name.function.dart -# ^^^ support.class.dart -> ->void inline() { -#^^^^ storage.type.primitive.dart -# ^^^^^^ entity.name.function.dart -> var inline = 1; -# ^^^ storage.type.primitive.dart -# ^ keyword.operator.assignment.dart -# ^ constant.numeric.dart -# ^ punctuation.terminator.dart ->} diff --git a/test/test_files/extension_types.dart b/test/test_files/extension_types.dart new file mode 100644 index 0000000..82ba5cf --- /dev/null +++ b/test/test_files/extension_types.dart @@ -0,0 +1,21 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +extension type MyInt(int it) { + void foo() { print(it.isEven); } +} + +final extension = 1; +int get extension => 1; +set extension(int value) {} +void extension() { + var extension = 1; +} + +final type = 1; +int get type => 1; +set type(int value) {} +void type() { + var type = 1; +} diff --git a/test/test_files/inline.dart b/test/test_files/inline.dart deleted file mode 100644 index e128ceb..0000000 --- a/test/test_files/inline.dart +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -inline class MyInt { - final int it; - MyInt(this.it); - void foo() { print('MyInt.foo'); } -} - -final inline = 1; - -int get inline => 1; -set inline(int value) {} - -void inline() { - var inline = 1; -}