Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions grammars/dart.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Dart",
"version": "1.2.1",
"version": "1.2.2",
"fileTypes": [
"dart"
],
Expand Down Expand Up @@ -336,7 +336,7 @@
},
{
"name": "keyword.declaration.dart",
"match": "(?<!\\$)\\b(abstract|sealed|base|interface|class|enum|extends|extension|external|factory|implements|get(?!\\()|mixin|native|operator|set(?!\\()|typedef|with|covariant)\\b(?!\\$)"
"match": "(?<!\\$)\\b(abstract|sealed|base|interface|inline class|class|enum|extends|extension|external|factory|implements|get(?!\\()|mixin|native|operator|set(?!\\()|typedef|with|covariant)\\b(?!\\$)"
},
{
"name": "storage.modifier.dart",
Expand Down
53 changes: 53 additions & 0 deletions test/goldens/inline.dart.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
>// 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
>}
18 changes: 18 additions & 0 deletions test/test_files/inline.dart
Original file line number Diff line number Diff line change
@@ -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;
}