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
56 changes: 31 additions & 25 deletions packages/devtools_app/assets/dart_syntax.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Dart",
"version": "1.0.1",
"version": "1.1.1",
"fileTypes": [
"dart"
],
Expand Down Expand Up @@ -60,6 +60,9 @@
{
"include": "#constants-and-special-vars"
},
{
"include": "#operators"
},
{
"include": "#strings"
}
Expand Down Expand Up @@ -234,27 +237,26 @@
"class-identifier": {
"patterns": [
{
"name": "storage.type.primitive.dart",
"match": "\\bvoid\\b"
"match": "(?<!\\$)\\b(bool|num|int|double|dynamic)\\b(?!\\$)",
"name": "support.class.dart"
},
{
"name": "support.class.dart",
"match": "\\b(bool|num|int|double|dynamic)\\b"
"match": "(?<!\\$)\\bvoid\\b(?!\\$)",
"name": "storage.type.primitive.dart"
},
{
"match": "\\b([_$]*[A-Z][a-zA-Z0-9_$]*)(<(?:[a-zA-Z0-9_$<>?]|,\\s*|\\s+extends\\s+)+>)?",
"captures": {
"begin": "(?<![a-zA-Z0-9_$])([_$]*[A-Z][a-zA-Z0-9_$]*)\\b",
"end": "(?!<)",
"beginCaptures": {
"1": {
"name": "support.class.dart"
},
"2": {
"patterns": [
{
"include": "#type-args"
}
]
}
}
},
"patterns": [
{
"include": "#type-args"
}
]
}
]
},
Expand Down Expand Up @@ -295,7 +297,7 @@
"include": "#class-identifier"
},
{
"match": "[\\s,]+"
"match": ","
},
{
"name": "keyword.declaration.dart",
Expand Down Expand Up @@ -331,8 +333,20 @@
},
{
"name": "keyword.declaration.dart",
"match": "(?<!\\$)\\b(abstract|class|enum|extends|extension|external|factory|implements|get|mixin|native|operator|set|typedef|with|covariant)\\b(?!\\$)"
"match": "(?<!\\$)\\b(abstract|class|enum|extends|extension|external|factory|implements|get(?!\\()|mixin|native|operator|set(?!\\()|typedef|with|covariant)\\b(?!\\$)"
},
{
"name": "storage.modifier.dart",
"match": "(?<!\\$)\\b(static|final|const|required|late)\\b(?!\\$)"
},
{
"name": "storage.type.primitive.dart",
"match": "(?<!\\$)\\b(?:void|var)\\b(?!\\$)"
}
]
},
"operators": {
"patterns": [
{
"name": "keyword.operator.dart",
"match": "(?<!\\$)\\b(is\\!?)\\b(?!\\$)"
Expand Down Expand Up @@ -376,14 +390,6 @@
{
"name": "keyword.operator.logical.dart",
"match": "(!|&&|\\|\\|)"
},
{
"name": "storage.modifier.dart",
"match": "(?<!\\$)\\b(static|final|const|required|late)\\b(?!\\$)"
},
{
"name": "storage.type.primitive.dart",
"match": "(?<!\\$)\\b(?:void|var)\\b(?!\\$)"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
>// Copyright 2022 The Chromium Authors. All rights reserved.
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash.dart
>// Use of this source code is governed by a BSD-style license that can be
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash.dart
>// found in the LICENSE file.
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash.dart
>
>class A {
#^^^^^ keyword.declaration.dart
# ^ support.class.dart
> String get name => '';
# ^^^^^^ support.class.dart
# ^^^ keyword.declaration.dart
# ^^^^ entity.name.function.dart
# ^^ string.interpolated.single.dart
# ^ punctuation.terminator.dart
> set name(String value) {}
# ^^^ keyword.declaration.dart
# ^^^^ entity.name.function.dart
# ^^^^^^ support.class.dart
>
> void method() {}
# ^^^^ storage.type.primitive.dart
# ^^^^^^ entity.name.function.dart
> void get() {}
# ^^^^ storage.type.primitive.dart
# ^^^ entity.name.function.dart
> void set() {}
# ^^^^ storage.type.primitive.dart
# ^^^ entity.name.function.dart
>}
>
>mixin MyMixin<T> on List<T> {}
#^^^^^ keyword.declaration.dart
# ^^^^^^^ support.class.dart
# ^ other.source.dart
# ^ support.class.dart
# ^ other.source.dart
# ^^ keyword.control.catch-exception.dart
# ^^^^ support.class.dart
# ^ other.source.dart
# ^ support.class.dart
# ^ other.source.dart
Loading