From 3da0e25dc5730799614470d78db28c3c62346910 Mon Sep 17 00:00:00 2001 From: MrYamous Date: Sat, 12 Mar 2022 00:45:19 +0100 Subject: [PATCH] enh(twig) add Symphony keywords to `twig` (#3453) --- CHANGES.md | 1 + src/languages/twig.js | 46 +++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 78adafe977..2b4f8e92a1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -61,6 +61,7 @@ These changes should be for the better and should not be super noticeable but if Grammars: +- enh(twig) update keywords list for symfony (#3453) [Matthieu Lempereur][] - enh(arcade) updated to ArcGIS Arcade version 1.16 [John Foster][] - enh(php) Left and right-side of double colon [Wojciech Kania][] - enh(php) add PHP constants [Wojciech Kania][] diff --git a/src/languages/twig.js b/src/languages/twig.js index f8345a4374..a4757d6037 100644 --- a/src/languages/twig.js +++ b/src/languages/twig.js @@ -10,26 +10,51 @@ Category: template export default function(hljs) { const regex = hljs.regex; const FUNCTION_NAMES = [ + "absolute_url", + "asset|0", + "asset_version", "attribute", "block", "constant", + "controller|0", "country_timezones", + "csrf_token", "cycle", "date", "dump", + "expression", + "form|0", + "form_end", + "form_errors", + "form_help", + "form_label", + "form_rest", + "form_row", + "form_start", + "form_widget", "html_classes", "include", + "is_granted", + "logout_path", + "logout_url", "max", "min", "parent", + "path|0", "random", "range", + "relative_path", + "render", + "render_esi", "source", - "template_from_string" + "template_from_string", + "url|0" ]; const FILTERS = [ "abs", + "abbr_class", + "abbr_method", "batch", "capitalize", "column", @@ -42,15 +67,23 @@ export default function(hljs) { "date_modify", "default", "escape", + "file_excerpt", + "file_link", + "file_relative", "filter", "first", "format", + "format_args", + "format_args_as_text", "format_currency", "format_date", "format_datetime", + "format_file", + "format_file_from_text", "format_number", "format_time", "html_to_markdown", + "humanize", "inky_to_html", "inline_css", "join", @@ -80,10 +113,14 @@ export default function(hljs) { "striptags", "timezone_name", "title", + "trans", + "transchoice", "trim", "u|0", "upper", - "url_encode" + "url_encode", + "yaml_dump", + "yaml_encode" ]; let TAG_NAMES = [ @@ -98,6 +135,7 @@ export default function(hljs) { "filter", "flush", "for", + "form_theme", "from", "if", "import", @@ -105,6 +143,10 @@ export default function(hljs) { "macro", "sandbox", "set", + "stopwatch", + "trans", + "trans_default_domain", + "transchoice", "use", "verbatim", "with"