From e813af1c4e656ead0b62fe797a1a4962f650b6ab Mon Sep 17 00:00:00 2001 From: Danny Tuppeny Date: Tue, 28 Jul 2026 14:47:53 +0100 Subject: [PATCH 1/3] Update textmate grammar to latest version This updates the grammar to the latest version from https://github.com/dart-lang/dart-syntax-highlight and regenerates the goldens. (I have another upcoming change, but to simplify reviewing, I didn't want to mix it in with previous updates here) --- packages/devtools_app/assets/dart_syntax.json | 66 +++++++++++++++++-- .../syntax_highlighting/keywords.dart.golden | 2 +- 2 files changed, 60 insertions(+), 8 deletions(-) diff --git a/packages/devtools_app/assets/dart_syntax.json b/packages/devtools_app/assets/dart_syntax.json index 2f3492cea94..b73e9bd36d1 100644 --- a/packages/devtools_app/assets/dart_syntax.json +++ b/packages/devtools_app/assets/dart_syntax.json @@ -1,6 +1,6 @@ { "name": "Dart", - "version": "1.4.1", + "version": "1.5.0", "fileTypes": [ "dart" ], @@ -60,6 +60,12 @@ { "include": "#constants-and-special-vars" }, + { + "include": "#class-identifier-with-optional-factory-method" + }, + { + "include": "#function-identifier" + }, { "include": "#operators" }, @@ -227,14 +233,50 @@ { "name": "constant.numeric.dart", "match": "(? var a = new String.fromCharCode(1); # ^^^ storage.type.primitive.dart # ^ keyword.operator.assignment.dart -# ^^^ keyword.control.new.dart +# ^^^ keyword.new.dart # ^^^^^^ support.class.dart # ^ punctuation.dot.dart # ^^^^^^^^^^^^ entity.name.function.dart From d25b1af5b15a9215c78cf15e5111fba47f51ce1b Mon Sep 17 00:00:00 2001 From: Danny Tuppeny Date: Tue, 28 Jul 2026 14:52:21 +0100 Subject: [PATCH 2/3] Remove old reference to new keyword. We don't treat it as a control keyword anymore. --- .../lib/src/screens/debugger/syntax_highlighter.dart | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/devtools_app/lib/src/screens/debugger/syntax_highlighter.dart b/packages/devtools_app/lib/src/screens/debugger/syntax_highlighter.dart index 82d2c785022..80db5b5e45e 100644 --- a/packages/devtools_app/lib/src/screens/debugger/syntax_highlighter.dart +++ b/packages/devtools_app/lib/src/screens/debugger/syntax_highlighter.dart @@ -247,9 +247,7 @@ class SyntaxHighlighter { 'keyword.control.catch-exception.dart', 'keyword.control.dart', 'keyword.control.return.dart', - // While 'new' is not a control flow keyword, it uses the control flow - // color scheme so we include it here. - 'keyword.control.new.dart', + 'keyword.new.dart', ]; const stringScopes = [ From 855bf6884a14b3c9b34dcf62b1cae95e88767a36 Mon Sep 17 00:00:00 2001 From: Danny Tuppeny Date: Tue, 28 Jul 2026 14:54:30 +0100 Subject: [PATCH 3/3] Update NEXT_RELEASE_NOTES.md --- packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md b/packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md index a147f4cc9b3..aa9373543f5 100644 --- a/packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md +++ b/packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md @@ -39,6 +39,8 @@ TODO: Remove this section if there are not any updates. * Prevent values from being garbage-collected, while being evaluated. [#9885](https://github.com/flutter/devtools/pull/9885) +* Update to latest version of the Dart syntax highlighting grammar + [#9920](https://github.com/flutter/devtools/pull/9920). ## Network profiler updates