From 3d4eb9d544cbbe39544586890b5de83a48de3680 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 5 May 2024 12:57:36 +0200 Subject: fix(treesitter): update queries --- runtime/queries/python/folds.scm | 5 +++++ runtime/queries/python/highlights.scm | 37 +++++++++++++++++++++++++++++------ 2 files changed, 36 insertions(+), 6 deletions(-) (limited to 'runtime/queries/python') diff --git a/runtime/queries/python/folds.scm b/runtime/queries/python/folds.scm index 7c547db38f..ecb9352d78 100644 --- a/runtime/queries/python/folds.scm +++ b/runtime/queries/python/folds.scm @@ -21,3 +21,8 @@ (dictionary) (string) ] @fold + +[ + (import_statement) + (import_from_statement) +]+ @fold diff --git a/runtime/queries/python/highlights.scm b/runtime/queries/python/highlights.scm index 4d62aeff06..5e5a2a88de 100644 --- a/runtime/queries/python/highlights.scm +++ b/runtime/queries/python/highlights.scm @@ -188,7 +188,7 @@ ((module . - (comment) @keyword.directive) + (comment) @keyword.directive @nospell) (#lua-match? @keyword.directive "^#!/")) (string) @string @@ -204,19 +204,41 @@ (comment)* . (expression_statement - (string) @string.documentation @spell)) + (string) @string.documentation)) (class_definition body: (block . (expression_statement - (string) @string.documentation @spell))) + (string) @string.documentation))) (function_definition body: (block . (expression_statement - (string) @string.documentation @spell))) + (string) @string.documentation))) + +(module + . + (comment)* + . + (expression_statement + (string + (string_content) @spell))) + +(class_definition + body: (block + . + (expression_statement + (string + (string_content) @spell)))) + +(function_definition + body: (block + . + (expression_statement + (string + (string_content) @spell)))) ; Tokens [ @@ -278,7 +300,6 @@ [ "assert" - "class" "exec" "global" "nonlocal" @@ -286,9 +307,13 @@ "print" "with" "as" - "type" ] @keyword +[ + "type" + "class" +] @keyword.type + [ "async" "await" -- cgit