Skip to content

Commit

Permalink
fix(haskell): tweak textobject queries
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb authored and clason committed Aug 4, 2024
1 parent 4812895 commit ef0591b
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions queries/haskell/textobjects.scm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
((apply
.
(name)
function: (_)
.
(_) @_start
.
Expand All @@ -11,7 +11,11 @@

(infix
(_)
(variable)
[
(infix_id
(variable)) ; x `plus` y
(operator) ; x + y
]
(_)) @call.outer

(decl/function) @function.outer
Expand All @@ -27,6 +31,15 @@
; also treat function signature as @function.outer
(signature) @function.outer

; treat signature with function as @function.outer
(((decl/signature
name: (_) @_sig_name) @_start
.
(decl/function
name: (_) @_func_name) @_end)
(#eq? @_sig_name @_func_name)
(#make-range! "function.outer" @_start @_end))

(class) @class.outer

(class
Expand All @@ -40,6 +53,8 @@

(comment) @comment.outer

(haddock) @comment.outer

(expression/conditional) @conditional.outer

(expression/conditional
Expand Down

0 comments on commit ef0591b

Please sign in to comment.