From bebb7e7abc41fcd89bd1f7d2ac1d494ee25bd79b Mon Sep 17 00:00:00 2001 From: Erikas Taroza Date: Mon, 20 Apr 2026 10:33:21 -0700 Subject: [PATCH 1/3] Add support for dot shorthands. --- extension.toml | 2 +- languages/dart/highlights.scm | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/extension.toml b/extension.toml index c3155d2..2a97b5e 100644 --- a/extension.toml +++ b/extension.toml @@ -18,7 +18,7 @@ languages = ["Dart"] [grammars.dart] repository = "https://github.com/UserNobody14/tree-sitter-dart" -commit = "80e23c07b64494f7e21090bb3450223ef0b192f4" +commit = "0fc19c3a57b1109802af41d2b8f60d8835c5da3a" [debug_adapters.Dart] # Optional relative path to the JSON schema for the debug adapter configuration schema. Defaults to `debug_adapter_schemas/$DEBUG_ADAPTER_NAME_ID.json`. diff --git a/languages/dart/highlights.scm b/languages/dart/highlights.scm index 5da4dbb..e377022 100644 --- a/languages/dart/highlights.scm +++ b/languages/dart/highlights.scm @@ -153,6 +153,16 @@ (argument_part (arguments))) +; Dot shorthand +(dot_shorthand + (identifier) @property) +((dot_shorthand + (identifier) @function.method) + . + (selector + (argument_part + (arguments)))) + ; Some methods do not have a selector as a parent of the conditional_assignable_selector ; For example, super methods. ((unconditional_assignable_selector @@ -271,7 +281,6 @@ (final_builtin) "abstract" "covariant" - "dynamic" "external" "static" "final" From 5e1dc46e3e9c18448a30e15d73f7b0bcd724173b Mon Sep 17 00:00:00 2001 From: Erikas Taroza Date: Mon, 20 Apr 2026 11:02:16 -0700 Subject: [PATCH 2/3] Fix formatting --- languages/dart/highlights.scm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/languages/dart/highlights.scm b/languages/dart/highlights.scm index e377022..f25829b 100644 --- a/languages/dart/highlights.scm +++ b/languages/dart/highlights.scm @@ -155,13 +155,14 @@ ; Dot shorthand (dot_shorthand - (identifier) @property) + (identifier) @property) + ((dot_shorthand - (identifier) @function.method) - . - (selector - (argument_part - (arguments)))) + (identifier) @function.method) + . + (selector + (argument_part + (arguments)))) ; Some methods do not have a selector as a parent of the conditional_assignable_selector ; For example, super methods. From ed2ca3a2fb2f3f825929d827992244ad9b60bd36 Mon Sep 17 00:00:00 2001 From: Erikas Taroza Date: Mon, 4 May 2026 23:43:06 -0700 Subject: [PATCH 3/3] Update tree-sitter for const dot shorthand grammar --- extension.toml | 2 +- languages/dart/highlights.scm | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/extension.toml b/extension.toml index 2a97b5e..13437fa 100644 --- a/extension.toml +++ b/extension.toml @@ -18,7 +18,7 @@ languages = ["Dart"] [grammars.dart] repository = "https://github.com/UserNobody14/tree-sitter-dart" -commit = "0fc19c3a57b1109802af41d2b8f60d8835c5da3a" +commit = "6922ad29141e819773d6ffb0c6d2c27adefb5acc" [debug_adapters.Dart] # Optional relative path to the JSON schema for the debug adapter configuration schema. Defaults to `debug_adapter_schemas/$DEBUG_ADAPTER_NAME_ID.json`. diff --git a/languages/dart/highlights.scm b/languages/dart/highlights.scm index f25829b..c45cc7a 100644 --- a/languages/dart/highlights.scm +++ b/languages/dart/highlights.scm @@ -164,6 +164,11 @@ (argument_part (arguments)))) +((dot_shorthand + (identifier) @function.method) + . + (arguments)) + ; Some methods do not have a selector as a parent of the conditional_assignable_selector ; For example, super methods. ((unconditional_assignable_selector