diff options
| author | Christian Clason <c.clason@uni-graz.at> | 2025-11-25 10:23:02 +0100 |
|---|---|---|
| committer | Christian Clason <ch.clason+github@icloud.com> | 2025-11-25 10:28:33 +0100 |
| commit | d6ebbd5039954ecd47463802a16b5d8d7f223eef (patch) | |
| tree | 1efedbc2f27ed77bb764f0e0be4edc4855f9cc22 | |
| parent | feat(parsers): update angular, ini, json5, koto, matlab, mlir, nix, pkl, quer... (diff) | |
| download | nvim-treesitter-d6ebbd5039954ecd47463802a16b5d8d7f223eef.tar nvim-treesitter-d6ebbd5039954ecd47463802a16b5d8d7f223eef.tar.gz nvim-treesitter-d6ebbd5039954ecd47463802a16b5d8d7f223eef.tar.bz2 nvim-treesitter-d6ebbd5039954ecd47463802a16b5d8d7f223eef.tar.lz nvim-treesitter-d6ebbd5039954ecd47463802a16b5d8d7f223eef.tar.xz nvim-treesitter-d6ebbd5039954ecd47463802a16b5d8d7f223eef.tar.zst nvim-treesitter-d6ebbd5039954ecd47463802a16b5d8d7f223eef.zip | |
fix(haskell): correct use of supertypes in `(decl)` patterns
Problem: These patterns were impossible, since children need to be children of
every subtype of a supertype to be captured in this way. As subtypes
could appear as children themselves, the query code silently "skipped
over" the supertype restriction in the pattern. This was fixed in
tree-sitter v0.26.0, which now (correctly) flags these patterns as
"impossible".
Solution: Add the appropriate child nodes explicitly.
| -rw-r--r-- | runtime/queries/haskell/highlights.scm | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/runtime/queries/haskell/highlights.scm b/runtime/queries/haskell/highlights.scm index 0880f020e..de0eaf0a1 100644 --- a/runtime/queries/haskell/highlights.scm +++ b/runtime/queries/haskell/highlights.scm @@ -121,7 +121,21 @@ ; ---------------------------------------------------------------------------- ; Functions and variables -(decl +(decl/signature + [ + name: (variable) @function + names: (binding_list + (variable) @function) + ]) + +(decl/function + [ + name: (variable) @function + names: (binding_list + (variable) @function) + ]) + +(decl/bind [ name: (variable) @function names: (binding_list @@ -142,7 +156,14 @@ type: (type)) . (decl - name: (variable) @variable) + [ + (signature + name: (variable) @variable) + (function + name: (variable) @variable) + (bind + name: (variable) @variable) + ]) match: (_) (#eq? @_name @variable)) @@ -160,7 +181,14 @@ (#eq? @_type "IO")) . (decl - name: (variable) @function) + [ + (signature + name: (variable) @function) + (function + name: (variable) @function) + (bind + name: (variable) @function) + ]) match: (_) (#eq? @_name @function)) |
