Skip to content

Commit

Permalink
Update tree-sitter-purescript to a commit where the license file is i…
Browse files Browse the repository at this point in the history
…ncluded
  • Loading branch information
blinxen committed Nov 11, 2023
1 parent d742243 commit 0de82ee
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,7 @@ formatter = { command = "purs-tidy", args = ["format"] }

[[grammar]]
name = "purescript"
source = { git = "https://github.com/postsolar/tree-sitter-purescript", rev = "593193b9bf0f46d5eee708a4e53044d2a9054897" }
source = { git = "https://github.com/postsolar/tree-sitter-purescript", rev = "5ef5592674ea42de75fc2792972e4ea0b6e3da6c" }

[[language]]
name = "zig"
Expand Down
23 changes: 19 additions & 4 deletions runtime/queries/purescript/highlights.scm
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
; ----------------------------------------------------------------------------
; Record fields would need to come before literal strings in order to be captured correctly

(record_accessor
field: [ (variable)
(string)
(triple_quote_string)
] @variable.other.member)

(exp_record_access
field: [ (variable)
(string)
(triple_quote_string)
] @variable.other.member)


; ----------------------------------------------------------------------------
; Literals and comments

Expand Down Expand Up @@ -117,17 +133,16 @@

(row_field (field_name) @variable.other.member)
(record_field (field_name) @variable.other.member)
(record_accessor (variable) @variable.other.member)
(exp_record_access (variable) @variable.other.member)
(record_field (field_pun) @variable.other.member)

(signature name: (variable) @type)
(function name: (variable) @function)
(class_instance (instance_name) @function)
(derive_declaration (instance_name) @function)

; true or false
((variable) @constant.builtin.boolean
(#match? @constant.builtin.boolean "^(true|false)$"))
((variable) @constant.builtin.boolean
(#match? @constant.builtin.boolean "^(true|false)$"))

; The former one works for `tree-sitter highlight` but not in Helix/Kakoune.
; The latter two work in Helix (but not Kakoune) and are a good compromise between not highlighting anything at all
Expand Down

0 comments on commit 0de82ee

Please sign in to comment.