From 2677521b83bfb6c379ecd79197c5a95cf1b4c0ca Mon Sep 17 00:00:00 2001 From: meain Date: Fri, 6 Oct 2023 13:06:48 +0000 Subject: [PATCH] Update tree-sitter queries to latest --- queries/dart/textobjects.scm | 4 ++-- queries/fish/textobjects.scm | 8 +++++++- queries/hlsl/textobjects.scm | 2 ++ queries/php/textobjects.scm | 18 ++++++++++++++++++ 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 queries/hlsl/textobjects.scm diff --git a/queries/dart/textobjects.scm b/queries/dart/textobjects.scm index 2a479a2..6b8c93b 100644 --- a/queries/dart/textobjects.scm +++ b/queries/dart/textobjects.scm @@ -1,6 +1,6 @@ ; class (( - [(marker_annotation)? (annotation)?] @class.outer.start . + (annotation)? @class.outer.start . (class_definition body: (class_body) @class.outer._end @class.inner) @class.outer._start ) @@ -13,7 +13,7 @@ ; function/method (( - [(marker_annotation)? (annotation)?] @function.outer.start . + (annotation)? @function.outer.start . [(method_signature) (function_signature)] @function.outer._start . (function_body) @function.outer._end ) diff --git a/queries/fish/textobjects.scm b/queries/fish/textobjects.scm index 525ae35..40c59be 100644 --- a/queries/fish/textobjects.scm +++ b/queries/fish/textobjects.scm @@ -1,4 +1,10 @@ -(function_definition) @function.outer +;; assignment +(command + name: (word) @_command + argument: (word) @_varname @assignment.lhs @assignment.inner + argument: (_)* @assignment.rhs + (#not-lua-match? @_varname "[-].*") + (#eq? @_command "set")) @assignment.outer (command name: (word) @_name diff --git a/queries/hlsl/textobjects.scm b/queries/hlsl/textobjects.scm new file mode 100644 index 0000000..cef8a66 --- /dev/null +++ b/queries/hlsl/textobjects.scm @@ -0,0 +1,2 @@ +; inherits: cpp + diff --git a/queries/php/textobjects.scm b/queries/php/textobjects.scm index 1d970ec..bed8530 100644 --- a/queries/php/textobjects.scm +++ b/queries/php/textobjects.scm @@ -15,6 +15,24 @@ )) (method_declaration) @function.outer +;; traits +(trait_declaration + body: (declaration_list . "{" . (_) @class.inner._start @class.inner._end (_)? @class.inner._end . "}" + )) +(trait_declaration) @class.outer + +;; interfaces +(interface_declaration + body: (declaration_list . "{" . (_) @class.inner._start @class.inner._end (_)? @class.inner._end . "}" + )) +(interface_declaration) @class.outer + +;; enums +(enum_declaration + body: (enum_declaration_list . "{" . (_) @class.inner._start @class.inner._end (_)? @class.inner._end . "}" + )) +(enum_declaration) @class.outer + ;; classes (class_declaration body: (declaration_list . "{" . (_) @class.inner._start @class.inner._end (_)? @class.inner._end . "}"