From e1820bbda11c8a333c6be1063cf0b304812225b5 Mon Sep 17 00:00:00 2001 From: Zooce Date: Wed, 3 Dec 2025 13:51:50 -0800 Subject: [PATCH] fix(python): impossible patterns --- lua/nvim-treesitter/parsers.lua | 4 ++-- runtime/queries/python/highlights.scm | 6 ++++-- runtime/queries/python/indents.scm | 19 +++++++++---------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 49d2a3bed..315e20ea4 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1779,8 +1779,8 @@ return { }, python = { install_info = { - revision = 'v0.25.0', - url = 'https://github.com/tree-sitter/tree-sitter-python', + revision = 'v0.25.2', + url = 'https://github.com/tree-sitter/py-tree-sitter', }, maintainers = { '@stsewd', '@theHamsta' }, tier = 1, diff --git a/runtime/queries/python/highlights.scm b/runtime/queries/python/highlights.scm index 1b046d699..b7c2772a0 100644 --- a/runtime/queries/python/highlights.scm +++ b/runtime/queries/python/highlights.scm @@ -81,8 +81,10 @@ ; doc-strings (expression_statement - (string - (string_content) @spell) @string.documentation) + (expression + (primary_expression + (string + (string_content) @spell))) @string.documentation) ; Tokens [ diff --git a/runtime/queries/python/indents.scm b/runtime/queries/python/indents.scm index 2414812a7..084fb9f72 100644 --- a/runtime/queries/python/indents.scm +++ b/runtime/queries/python/indents.scm @@ -45,16 +45,15 @@ ":" (#set! indent.immediate 1)) @indent.begin -(ERROR - "try" - . - ":" - (ERROR - (block - (expression_statement - (identifier) @_except) @indent.branch)) - (#eq? @_except "except")) - +; (ERROR +; "try" +; . +; ":" +; (ERROR +; (block +; (expression_statement +; (identifier) @_except) @indent.branch)) +; (#eq? @_except "except")) ((function_definition) @indent.begin (#set! indent.immediate 1))