diff --git a/CHANGELOG.md b/CHANGELOG.md index 55c9330..cf06f4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.2.2 (2023-06-28) + +- Added support for `inline` keyword. + ## 1.2.1 (2023-05-04) - Fixed highlighting of comments inside type arguments. diff --git a/grammars/dart.json b/grammars/dart.json index 91448e5..c6c1bfd 100644 --- a/grammars/dart.json +++ b/grammars/dart.json @@ -1,6 +1,6 @@ { "name": "Dart", - "version": "1.2.1", + "version": "1.2.2", "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 +> +>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/inline.dart b/test/test_files/inline.dart new file mode 100644 index 0000000..e128ceb --- /dev/null +++ b/test/test_files/inline.dart @@ -0,0 +1,18 @@ +// 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; +}