Add language support for persistent library syntax (#7261)

This commit is contained in:
Borys Lykah 2023-07-09 11:17:01 -06:00 committed by GitHub
parent c33795e770
commit 7c338429f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 62 additions and 0 deletions

View File

@ -59,6 +59,7 @@
| graphql | ✓ | | | | | graphql | ✓ | | | |
| hare | ✓ | | | | | hare | ✓ | | | |
| haskell | ✓ | ✓ | | `haskell-language-server-wrapper` | | haskell | ✓ | ✓ | | `haskell-language-server-wrapper` |
| haskell-persistent | ✓ | | | |
| hcl | ✓ | | ✓ | `terraform-ls` | | hcl | ✓ | | ✓ | `terraform-ls` |
| heex | ✓ | ✓ | | `elixir-ls` | | heex | ✓ | ✓ | | `elixir-ls` |
| hosts | ✓ | | | | | hosts | ✓ | | | |

View File

@ -955,6 +955,18 @@ indent = { tab-width = 2, unit = " " }
name = "haskell" name = "haskell"
source = { git = "https://github.com/tree-sitter/tree-sitter-haskell", rev = "98fc7f59049aeb713ab9b72a8ff25dcaaef81087" } source = { git = "https://github.com/tree-sitter/tree-sitter-haskell", rev = "98fc7f59049aeb713ab9b72a8ff25dcaaef81087" }
[[language]]
name = "haskell-persistent"
scope = "source.persistentmodels"
file-types = ["persistentmodels"]
roots = []
comment-token = "--"
indent = { tab-width = 2, unit = " " }
[[grammar]]
name = "haskell-persistent"
source = { git = "https://github.com/MercuryTechnologies/tree-sitter-haskell-persistent", rev = "58a6ccfd56d9f1de8fb9f77e6c42151f8f0d0f3d" }
[[language]] [[language]]
name = "purescript" name = "purescript"
scope = "source.purescript" scope = "source.purescript"

View File

@ -0,0 +1,3 @@
[
(entity_definition)
] @fold

View File

@ -0,0 +1,37 @@
;; ----------------------------------------------------------------------------
;; Literals and comments
(integer) @constant.numeric.integer
(float) @constant.numeric.float
(char) @constant.character
(string) @string
(attribute_name) @attribute
(attribute_exclamation_mark) @attribute
(con_unit) @constant.builtin ; unit, as in ()
(comment) @comment
;; ----------------------------------------------------------------------------
;; Keywords, operators, includes
[
"Id"
"Primary"
"Foreign"
"deriving"
] @keyword
"=" @operator
;; ----------------------------------------------------------------------------
;; Functions and variables
(variable) @variable
;; ----------------------------------------------------------------------------
;; Types
(type) @type
(constructor) @constructor

View File

@ -0,0 +1 @@
(fields (variable)) @local.definition

View File

@ -1,6 +1,14 @@
((comment) @injection.content ((comment) @injection.content
(#set! injection.language "comment")) (#set! injection.language "comment"))
(quasiquote
(quoter) @_quoter
((quasiquote_body) @injection.content
(#match? @_quoter "(persistWith|persistLowerCase|persistUpperCase)")
(#set! injection.language "haskell-persistent")
)
)
(quasiquote (quasiquote
(quoter) @injection.language (quoter) @injection.language
(quasiquote_body) @injection.content) (quasiquote_body) @injection.content)