From 0c6ffe192b718709267b6af082d826e90c4a9099 Mon Sep 17 00:00:00 2001 From: "Lucas @ StarkWare" <70894690+LucasLvy@users.noreply.github.com> Date: Tue, 2 Jul 2024 02:37:49 +0200 Subject: [PATCH] chore: update cairo tree sitter + queries (#11067) --- languages.toml | 2 +- runtime/queries/cairo/highlights.scm | 6 ++++++ runtime/queries/cairo/indents.scm | 8 +++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/languages.toml b/languages.toml index 7ffc998b8..a308e4786 100644 --- a/languages.toml +++ b/languages.toml @@ -2081,7 +2081,7 @@ language-servers = [ "cairo-language-server" ] [[grammar]] name = "cairo" -source = { git = "https://github.com/starkware-libs/tree-sitter-cairo", rev = "0596baab741ffacdc65c761d5d5ffbbeae97f033" } +source = { git = "https://github.com/starkware-libs/tree-sitter-cairo", rev = "e3a0212261c125cb38248458cd856c0ffee2b398" } [[language]] name = "cpon" diff --git a/runtime/queries/cairo/highlights.scm b/runtime/queries/cairo/highlights.scm index d2cabd1c5..16918c141 100644 --- a/runtime/queries/cairo/highlights.scm +++ b/runtime/queries/cairo/highlights.scm @@ -95,6 +95,12 @@ ; ------- ; Keywords ; ------- + +(for_expression + "for" @keyword.control.repeat) + +"in" @keyword.control + [ "match" "if" diff --git a/runtime/queries/cairo/indents.scm b/runtime/queries/cairo/indents.scm index 35c162429..b20317ab0 100644 --- a/runtime/queries/cairo/indents.scm +++ b/runtime/queries/cairo/indents.scm @@ -115,4 +115,10 @@ (#not-same-line? @expr-start @pattern-guard) ) @indent - +(for_expression + "in" @in + . + (_) @indent + (#not-same-line? @in @indent) + (#set! "scope" "all") +)