on master help sign in
Use Maskhjarnas tree-sitter-purescript (#8306)
cb39242NomisIV
book/src/generated/lang-support.md+1−1
@@ -122,7 +122,7 @@
122| prolog | | | | `swipl` |
122| prolog | | | | `swipl` |
123| protobuf | ✓ | | ✓ | `bufls`, `pb` |
123| protobuf | ✓ | | ✓ | `bufls`, `pb` |
124| prql | ✓ | | | |
124| prql | ✓ | | | |
125−| purescript | ✓ | | | `purescript-language-server` |
125+| purescript | ✓ | ✓ | | `purescript-language-server` |
126| python | ✓ | ✓ | ✓ | `pylsp` |
126| python | ✓ | ✓ | ✓ | `pylsp` |
127| qml | ✓ | | ✓ | `qmlls` |
127| qml | ✓ | | ✓ | `qmlls` |
128| r | ✓ | | | `R` |
128| r | ✓ | | | `R` |
languages.toml+4−1
@@ -1003,7 +1003,10 @@ language-servers = [ "purescript-language-server" ]
1003indent = { tab-width = 2, unit = " " }
1003indent = { tab-width = 2, unit = " " }
1004auto-format = true
1004auto-format = true
1005formatter = { command = "purs-tidy", args = ["format"] }
1005formatter = { command = "purs-tidy", args = ["format"] }
1006+
1006−grammar = "haskell"
1007+[[grammar]]
1008+name = "purescript"
1009+source = { git = "https://github.com/maskhjarna/tree-sitter-purescript", rev = "5f5a030826849b7be17596d372967f60051b42bd" }
1007
1010
1008[[language]]
1011[[language]]
1009name = "zig"
1012name = "zig"
runtime/queries/purescript/highlights.scm+118−1
@@ -1 +1,118 @@
1−; inherits: haskell
1+; ----------------------------------------------------------------------------
2+; Literals and comments
3+
4+ (integer) @constant.numeric.integer
5+ (exp_negation) @constant.numeric.integer
6+ (exp_literal (float)) @constant.numeric.float
7+ (char) @constant.character
8+ (string) @string
9+
10+ (con_unit) @constant.builtin ; unit, as in ()
11+
12+ (comment) @comment
13+
14+
15+; ----------------------------------------------------------------------------
16+; Punctuation
17+
18+ [
19+ "("
20+ ")"
21+ "{"
22+ "}"
23+ "["
24+ "]"
25+ ] @punctuation.bracket
26+
27+ [
28+ (comma)
29+ ";"
30+ ] @punctuation.delimiter
31+
32+
33+; ----------------------------------------------------------------------------
34+; Keywords, operators, includes
35+
36+ [
37+ "if"
38+ "then"
39+ "else"
40+ "case"
41+ "of"
42+ ] @keyword.control.conditional
43+
44+ [
45+ "import"
46+ "module"
47+ ] @keyword.control.import
48+
49+ [
50+ (operator)
51+ (constructor_operator)
52+ (type_operator)
53+ (tycon_arrow)
54+ (qualified_module) ; grabs the `.` (dot), ex: import System.IO
55+ (all_names)
56+ "="
57+ "|"
58+ "::"
59+ "=>"
60+ "->"
61+ "<-"
62+ "\\"
63+ "`"
64+ "@"
65+ ] @operator
66+
67+ (qualified_module (module) @constructor)
68+ (module) @namespace
69+ (qualified_type (module) @namespace)
70+ (qualified_variable (module) @namespace)
71+ (import (module) @namespace)
72+
73+ [
74+ (where)
75+ "let"
76+ "in"
77+ "class"
78+ "instance"
79+ "derive"
80+ "foreign"
81+ "data"
82+ "newtype"
83+ "type"
84+ "as"
85+ "do"
86+ "ado"
87+ "forall"
88+ "∀"
89+ "infix"
90+ "infixl"
91+ "infixr"
92+ ] @keyword
93+
94+
95+; ----------------------------------------------------------------------------
96+; Functions and variables
97+
98+ (signature name: (variable) @type)
99+ (function name: (variable) @function)
100+
101+ ; true or false
102+((variable) @constant.builtin.boolean
103+ (#match? @constant.builtin.boolean "^(true|false)$"))
104+
105+ (variable) @variable
106+
107+ (exp_infix (variable) @operator) ; consider infix functions as operators
108+
109+ ("@" @namespace) ; "as" pattern operator, e.g. x@Constructor
110+
111+
112+; ----------------------------------------------------------------------------
113+; Types
114+
115+ (type) @type
116+
117+ (constructor) @constructor
118+
runtime/queries/purescript/injections.scm+2−1
@@ -1 +1,2 @@
1−; inherits: haskell
1+((comment) @injection.content
2+ (#set! injection.language "comment"))
runtime/queries/purescript/locals.scm+4−1
@@ -1 +1,4 @@
1−; inherits: haskell
1+(signature name: (variable)) @local.definition
2+(function name: (variable)) @local.definition
3+(pat_name (variable)) @local.definition
4+(exp_name (variable)) @local.reference
runtime/queries/purescript/textobjects.scmnew file+13
@@ -0,0 +1,13 @@
1+(comment) @comment.inside
2+
3+[
4+ (data)
5+ (type)
6+ (newtype)
7+] @class.around
8+
9+((signature)? (function rhs:(_) @function.inside)) @function.around
10+(exp_lambda) @function.around
11+
12+(data (type_variable) @parameter.inside)
13+(patterns (_) @parameter.inside)