Skip to content

Commit bb9fc1a

Browse files
committed
feat: Add Twig support
1 parent 26885d0 commit bb9fc1a

File tree

5 files changed

+68
-0
lines changed

5 files changed

+68
-0
lines changed

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,3 +520,9 @@
520520
update = none
521521
ignore = dirty
522522
branch = main
523+
[submodule "repos/twig"]
524+
path = repos/twig
525+
url = https://github.com/gbprod/tree-sitter-twig
526+
update = none
527+
ignore = dirty
528+
branch = main

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Changelog
22

33
## Unreleased
4+
- Add `Twig` support
45

56
## 0.12.77 - 2023-11-05
67

queries/twig/highlights.scm

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
(comment) @comment
2+
3+
(filter_identifier) @function.call
4+
(function_identifier) @function.call
5+
(test) @function.builtin
6+
(variable) @variable
7+
(string) @string
8+
(interpolated_string) @string
9+
(operator) @operator
10+
(number) @number
11+
(boolean) @constant.builtin
12+
(null) @constant.builtin
13+
(keyword) @keyword
14+
(attribute) @attribute
15+
(tag) @tag
16+
(conditional) @conditional
17+
(repeat) @repeat
18+
(method) @method
19+
(parameter) @parameter
20+
21+
[
22+
"{{"
23+
"}}"
24+
"{{-"
25+
"-}}"
26+
"{{~"
27+
"~}}"
28+
"{%"
29+
"%}"
30+
"{%-"
31+
"-%}"
32+
"{%~"
33+
"~%}"
34+
] @tag.delimiter
35+
36+
[
37+
","
38+
"."
39+
"?"
40+
":"
41+
"="
42+
] @punctuation.delimiter
43+
44+
(interpolated_string [
45+
"#{"
46+
"}"
47+
] @punctuation.delimiter)
48+
49+
[
50+
"("
51+
")"
52+
"["
53+
"]"
54+
"{"
55+
] @punctuation.bracket
56+
57+
(hash [
58+
"}"
59+
] @punctuation.bracket)

repos/twig

Submodule twig added at eaf80e6

tree-sitter-langs.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ See `tree-sitter-langs-repos'."
195195
(conf-toml-mode . toml)
196196
(tcl-mode . tcl)
197197
(tuareg-mode . ocaml)
198+
(twig-mode . twig)
198199
(typescript-mode . typescript)
199200
(typst-mode . typst)
200201
(verilog-mode . verilog)

0 commit comments

Comments
 (0)