diff options
| author | Borys Lykah <lykahb@fastmail.com> | 2023-06-24 13:00:47 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-24 15:00:47 -0400 |
| commit | e9984bb744d3a413f58f4151df081db746df9c48 (patch) | |
| tree | dc41b4e2f7dae853a18c7f6574dbcb2e09314b8d | |
| parent | Update parsers: matlab, racket (diff) | |
| download | nvim-treesitter-e9984bb744d3a413f58f4151df081db746df9c48.tar nvim-treesitter-e9984bb744d3a413f58f4151df081db746df9c48.tar.gz nvim-treesitter-e9984bb744d3a413f58f4151df081db746df9c48.tar.bz2 nvim-treesitter-e9984bb744d3a413f58f4151df081db746df9c48.tar.lz nvim-treesitter-e9984bb744d3a413f58f4151df081db746df9c48.tar.xz nvim-treesitter-e9984bb744d3a413f58f4151df081db746df9c48.tar.zst nvim-treesitter-e9984bb744d3a413f58f4151df081db746df9c48.zip | |
feat: add support for haskell persistent library
| -rw-r--r-- | lua/nvim-treesitter/parsers.lua | 9 | ||||
| -rw-r--r-- | queries/haskell/injections.scm | 7 | ||||
| -rw-r--r-- | queries/haskell_persistent/folds.scm | 3 | ||||
| -rw-r--r-- | queries/haskell_persistent/highlights.scm | 38 |
4 files changed, 57 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 8f96583ed..c55bc973a 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -633,6 +633,15 @@ list.haskell = { }, } +list.haskell_persistent = { + install_info = { + url = "https://github.com/MercuryTechnologies/tree-sitter-haskell-persistent", + files = { "src/parser.c", "src/scanner.cc" }, + }, + filetype = "haskell.persistent", + maintainers = { "@lykahb" }, +} + list.hcl = { install_info = { url = "https://github.com/MichaHoffmann/tree-sitter-hcl", diff --git a/queries/haskell/injections.scm b/queries/haskell/injections.scm index 206248f6e..f210566c4 100644 --- a/queries/haskell/injections.scm +++ b/queries/haskell/injections.scm @@ -76,3 +76,10 @@ (#eq? @_name "sql") ((quasiquote_body) @sql) ) + +; persistent +(quasiquote + (quoter) @_name + (#any-of? @_name "persistUpperCase" "persistLowerCase" "persistWith") + ((quasiquote_body) @haskell_persistent) +) diff --git a/queries/haskell_persistent/folds.scm b/queries/haskell_persistent/folds.scm new file mode 100644 index 000000000..2bdffd177 --- /dev/null +++ b/queries/haskell_persistent/folds.scm @@ -0,0 +1,3 @@ +[ + (entity_definition) +] @fold diff --git a/queries/haskell_persistent/highlights.scm b/queries/haskell_persistent/highlights.scm new file mode 100644 index 000000000..afb32f11d --- /dev/null +++ b/queries/haskell_persistent/highlights.scm @@ -0,0 +1,38 @@ +;; ---------------------------------------------------------------------------- +;; Literals and comments + +(integer) @number +(float) @float +(char) @character +(string) @string +(attribute_name) @attribute +(attribute_exclamation_mark) @attribute + +(con_unit) @symbol ; unit, as in () + +(comment) @comment @spell + +;; ---------------------------------------------------------------------------- +;; Keywords, operators, includes + +[ + "Id" + "Primary" + "Foreign" + "deriving" +] @keyword + +"=" @operator + + +;; ---------------------------------------------------------------------------- +;; Functions and variables + +(variable) @variable + +;; ---------------------------------------------------------------------------- +;; Types + +(type) @type + +(constructor) @constructor |
