Skip to content

Commit 3da0e25

Browse files
authored
enh(twig) add Symphony keywords to twig (#3453)
1 parent 8cea942 commit 3da0e25

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ These changes should be for the better and should not be super noticeable but if
6161

6262
Grammars:
6363

64+
- enh(twig) update keywords list for symfony (#3453) [Matthieu Lempereur][]
6465
- enh(arcade) updated to ArcGIS Arcade version 1.16 [John Foster][]
6566
- enh(php) Left and right-side of double colon [Wojciech Kania][]
6667
- enh(php) add PHP constants [Wojciech Kania][]

src/languages/twig.js

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,51 @@ Category: template
1010
export default function(hljs) {
1111
const regex = hljs.regex;
1212
const FUNCTION_NAMES = [
13+
"absolute_url",
14+
"asset|0",
15+
"asset_version",
1316
"attribute",
1417
"block",
1518
"constant",
19+
"controller|0",
1620
"country_timezones",
21+
"csrf_token",
1722
"cycle",
1823
"date",
1924
"dump",
25+
"expression",
26+
"form|0",
27+
"form_end",
28+
"form_errors",
29+
"form_help",
30+
"form_label",
31+
"form_rest",
32+
"form_row",
33+
"form_start",
34+
"form_widget",
2035
"html_classes",
2136
"include",
37+
"is_granted",
38+
"logout_path",
39+
"logout_url",
2240
"max",
2341
"min",
2442
"parent",
43+
"path|0",
2544
"random",
2645
"range",
46+
"relative_path",
47+
"render",
48+
"render_esi",
2749
"source",
28-
"template_from_string"
50+
"template_from_string",
51+
"url|0"
2952
];
3053

3154
const FILTERS = [
3255
"abs",
56+
"abbr_class",
57+
"abbr_method",
3358
"batch",
3459
"capitalize",
3560
"column",
@@ -42,15 +67,23 @@ export default function(hljs) {
4267
"date_modify",
4368
"default",
4469
"escape",
70+
"file_excerpt",
71+
"file_link",
72+
"file_relative",
4573
"filter",
4674
"first",
4775
"format",
76+
"format_args",
77+
"format_args_as_text",
4878
"format_currency",
4979
"format_date",
5080
"format_datetime",
81+
"format_file",
82+
"format_file_from_text",
5183
"format_number",
5284
"format_time",
5385
"html_to_markdown",
86+
"humanize",
5487
"inky_to_html",
5588
"inline_css",
5689
"join",
@@ -80,10 +113,14 @@ export default function(hljs) {
80113
"striptags",
81114
"timezone_name",
82115
"title",
116+
"trans",
117+
"transchoice",
83118
"trim",
84119
"u|0",
85120
"upper",
86-
"url_encode"
121+
"url_encode",
122+
"yaml_dump",
123+
"yaml_encode"
87124
];
88125

89126
let TAG_NAMES = [
@@ -98,13 +135,18 @@ export default function(hljs) {
98135
"filter",
99136
"flush",
100137
"for",
138+
"form_theme",
101139
"from",
102140
"if",
103141
"import",
104142
"include",
105143
"macro",
106144
"sandbox",
107145
"set",
146+
"stopwatch",
147+
"trans",
148+
"trans_default_domain",
149+
"transchoice",
108150
"use",
109151
"verbatim",
110152
"with"

0 commit comments

Comments
 (0)