aboutsummaryrefslogtreecommitdiffstats
path: root/queries/haskell
diff options
context:
space:
mode:
authorPhạm Huy Hoàng <hoangtun0810@gmail.com>2024-03-21 20:44:35 +0900
committerChristian Clason <c.clason@uni-graz.at>2024-03-21 15:51:26 +0100
commit722617e6726c1508adadf83d531f54987c703be0 (patch)
tree951cdcf1cd2571647a3e5afdc11d6fae5e88b630 /queries/haskell
parentfeat(rust): improve indents (diff)
downloadnvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.tar
nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.tar.gz
nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.tar.bz2
nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.tar.lz
nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.tar.xz
nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.tar.zst
nvim-treesitter-722617e6726c1508adadf83d531f54987c703be0.zip
refactor(format): drop extra indentation for field
Diffstat (limited to 'queries/haskell')
-rw-r--r--queries/haskell/highlights.scm86
1 files changed, 39 insertions, 47 deletions
diff --git a/queries/haskell/highlights.scm b/queries/haskell/highlights.scm
index 33d9d2950..9cb4c8104 100644
--- a/queries/haskell/highlights.scm
+++ b/queries/haskell/highlights.scm
@@ -7,23 +7,20 @@
(pat_wildcard) @variable
(function
- patterns:
- (patterns
- (_) @variable.parameter))
+ patterns: (patterns
+ (_) @variable.parameter))
(exp_lambda
(_)+ @variable.parameter
"->")
(function
- infix:
- (infix
- lhs: (_) @variable.parameter))
+ infix: (infix
+ lhs: (_) @variable.parameter))
(function
- infix:
- (infix
- rhs: (_) @variable.parameter))
+ infix: (infix
+ rhs: (_) @variable.parameter))
; ----------------------------------------------------------------------------
; Literals and comments
@@ -185,7 +182,24 @@
(function
name: (variable) @variable
- rhs:
+ rhs: [
+ (exp_literal)
+ (exp_apply
+ (exp_name
+ [
+ (constructor)
+ (variable)
+ (qualified_variable)
+ ]))
+ (quasiquote)
+ ((exp_name)
+ .
+ (operator))
+ ])
+
+(function
+ name: (variable) @variable
+ rhs: (exp_infix
[
(exp_literal)
(exp_apply
@@ -199,26 +213,7 @@
((exp_name)
.
(operator))
- ])
-
-(function
- name: (variable) @variable
- rhs:
- (exp_infix
- [
- (exp_literal)
- (exp_apply
- (exp_name
- [
- (constructor)
- (variable)
- (qualified_variable)
- ]))
- (quasiquote)
- ((exp_name)
- .
- (operator))
- ]))
+ ]))
; Consider signatures (and accompanying functions)
; with only one value on the rhs as variables
@@ -403,14 +398,13 @@
; function defined in terms of a function composition
(function
name: (variable) @function
- rhs:
- (exp_infix
- (_)
- .
- (operator) @_op
- .
- (_)
- (#any-of? @_op "." ">>>" "***" ">=>" "<=<")))
+ rhs: (exp_infix
+ (_)
+ .
+ (operator) @_op
+ .
+ (_)
+ (#any-of? @_op "." ">>>" "***" ">=>" "<=<")))
(exp_apply
(exp_name
@@ -486,9 +480,8 @@
; scoped function types (func :: a -> b)
(pat_typed
- pattern:
- (pat_name
- (variable) @function)
+ pattern: (pat_name
+ (variable) @function)
type: (fun))
; signatures that have a function type
@@ -618,12 +611,11 @@
(variable) @variable.member))
(exp_field
- field:
- [
- (variable) @variable.member
- (qualified_variable
- (variable) @variable.member)
- ])
+ field: [
+ (variable) @variable.member
+ (qualified_variable
+ (variable) @variable.member)
+ ])
; ----------------------------------------------------------------------------
; Spell checking