mirror of https://github.com/helix-editor/helix
Add support for Pug language (#13435)
parent
ece12dd74d
commit
4784650ccf
|
@ -180,6 +180,7 @@
|
|||
| prolog | ✓ | | ✓ | `swipl` |
|
||||
| protobuf | ✓ | ✓ | ✓ | `buf`, `pb`, `protols` |
|
||||
| prql | ✓ | | | |
|
||||
| pug | ✓ | | | |
|
||||
| purescript | ✓ | ✓ | | `purescript-language-server` |
|
||||
| python | ✓ | ✓ | ✓ | `ruff`, `jedi-language-server`, `pylsp` |
|
||||
| qml | ✓ | | ✓ | `qmlls` |
|
||||
|
|
|
@ -4313,3 +4313,14 @@ comment-tokens = "#"
|
|||
[[grammar]]
|
||||
name = "debian"
|
||||
source = { git = "https://gitlab.com/MggMuggins/tree-sitter-debian", rev = "9b3f4b78c45aab8a2f25a5f9e7bbc00995bc3dde" }
|
||||
|
||||
[[language]]
|
||||
name = "pug"
|
||||
scope = "source.pug"
|
||||
file-types = ["pug"]
|
||||
comment-tokens = ["//", "//-"]
|
||||
indent = { tab-width = 2, unit = " " }
|
||||
|
||||
[[grammar]]
|
||||
name = "pug"
|
||||
source = { git = "https://github.com/zealot128/tree-sitter-pug", rev = "13e9195370172c86a8b88184cc358b23b677cc46" }
|
||||
|
|
|
@ -0,0 +1,97 @@
|
|||
(comment) @comment
|
||||
|
||||
(
|
||||
doctype
|
||||
(("doctype") @keyword.storage.type)
|
||||
((doctype_name) @type.enum.variant)
|
||||
)
|
||||
|
||||
(tag_name) @constant
|
||||
|
||||
; Attributes
|
||||
(id) @attribute
|
||||
(class) @attribute
|
||||
(attribute_name) @attribute
|
||||
|
||||
(quoted_attribute_value) @string
|
||||
|
||||
; Controls
|
||||
(
|
||||
conditional
|
||||
((keyword) @keyword.control.conditional)
|
||||
)
|
||||
(
|
||||
case
|
||||
((keyword) @keyword.control)
|
||||
(
|
||||
when
|
||||
((keyword) @keyword.control)
|
||||
)
|
||||
)
|
||||
(
|
||||
each
|
||||
((keyword) @keyword.control.repeat)
|
||||
)
|
||||
(
|
||||
else
|
||||
((keyword) @keyword.control.conditional)
|
||||
)
|
||||
(
|
||||
while
|
||||
((keyword) @keyword.control.repeat)
|
||||
)
|
||||
|
||||
; Mixins
|
||||
(
|
||||
mixin_definition
|
||||
((keyword) @keyword.function)
|
||||
((mixin_name) @function.method)
|
||||
)
|
||||
(
|
||||
mixin_use
|
||||
(("+") @operator)
|
||||
((mixin_name) @function.method)
|
||||
)
|
||||
|
||||
; Includes
|
||||
(
|
||||
include
|
||||
((keyword) @keyword.directive)
|
||||
((filename) @string.special.path)
|
||||
)
|
||||
|
||||
; Inheritance
|
||||
(
|
||||
extends
|
||||
((keyword) @keyword.directive)
|
||||
((filename) @string.special.path)
|
||||
)
|
||||
(
|
||||
block_definition
|
||||
((keyword) @keyword.directive)
|
||||
((block_name) @function.method)
|
||||
)
|
||||
(
|
||||
block_append
|
||||
((keyword) @keyword.directive)
|
||||
((block_name) @function.method)
|
||||
)
|
||||
(
|
||||
block_prepend
|
||||
((keyword) @keyword.directive)
|
||||
((block_name) @function.method)
|
||||
)
|
||||
|
||||
; Filters
|
||||
(
|
||||
filter
|
||||
(":" @function.macro)
|
||||
((filter_name) @function.macro)
|
||||
((content) @special)
|
||||
)
|
||||
|
||||
; Inline JavaScript
|
||||
(
|
||||
unbuffered_code
|
||||
(("-") @special)
|
||||
)
|
|
@ -0,0 +1,3 @@
|
|||
((javascript) @injection.content
|
||||
(#set! injection.language "javascript")
|
||||
)
|
Loading…
Reference in New Issue