mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-03 12:06:55 -04:00
Add common quasiquote highlights/injections for Haskell (#1440)
This commit is contained in:
parent
cf768b0069
commit
efbd01f539
2 changed files with 64 additions and 0 deletions
|
|
@ -122,3 +122,10 @@
|
|||
|
||||
; True or False
|
||||
((constructor) @_bool (#match? @_bool "(True|False)")) @boolean
|
||||
|
||||
|
||||
;; ----------------------------------------------------------------------------
|
||||
;; Quasi-quotes
|
||||
|
||||
(quoter) @function
|
||||
; Highlighting of quasiquote_body is handled by injections.scm
|
||||
|
|
|
|||
57
queries/haskell/injections.scm
Normal file
57
queries/haskell/injections.scm
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
;; -----------------------------------------------------------------------------
|
||||
;; General language injection
|
||||
|
||||
(quasiquote
|
||||
((quoter) @language)
|
||||
((quasiquote_body) @content)
|
||||
)
|
||||
|
||||
|
||||
;; -----------------------------------------------------------------------------
|
||||
;; shakespeare library
|
||||
;; NOTE: doesn't support templating
|
||||
|
||||
; TODO: add once CoffeeScript parser is added
|
||||
; ; CoffeeScript: Text.Coffee
|
||||
; (quasiquote
|
||||
; (quoter) @_name
|
||||
; (#eq? @_name "coffee")
|
||||
; ((quasiquote_body) @coffeescript)
|
||||
|
||||
; CSS: Text.Cassius, Text.Lucius
|
||||
(quasiquote
|
||||
(quoter) @_name
|
||||
(#any-of? @_name "cassius" "lucius")
|
||||
((quasiquote_body) @css)
|
||||
)
|
||||
|
||||
; HTML: Text.Hamlet
|
||||
(quasiquote
|
||||
(quoter) @_name
|
||||
(#any-of? @_name "shamlet" "xshamlet" "hamlet" "xhamlet" "ihamlet")
|
||||
((quasiquote_body) @html)
|
||||
)
|
||||
|
||||
; JS: Text.Julius
|
||||
(quasiquote
|
||||
(quoter) @_name
|
||||
(#any-of? @_name "js" "julius")
|
||||
((quasiquote_body) @javascript)
|
||||
)
|
||||
|
||||
; TS: Text.TypeScript
|
||||
(quasiquote
|
||||
(quoter) @_name
|
||||
(#any-of? @_name "tsc" "tscJSX")
|
||||
((quasiquote_body) @typescript)
|
||||
)
|
||||
|
||||
|
||||
;; -----------------------------------------------------------------------------
|
||||
;; HSX
|
||||
|
||||
(quasiquote
|
||||
(quoter) @_name
|
||||
(#eq? @_name "hsx")
|
||||
((quasiquote_body) @html)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue