on master help sign in
Add language support for persistent library syntax (#7261)
7c33842Borys Lykah
book/src/generated/lang-support.md+1
@@ -59,6 +59,7 @@
59| graphql | ✓ | | | |
59| graphql | ✓ | | | |
60| hare | ✓ | | | |
60| hare | ✓ | | | |
61| haskell | ✓ | ✓ | | `haskell-language-server-wrapper` |
61| haskell | ✓ | ✓ | | `haskell-language-server-wrapper` |
62+| haskell-persistent | ✓ | | | |
62| hcl | ✓ | | ✓ | `terraform-ls` |
63| hcl | ✓ | | ✓ | `terraform-ls` |
63| heex | ✓ | ✓ | | `elixir-ls` |
64| heex | ✓ | ✓ | | `elixir-ls` |
64| hosts | ✓ | | | |
65| hosts | ✓ | | | |
languages.toml+12
@@ -955,6 +955,18 @@ indent = { tab-width = 2, unit = " " }
955name = "haskell"
955name = "haskell"
956source = { git = "https://github.com/tree-sitter/tree-sitter-haskell", rev = "98fc7f59049aeb713ab9b72a8ff25dcaaef81087" }
956source = { git = "https://github.com/tree-sitter/tree-sitter-haskell", rev = "98fc7f59049aeb713ab9b72a8ff25dcaaef81087" }
957
957
958+[[language]]
959+name = "haskell-persistent"
960+scope = "source.persistentmodels"
961+file-types = ["persistentmodels"]
962+roots = []
963+comment-token = "--"
964+indent = { tab-width = 2, unit = " " }
965+
966+[[grammar]]
967+name = "haskell-persistent"
968+source = { git = "https://github.com/MercuryTechnologies/tree-sitter-haskell-persistent", rev = "58a6ccfd56d9f1de8fb9f77e6c42151f8f0d0f3d" }
969+
958[[language]]
970[[language]]
959name = "purescript"
971name = "purescript"
960scope = "source.purescript"
972scope = "source.purescript"
runtime/queries/haskell-persistent/folds.scmnew file+3
@@ -0,0 +1,3 @@
1+[
2+ (entity_definition)
3+] @fold
runtime/queries/haskell-persistent/highlights.scmnew file+37
@@ -0,0 +1,37 @@
1+;; ----------------------------------------------------------------------------
2+;; Literals and comments
3+
4+(integer) @constant.numeric.integer
5+(float) @constant.numeric.float
6+(char) @constant.character
7+(string) @string
8+(attribute_name) @attribute
9+(attribute_exclamation_mark) @attribute
10+
11+(con_unit) @constant.builtin ; unit, as in ()
12+
13+(comment) @comment
14+
15+;; ----------------------------------------------------------------------------
16+;; Keywords, operators, includes
17+
18+[
19+ "Id"
20+ "Primary"
21+ "Foreign"
22+ "deriving"
23+] @keyword
24+
25+"=" @operator
26+
27+;; ----------------------------------------------------------------------------
28+;; Functions and variables
29+
30+(variable) @variable
31+
32+;; ----------------------------------------------------------------------------
33+;; Types
34+
35+(type) @type
36+
37+(constructor) @constructor
runtime/queries/haskell-persistent/locals.scmnew file+1
@@ -0,0 +1 @@
1+(fields (variable)) @local.definition
runtime/queries/haskell/injections.scm+8
@@ -1,6 +1,14 @@
1((comment) @injection.content
1((comment) @injection.content
2 (#set! injection.language "comment"))
2 (#set! injection.language "comment"))
3
3
4+(quasiquote
5+ (quoter) @_quoter
6+ ((quasiquote_body) @injection.content
7+ (#match? @_quoter "(persistWith|persistLowerCase|persistUpperCase)")
8+ (#set! injection.language "haskell-persistent")
9+ )
10+)
11+
4(quasiquote
12(quasiquote
5 (quoter) @injection.language
13 (quoter) @injection.language
6 (quasiquote_body) @injection.content)
14 (quasiquote_body) @injection.content)