-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore!(queries): adjust queries for tree-sitter-haskell rewrite
- Loading branch information
Showing
5 changed files
with
160 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,28 @@ | ||
;; describe (unqualified) | ||
(_ (_ (exp_apply | ||
(exp_name (variable) @func_name) | ||
(exp_literal) @namespace.name | ||
) | ||
(#any-of? @func_name | ||
"describe" | ||
"xdescribe" | ||
"context" | ||
"xcontext" | ||
) | ||
)) @namespace.definition | ||
;; describe | ||
(_ (_ (expression/apply | ||
function: [ | ||
(variable) @_func_name | ||
(qualified id: (variable) @_func_name) | ||
] | ||
argument: (expression/literal) @namespace.name) | ||
(#any-of? @_func_name | ||
"describe" | ||
"xdescribe" | ||
"context" | ||
"xcontext" | ||
))) @namespace.definition | ||
|
||
;; describe (qualified) | ||
(_ (_ (exp_apply | ||
(exp_name (qualified_variable (variable) @func_name)) | ||
(exp_literal) @namespace.name | ||
) | ||
(#any-of? @func_name | ||
"describe" | ||
"xdescribe" | ||
"context" | ||
"xcontext" | ||
) | ||
)) @namespace.definition | ||
|
||
;; test (unqualified) | ||
((exp_apply | ||
(exp_name (variable) @func_name) | ||
(exp_literal) @test.name | ||
) | ||
(#any-of? @func_name | ||
"it" | ||
"xit" | ||
"prop" | ||
"xprop" | ||
"specify" | ||
"xspecify" | ||
) | ||
) @test.definition | ||
|
||
;; test (qualified) | ||
((exp_apply | ||
(exp_name (qualified_variable (variable) @func_name)) | ||
(exp_literal) @test.name | ||
) | ||
(#any-of? @func_name | ||
"it" | ||
"xit" | ||
"prop" | ||
"xprop" | ||
"specify" | ||
"xspecify" | ||
) | ||
) @test.definition | ||
;; test | ||
((expression/apply | ||
function: [ | ||
(variable) @_func_name | ||
(qualified id: (variable) @_func_name) | ||
] | ||
argument: (expression/literal) @test.name) | ||
(#any-of? @_func_name | ||
"it" | ||
"xit" | ||
"prop" | ||
"xprop" | ||
"specify" | ||
"xspecify")) @test.definition |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,22 @@ | ||
;; NOTE: The sydtest runner inclides all queries for hspec, too. | ||
;; NOTE: The sydtest runner includes all queries for hspec, too. | ||
|
||
;; test (unqualified) | ||
((exp_apply | ||
(exp_name (variable) @func_name) | ||
(exp_literal) @test.name | ||
) | ||
(#any-of? @func_name | ||
"itWithOuter" | ||
"xitWithOuter" | ||
"itWithBoth" | ||
"xitWithBoth" | ||
"itWithAll" | ||
"xitWithAll" | ||
"specifyWithOuter" | ||
"xspecifyWithOuter" | ||
"specifyWithBoth" | ||
"xspecifyWithBoth" | ||
"specifyWithAll" | ||
"xspecifyWithAll" | ||
) | ||
) @test.definition | ||
|
||
;; test (qualified) | ||
((exp_apply | ||
(exp_name (qualified_variable (variable) @func_name)) | ||
(exp_literal) @test.name | ||
) | ||
(#any-of? @func_name | ||
"itWithOuter" | ||
"xitWithOuter" | ||
"itWithBoth" | ||
"xitWithBoth" | ||
"itWithAll" | ||
"xitWithAll" | ||
"specifyWithOuter" | ||
"xspecifyWithOuter" | ||
"specifyWithBoth" | ||
"xspecifyWithBoth" | ||
"specifyWithAll" | ||
"xspecifyWithAll" | ||
) | ||
) @test.definition | ||
((expression/apply | ||
function: [ | ||
(variable) @_func_name | ||
(qualified id: (variable) @_func_name) | ||
] | ||
argument: (expression/literal) @test.name) | ||
(#any-of? @_func_name | ||
"itWithOuter" | ||
"xitWithOuter" | ||
"itWithBoth" | ||
"xitWithBoth" | ||
"itWithAll" | ||
"xitWithAll" | ||
"specifyWithOuter" | ||
"xspecifyWithOuter" | ||
"specifyWithBoth" | ||
"xspecifyWithBoth" | ||
"specifyWithAll" | ||
"xspecifyWithAll")) @test.definition |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,115 +1,115 @@ | ||
;; NOTE: The tasty runner inclides all queries for hspec, too. | ||
|
||
(_ | ||
(exp_name) @func_name | ||
(#lua-match? @func_name "^.*testGroup") | ||
(exp_name) @_func_name | ||
(#lua-match? @_func_name "^.*testGroup") | ||
(exp_literal (string) @namespace.name) | ||
(exp_list (_)) | ||
) @namespace.definition | ||
|
||
;; describe (unqualified) | ||
(_ (_ (exp_apply | ||
(exp_name (variable) @func_name) | ||
(exp_name (variable) @_func_name) | ||
(exp_literal) @namespace.name | ||
) | ||
(#match? @func_name | ||
(#match? @_func_name | ||
"testSpec" | ||
) | ||
)) @namespace.definition | ||
|
||
;; describe (qualified) | ||
(_ (_ (exp_apply | ||
(exp_name (qualified_variable (variable) @func_name)) | ||
(exp_name (qualified_variable (variable) @_func_name)) | ||
(exp_literal) @namespace.name | ||
) | ||
(#match? @func_name | ||
(#match? @_func_name | ||
"testSpec" | ||
) | ||
)) @namespace.definition | ||
|
||
;; smallcheck/quickcheck/hedgehog (qualified or unqualified) | ||
( | ||
(exp_apply | ||
(exp_name) @func_name | ||
(exp_name) @_func_name | ||
(exp_literal) @test.name | ||
) @test.definition | ||
(#lua-match? @func_name "^.*testProperty.*") | ||
(#lua-match? @_func_name "^.*testProperty.*") | ||
) | ||
|
||
;; expectFail (qualified or unqualified) | ||
( | ||
(exp_name) @func_name | ||
(exp_name) @_func_name | ||
(exp_apply | ||
(exp_name) | ||
(exp_literal) @test.name | ||
) @test.definition | ||
(#lua-match? @func_name "^.*expectFail") | ||
(#lua-match? @_func_name "^.*expectFail") | ||
) | ||
|
||
;; HUnit (qualified or unqualified) | ||
(_ | ||
(exp_apply | ||
(exp_name) @func_name | ||
(#lua-match? @func_name "^.*testCase") | ||
(exp_name) @_func_name | ||
(#lua-match? @_func_name "^.*testCase") | ||
(exp_literal) @test.name | ||
) @test.definition | ||
) | ||
|
||
;; Program (qualified or unqualified) | ||
(_ | ||
(exp_apply | ||
(exp_name) @func_name | ||
(#lua-match? @func_name "^.*testProgram") | ||
(exp_name) @_func_name | ||
(#lua-match? @_func_name "^.*testProgram") | ||
(exp_literal) @test.name | ||
) @test.definition | ||
) | ||
|
||
;; Wai (qualified or unqualified) | ||
(_ | ||
(exp_apply | ||
(exp_name) @func_name | ||
(#lua-match? @func_name "^.*testWai") | ||
(exp_name) @_func_name | ||
(#lua-match? @_func_name "^.*testWai") | ||
(exp_literal) @test.name | ||
) @test.definition | ||
) | ||
|
||
;; tasty-golden goldenVsFile (qualified or unqualified) | ||
(_ | ||
(exp_apply | ||
(exp_name) @func_name | ||
(#lua-match? @func_name "^.*goldenVsFile") | ||
(exp_name) @_func_name | ||
(#lua-match? @_func_name "^.*goldenVsFile") | ||
(exp_literal) @test.name | ||
) @test.definition | ||
) | ||
;; tasty-golden goldenVsFileDiff (qualified or unqualified) | ||
(_ | ||
(exp_apply | ||
(exp_name) @func_name | ||
(#lua-match? @func_name "^.*goldenVsFileDiff") | ||
(exp_name) @_func_name | ||
(#lua-match? @_func_name "^.*goldenVsFileDiff") | ||
(exp_literal) @test.name | ||
) @test.definition | ||
) | ||
;; tasty-golden goldenVsString (qualified or unqualified) | ||
(_ | ||
(exp_apply | ||
(exp_name) @func_name | ||
(#lua-match? @func_name "^.*goldenVsString") | ||
(exp_name) @_func_name | ||
(#lua-match? @_func_name "^.*goldenVsString") | ||
(exp_literal) @test.name | ||
) @test.definition | ||
) | ||
;; tasty-golden goldenVsStringDiff (qualified or unqualified) | ||
(_ | ||
(exp_apply | ||
(exp_name) @func_name | ||
(#lua-match? @func_name "^.*goldenVsStringDiff") | ||
(exp_name) @_func_name | ||
(#lua-match? @_func_name "^.*goldenVsStringDiff") | ||
(exp_literal) @test.name | ||
) @test.definition | ||
) | ||
;; tasty-golden postCleanup (qualified or unqualified) | ||
(_ | ||
(exp_apply | ||
(exp_name) @func_name | ||
(#lua-match? @func_name "^.*postCleanup") | ||
(exp_name) @_func_name | ||
(#lua-match? @_func_name "^.*postCleanup") | ||
(exp_literal) @test.name | ||
) @test.definition | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
local git_ref = 'e29c59236283198d93740a796c50d1394bccbef5' | ||
local modrev = 'scm' | ||
local specrev = '1' | ||
|
||
local repo_url = 'https://github.com/tree-sitter/tree-sitter-haskell' | ||
|
||
rockspec_format = '3.0' | ||
package = 'tree-sitter-haskell' | ||
version = modrev ..'-'.. specrev | ||
|
||
description = { | ||
summary = 'tree-sitter parser and Neovim queries for haskell', | ||
labels = { 'neovim', 'tree-sitter' } , | ||
homepage = 'https://github.com/tree-sitter/tree-sitter-haskell', | ||
license = 'MIT' | ||
} | ||
|
||
build_dependencies = { | ||
'luarocks-build-treesitter-parser >= 1.3.0', | ||
} | ||
|
||
source = { | ||
url = repo_url .. '/archive/' .. git_ref .. '.zip', | ||
dir = 'tree-sitter-haskell-' .. 'e29c59236283198d93740a796c50d1394bccbef5', | ||
} | ||
|
||
build = { | ||
type = "treesitter-parser", | ||
lang = "haskell", | ||
sources = { "src/parser.c", "src/scanner.c" }, | ||
} |