Skip to content

Commit

Permalink
Update tree-sitter queries to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
meain authored Oct 6, 2023
1 parent 1997984 commit 2677521
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
4 changes: 2 additions & 2 deletions queries/dart/textobjects.scm
Original file line number Diff line number Diff line change
@@ -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
)
Expand All @@ -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
)
Expand Down
8 changes: 7 additions & 1 deletion queries/fish/textobjects.scm
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions queries/hlsl/textobjects.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
; inherits: cpp

18 changes: 18 additions & 0 deletions queries/php/textobjects.scm
Original file line number Diff line number Diff line change
Expand Up @@ -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 . "}"
Expand Down

0 comments on commit 2677521

Please sign in to comment.