From 8a5216624aa82600c664430959d3e8ba1588984d Mon Sep 17 00:00:00 2001 From: deathaxe Date: Sat, 19 Oct 2024 18:07:26 +0200 Subject: [PATCH] Change indentation style to tabs --- Completions/Twig Filters.sublime-completions | 654 +++++++++--------- .../Twig Function Names.sublime-completions | 200 +++--- .../Twig Functions.sublime-completions | 232 +++---- Completions/Twig Loops.sublime-completions | 118 ++-- Completions/Twig Tags.sublime-completions | 440 ++++++------ Completions/Twig Tests.sublime-completions | 134 ++-- Default.sublime-commands | 16 +- Default.sublime-keymap | 438 ++++++------ Main.sublime-menu | 68 +- 9 files changed, 1150 insertions(+), 1150 deletions(-) diff --git a/Completions/Twig Filters.sublime-completions b/Completions/Twig Filters.sublime-completions index bb60bef..101c511 100644 --- a/Completions/Twig Filters.sublime-completions +++ b/Completions/Twig Filters.sublime-completions @@ -1,329 +1,329 @@ { - "scope": "source.twig meta.filter", - "completions": [ - { - "trigger": "abs", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Returns the absolute value.", - }, - { - "trigger": "batch", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Batches items by returning a list of lists with the given number of items.", - }, - { - "trigger": "capitalize", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Capitalizes a value.", - }, - { - "trigger": "column", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Returns the values from a single column in the input array.", - }, - { - "trigger": "convert_encoding", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Converts a string from one encoding to another.", - }, - { - "trigger": "country_name", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Returns the country name given its ISO-3166 two-letter code.", - }, - { - "trigger": "currency_name", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Returns the currency name given its three-letter code.", - }, - { - "trigger": "currency_symbol", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Returns the currency symbol given its three-letter code.", - }, - { - "trigger": "data_uri", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Generates a URL using the data scheme as defined in RFC 2397.", - }, - { - "trigger": "date", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Formats a date to a given format.", - }, - { - "trigger": "date_modify", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Modifies a date with a given modifier string.", - }, - { - "trigger": "default", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Returns the passed default value if the value is undefined or empty.", - }, - { - "trigger": "escape", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Escapes a string using strategies that depend on the context.", - }, - { - "trigger": "filter", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Filters elements of a sequence or a mapping using an arrow function.", - }, - { - "trigger": "first", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Returns the first element of a sequence, a mapping, or a string.", - }, - { - "trigger": "format", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Formats a given string by replacing the placeholders.", - }, - { - "trigger": "format_currency", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Formats a number as a currency.", - }, - { - "trigger": "format_date", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Formats a date.", - }, - { - "trigger": "format_datetime", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Formats a date time.", - }, - { - "trigger": "format_number", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Formats a number.", - }, - { - "trigger": "format_time", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Formats the given time.", - }, - { - "trigger": "html_to_markdown", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Converts a block of HTML to Markdown.", - }, - { - "trigger": "inline_css", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Inlines CSS styles in HTML documents.", - }, - { - "trigger": "inky_to_html", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Processes an inky email template.", - }, - { - "trigger": "join", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Returns a string which is the concatenation of the items of a sequence.", - }, - { - "trigger": "json_encode", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Returns the JSON representation of a value.", - }, - { - "trigger": "keys", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Returns the keys of an array.", - }, - { - "trigger": "language_name", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Returns the language name given its two-letter code.", - }, - { - "trigger": "last", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Returns the last element of a sequence, a mapping, or a string.", - }, - { - "trigger": "length", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Returns the number of items of a sequence, mapping or a string.", - }, - { - "trigger": "locale_name", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Returns the locale name given its two-letter code.", - }, - { - "trigger": "lower", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Converts a value to lowercase.", - }, - { - "trigger": "map", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Applies an arrow function to the elements of a sequence or a mapping.", - }, - { - "trigger": "markdown_to_html", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Converts a block of Markdown to HTML.", - }, - { - "trigger": "merge", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Merges an array with another array.", - }, - { - "trigger": "nl2br", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Inserts HTML line breaks before all newlines in a string.", - }, - { - "trigger": "number_format", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Formats numbers.", - }, - { - "trigger": "raw", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Marks the value as being safe.", - }, - { - "trigger": "reduce", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Iteratively reduces a sequence or a mapping to a single value using an arrow function.", - }, - { - "trigger": "replace", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Formats a given string by replacing the placeholders.", - }, - { - "trigger": "reverse", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Reverses a sequence, a mapping, or a string.", - }, - { - "trigger": "round", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Rounds a number to a given precision.", - }, - { - "trigger": "slice", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Extracts a slice of a sequence, a mapping, or a string.", - }, - { - "trigger": "slug", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Transforms a given string into another string that only includes safe ASCII characters.", - }, - { - "trigger": "sort", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Sorts an array.", - }, - { - "trigger": "spaceless", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Remove whitespace between HTML tags.", - }, - { - "trigger": "split", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Splits a string by the given delimiter and returns a list of strings.", - }, - { - "trigger": "striptags", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Strips SGML/XML tags and replace adjacent whitespace by one space.", - }, - { - "trigger": "timezone_name", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Returns the timezone name given a timezone identifier.", - }, - { - "trigger": "title", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Returns a titlecased version of the value.", - }, - { - "trigger": "trim", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Strips whitespace from beginning & end of a string.", - }, - { - "trigger": "u", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Wraps a text in a Unicode object.", - }, - { - "trigger": "upper", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Converts a value to uppercase.", - }, - { - "trigger": "url_encode", - "kind": ["namespace", "f", "Twig Filter"], - "annotation": "Twig Filter", - "details": "Percent encodes a given string as URL segment or an array.", - }, - ], + "scope": "source.twig meta.filter", + "completions": [ + { + "trigger": "abs", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Returns the absolute value.", + }, + { + "trigger": "batch", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Batches items by returning a list of lists with the given number of items.", + }, + { + "trigger": "capitalize", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Capitalizes a value.", + }, + { + "trigger": "column", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Returns the values from a single column in the input array.", + }, + { + "trigger": "convert_encoding", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Converts a string from one encoding to another.", + }, + { + "trigger": "country_name", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Returns the country name given its ISO-3166 two-letter code.", + }, + { + "trigger": "currency_name", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Returns the currency name given its three-letter code.", + }, + { + "trigger": "currency_symbol", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Returns the currency symbol given its three-letter code.", + }, + { + "trigger": "data_uri", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Generates a URL using the data scheme as defined in RFC 2397.", + }, + { + "trigger": "date", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Formats a date to a given format.", + }, + { + "trigger": "date_modify", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Modifies a date with a given modifier string.", + }, + { + "trigger": "default", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Returns the passed default value if the value is undefined or empty.", + }, + { + "trigger": "escape", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Escapes a string using strategies that depend on the context.", + }, + { + "trigger": "filter", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Filters elements of a sequence or a mapping using an arrow function.", + }, + { + "trigger": "first", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Returns the first element of a sequence, a mapping, or a string.", + }, + { + "trigger": "format", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Formats a given string by replacing the placeholders.", + }, + { + "trigger": "format_currency", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Formats a number as a currency.", + }, + { + "trigger": "format_date", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Formats a date.", + }, + { + "trigger": "format_datetime", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Formats a date time.", + }, + { + "trigger": "format_number", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Formats a number.", + }, + { + "trigger": "format_time", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Formats the given time.", + }, + { + "trigger": "html_to_markdown", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Converts a block of HTML to Markdown.", + }, + { + "trigger": "inline_css", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Inlines CSS styles in HTML documents.", + }, + { + "trigger": "inky_to_html", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Processes an inky email template.", + }, + { + "trigger": "join", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Returns a string which is the concatenation of the items of a sequence.", + }, + { + "trigger": "json_encode", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Returns the JSON representation of a value.", + }, + { + "trigger": "keys", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Returns the keys of an array.", + }, + { + "trigger": "language_name", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Returns the language name given its two-letter code.", + }, + { + "trigger": "last", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Returns the last element of a sequence, a mapping, or a string.", + }, + { + "trigger": "length", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Returns the number of items of a sequence, mapping or a string.", + }, + { + "trigger": "locale_name", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Returns the locale name given its two-letter code.", + }, + { + "trigger": "lower", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Converts a value to lowercase.", + }, + { + "trigger": "map", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Applies an arrow function to the elements of a sequence or a mapping.", + }, + { + "trigger": "markdown_to_html", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Converts a block of Markdown to HTML.", + }, + { + "trigger": "merge", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Merges an array with another array.", + }, + { + "trigger": "nl2br", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Inserts HTML line breaks before all newlines in a string.", + }, + { + "trigger": "number_format", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Formats numbers.", + }, + { + "trigger": "raw", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Marks the value as being safe.", + }, + { + "trigger": "reduce", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Iteratively reduces a sequence or a mapping to a single value using an arrow function.", + }, + { + "trigger": "replace", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Formats a given string by replacing the placeholders.", + }, + { + "trigger": "reverse", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Reverses a sequence, a mapping, or a string.", + }, + { + "trigger": "round", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Rounds a number to a given precision.", + }, + { + "trigger": "slice", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Extracts a slice of a sequence, a mapping, or a string.", + }, + { + "trigger": "slug", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Transforms a given string into another string that only includes safe ASCII characters.", + }, + { + "trigger": "sort", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Sorts an array.", + }, + { + "trigger": "spaceless", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Remove whitespace between HTML tags.", + }, + { + "trigger": "split", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Splits a string by the given delimiter and returns a list of strings.", + }, + { + "trigger": "striptags", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Strips SGML/XML tags and replace adjacent whitespace by one space.", + }, + { + "trigger": "timezone_name", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Returns the timezone name given a timezone identifier.", + }, + { + "trigger": "title", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Returns a titlecased version of the value.", + }, + { + "trigger": "trim", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Strips whitespace from beginning & end of a string.", + }, + { + "trigger": "u", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Wraps a text in a Unicode object.", + }, + { + "trigger": "upper", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Converts a value to uppercase.", + }, + { + "trigger": "url_encode", + "kind": ["namespace", "f", "Twig Filter"], + "annotation": "Twig Filter", + "details": "Percent encodes a given string as URL segment or an array.", + }, + ], } diff --git a/Completions/Twig Function Names.sublime-completions b/Completions/Twig Function Names.sublime-completions index 82ac410..5cb3dba 100644 --- a/Completions/Twig Function Names.sublime-completions +++ b/Completions/Twig Function Names.sublime-completions @@ -1,103 +1,103 @@ { - // Only complete names without trailing signature + // Only complete names without trailing signature - "scope": "source.twig meta.function-call.identifier", - "completions": [ - { - "trigger": "attribute", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Can be used to access a 'dynamic' attribute of a variable.", - }, - { - "trigger": "block", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Can be used to display one block from another template.", - }, - { - "trigger": "constant", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Returns the constant value for a given string.", - }, - { - "trigger": "cycle", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Cycles on an array of values.", - }, - { - "trigger": "date", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Converts an argument to a date to allow date comparison.", - }, - { - "trigger": "dump", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Dumps information about a template variable.", - }, - { - "trigger": "html_classes", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Returns a string by conditionally joining class names together.", - }, - { - "trigger": "include", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Returns the rendered content of a template.", - }, - { - "trigger": "max", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Returns the biggest value of a sequence or a set of values.", - }, - { - "trigger": "min", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Returns the smallest value of a sequence or a set of values.", - }, - { - "trigger": "parent", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Renders the contents of the parent block.", - }, - { - "trigger": "random", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Returns a random value depending on the supplied parameter type.", - }, - { - "trigger": "range", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Returns a list containing an arithmetic progression of integers.", - }, - { - "trigger": "source", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Returns the content of a template without rendering it.", - }, - { - "trigger": "country_timezones", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Returns the names of the timezones associated with a given country code.", - }, - { - "trigger": "template_from_string", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Loads a template from a string.", - }, - ], + "scope": "source.twig meta.function-call.identifier", + "completions": [ + { + "trigger": "attribute", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Can be used to access a 'dynamic' attribute of a variable.", + }, + { + "trigger": "block", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Can be used to display one block from another template.", + }, + { + "trigger": "constant", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Returns the constant value for a given string.", + }, + { + "trigger": "cycle", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Cycles on an array of values.", + }, + { + "trigger": "date", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Converts an argument to a date to allow date comparison.", + }, + { + "trigger": "dump", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Dumps information about a template variable.", + }, + { + "trigger": "html_classes", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Returns a string by conditionally joining class names together.", + }, + { + "trigger": "include", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Returns the rendered content of a template.", + }, + { + "trigger": "max", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Returns the biggest value of a sequence or a set of values.", + }, + { + "trigger": "min", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Returns the smallest value of a sequence or a set of values.", + }, + { + "trigger": "parent", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Renders the contents of the parent block.", + }, + { + "trigger": "random", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Returns a random value depending on the supplied parameter type.", + }, + { + "trigger": "range", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Returns a list containing an arithmetic progression of integers.", + }, + { + "trigger": "source", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Returns the content of a template without rendering it.", + }, + { + "trigger": "country_timezones", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Returns the names of the timezones associated with a given country code.", + }, + { + "trigger": "template_from_string", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Loads a template from a string.", + }, + ], } diff --git a/Completions/Twig Functions.sublime-completions b/Completions/Twig Functions.sublime-completions index 849e13f..045e4bd 100644 --- a/Completions/Twig Functions.sublime-completions +++ b/Completions/Twig Functions.sublime-completions @@ -1,119 +1,119 @@ { - // complete full function signature + // complete full function signature - "scope": "source.twig - source.twig meta.function-call.identifier", - "completions": [ - { - "trigger": "attribute", - "contents": "attribute($0)", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Can be used to access a 'dynamic' attribute of a variable.", - }, - { - "trigger": "block", - "contents": "block('${1:title}', '${2:template_name}')", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Can be used to display one block from another template.", - }, - { - "trigger": "constant", - "contents": "constant($0)", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Returns the constant value for a given string.", - }, - { - "trigger": "cycle", - "contents": "cycle($0)", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Cycles on an array of values.", - }, - { - "trigger": "date", - "contents": "date($0)", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Converts an argument to a date to allow date comparison.", - }, - { - "trigger": "dump", - "contents": "dump($0)", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Dumps information about a template variable.", - }, - { - "trigger": "html_classes", - "contents": "html_classes($0)", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Returns a string by conditionally joining class names together.", - }, - { - "trigger": "include", - "contents": "include($0)", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Returns the rendered content of a template.", - }, - { - "trigger": "max", - "contents": "max($0)", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Returns the biggest value of a sequence or a set of values.", - }, - { - "trigger": "min", - "contents": "min($0)", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Returns the smallest value of a sequence or a set of values.", - }, - { - "trigger": "parent", - "contents": "parent($0)", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Renders the contents of the parent block.", - }, - { - "trigger": "random", - "contents": "random($0)", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Returns a random value depending on the supplied parameter type.", - }, - { - "trigger": "range", - "contents": "range($0)", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Returns a list containing an arithmetic progression of integers.", - }, - { - "trigger": "source", - "contents": "source($0)", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Returns the content of a template without rendering it.", - }, - { - "trigger": "country_timezones", - "contents": "country_timezones($0)", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Returns the names of the timezones associated with a given country code.", - }, - { - "trigger": "template_from_string", - "contents": "template_from_string($0)", - "kind": ["function", "f", "Twig Function"], - "annotation": "Twig Function", - "details": "Loads a template from a string.", - }, - ], + "scope": "source.twig - source.twig meta.function-call.identifier", + "completions": [ + { + "trigger": "attribute", + "contents": "attribute($0)", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Can be used to access a 'dynamic' attribute of a variable.", + }, + { + "trigger": "block", + "contents": "block('${1:title}', '${2:template_name}')", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Can be used to display one block from another template.", + }, + { + "trigger": "constant", + "contents": "constant($0)", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Returns the constant value for a given string.", + }, + { + "trigger": "cycle", + "contents": "cycle($0)", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Cycles on an array of values.", + }, + { + "trigger": "date", + "contents": "date($0)", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Converts an argument to a date to allow date comparison.", + }, + { + "trigger": "dump", + "contents": "dump($0)", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Dumps information about a template variable.", + }, + { + "trigger": "html_classes", + "contents": "html_classes($0)", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Returns a string by conditionally joining class names together.", + }, + { + "trigger": "include", + "contents": "include($0)", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Returns the rendered content of a template.", + }, + { + "trigger": "max", + "contents": "max($0)", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Returns the biggest value of a sequence or a set of values.", + }, + { + "trigger": "min", + "contents": "min($0)", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Returns the smallest value of a sequence or a set of values.", + }, + { + "trigger": "parent", + "contents": "parent($0)", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Renders the contents of the parent block.", + }, + { + "trigger": "random", + "contents": "random($0)", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Returns a random value depending on the supplied parameter type.", + }, + { + "trigger": "range", + "contents": "range($0)", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Returns a list containing an arithmetic progression of integers.", + }, + { + "trigger": "source", + "contents": "source($0)", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Returns the content of a template without rendering it.", + }, + { + "trigger": "country_timezones", + "contents": "country_timezones($0)", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Returns the names of the timezones associated with a given country code.", + }, + { + "trigger": "template_from_string", + "contents": "template_from_string($0)", + "kind": ["function", "f", "Twig Function"], + "annotation": "Twig Function", + "details": "Loads a template from a string.", + }, + ], } diff --git a/Completions/Twig Loops.sublime-completions b/Completions/Twig Loops.sublime-completions index beb14b3..141da39 100644 --- a/Completions/Twig Loops.sublime-completions +++ b/Completions/Twig Loops.sublime-completions @@ -1,61 +1,61 @@ { - "scope": "source.twig", - "completions": [ - { - "trigger": "loop.index", - "contents": "loop.index", - "kind": ["variable", "v", "Twig Loop Variable"], - "annotation": "Loop Variable", - "details": "The current iteration of the loop (1 indexed).", - }, - { - "trigger": "loop.index0", - "contents": "loop.index0", - "kind": ["variable", "v", "Twig Loop Variable"], - "annotation": "Loop Variable", - "details": "The current iteration of the loop (0 indexed).", - }, - { - "trigger": "loop.revindex", - "contents": "loop.revindex", - "kind": ["variable", "v", "Twig Loop Variable"], - "annotation": "Loop Variable", - "details": "The number of iterations from the end of the loop (1 indexed).", - }, - { - "trigger": "loop.revindex0", - "contents": "loop.revindex0", - "kind": ["variable", "v", "Twig Loop Variable"], - "annotation": "Loop Variable", - "details": "The number of iterations from the end of the loop (0 indexed)", - }, - { - "trigger": "loop.first", - "contents": "loop.first", - "kind": ["variable", "v", "Twig Loop Variable"], - "annotation": "Loop Variable", - "details": "Checks if it is the first iteration.", - }, - { - "trigger": "loop.last", - "contents": "loop.last", - "kind": ["variable", "v", "Twig Loop Variable"], - "annotation": "Loop Variable", - "details": "Checks if it is the last iteration.", - }, - { - "trigger": "loop.length", - "contents": "loop.length", - "kind": ["variable", "v", "Twig Loop Variable"], - "annotation": "Loop Variable", - "details": "The number of items in the sequence.", - }, - { - "trigger": "loop.parent", - "contents": "loop.parent", - "kind": ["variable", "v", "Twig Loop Variable"], - "annotation": "Loop Variable", - "details": "The parent context.", - }, - ], + "scope": "source.twig", + "completions": [ + { + "trigger": "loop.index", + "contents": "loop.index", + "kind": ["variable", "v", "Twig Loop Variable"], + "annotation": "Loop Variable", + "details": "The current iteration of the loop (1 indexed).", + }, + { + "trigger": "loop.index0", + "contents": "loop.index0", + "kind": ["variable", "v", "Twig Loop Variable"], + "annotation": "Loop Variable", + "details": "The current iteration of the loop (0 indexed).", + }, + { + "trigger": "loop.revindex", + "contents": "loop.revindex", + "kind": ["variable", "v", "Twig Loop Variable"], + "annotation": "Loop Variable", + "details": "The number of iterations from the end of the loop (1 indexed).", + }, + { + "trigger": "loop.revindex0", + "contents": "loop.revindex0", + "kind": ["variable", "v", "Twig Loop Variable"], + "annotation": "Loop Variable", + "details": "The number of iterations from the end of the loop (0 indexed)", + }, + { + "trigger": "loop.first", + "contents": "loop.first", + "kind": ["variable", "v", "Twig Loop Variable"], + "annotation": "Loop Variable", + "details": "Checks if it is the first iteration.", + }, + { + "trigger": "loop.last", + "contents": "loop.last", + "kind": ["variable", "v", "Twig Loop Variable"], + "annotation": "Loop Variable", + "details": "Checks if it is the last iteration.", + }, + { + "trigger": "loop.length", + "contents": "loop.length", + "kind": ["variable", "v", "Twig Loop Variable"], + "annotation": "Loop Variable", + "details": "The number of items in the sequence.", + }, + { + "trigger": "loop.parent", + "contents": "loop.parent", + "kind": ["variable", "v", "Twig Loop Variable"], + "annotation": "Loop Variable", + "details": "The parent context.", + }, + ], } diff --git a/Completions/Twig Tags.sublime-completions b/Completions/Twig Tags.sublime-completions index d6c3c92..c2b92b3 100644 --- a/Completions/Twig Tags.sublime-completions +++ b/Completions/Twig Tags.sublime-completions @@ -1,222 +1,222 @@ { - "scope": "meta.embedded.statement.twig", - "completions": [ - { - "trigger": "apply", - "contents": "apply", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Apply Twig filters on a block of template data.", - }, - { - "trigger": "autoescape", - "contents": "autoescape", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Mark a section of a template to be escaped or not.", - }, - { - "trigger": "block", - "contents": "block", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Used for inheritance and act as placeholders and replacements at the same time.", - }, - { - "trigger": "cache", - "contents": "cache", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Cache a template fragment.", - }, - { - "trigger": "deprecated", - "contents": "deprecated", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Generates a deprecation notice.", - }, - { - "trigger": "do", - "contents": "do", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Works exactly like the regular variable expression, but doesn't print.", - }, - { - "trigger": "embed", - "contents": "embed", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Combines the behavior of include and extends.", - }, - { - "trigger": "extends", - "contents": "extends", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Can be used to extend a template from another one.", - }, - { - "trigger": "flush", - "contents": "flush", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Flush the output buffer.", - }, - { - "trigger": "for", - "contents": "for", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Loop over each item in a sequence.", - }, - { - "trigger": "if", - "contents": "if", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Conditional statement in Twig.", - }, - { - "trigger": "else", - "contents": "else", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Conditional statement in Twig.", - }, - { - "trigger": "import", - "contents": "import", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "The import tag imports macro names in a local variable.", - }, - { - "trigger": "include", - "contents": "include", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Includes a template and outputs the rendered content of that file.", - }, - { - "trigger": "macro", - "contents": "macro", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Comparable with functions in regular programming languages.", - }, - { - "trigger": "sandbox", - "contents": "sandbox", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Can be used to enable the sandboxing mode for an included template.", - }, - { - "trigger": "set", - "contents": "set", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Assign values to variables.", - }, - { - "trigger": "use", - "contents": "use", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Import the defined blocks into the current template.", - }, - { - "trigger": "verbatim", - "contents": "verbatim", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Marks sections as being raw text that should not be parsed.", - }, - { - "trigger": "with", - "contents": "with", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Creates a new inner scope.", - }, - { - "trigger": "endapply", - "contents": "endapply", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Ending tag for apply tag.", - }, - { - "trigger": "endautoescape", - "contents": "endautoescape", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Ending tag for autoescape tag.", - }, - { - "trigger": "endblock", - "contents": "endblock", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Ending tag for block tag.", - }, - { - "trigger": "endcache", - "contents": "endcache", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Ending tag for cache tag.", - }, - { - "trigger": "endembed", - "contents": "endembed", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Ending tag for embed tag.", - }, - { - "trigger": "endfor", - "contents": "endfor", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Ending tag for for tag.", - }, - { - "trigger": "endif", - "contents": "endif", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Ending tag for if tag.", - }, - { - "trigger": "endmacro", - "contents": "endmacro", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Ending tag for macro tag.", - }, - { - "trigger": "endsandbox", - "contents": "endsandbox", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Ending tag for sandbox tag.", - }, - { - "trigger": "endverbatim", - "contents": "endverbatim", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Ending tag for verbatim tag.", - }, - { - "trigger": "endwith", - "contents": "endwith", - "kind": ["markup", "t", "Twig Tag"], - "annotation": "Twig Tag", - "details": "Ending tag for with tag.", - }, - ], + "scope": "meta.embedded.statement.twig", + "completions": [ + { + "trigger": "apply", + "contents": "apply", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Apply Twig filters on a block of template data.", + }, + { + "trigger": "autoescape", + "contents": "autoescape", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Mark a section of a template to be escaped or not.", + }, + { + "trigger": "block", + "contents": "block", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Used for inheritance and act as placeholders and replacements at the same time.", + }, + { + "trigger": "cache", + "contents": "cache", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Cache a template fragment.", + }, + { + "trigger": "deprecated", + "contents": "deprecated", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Generates a deprecation notice.", + }, + { + "trigger": "do", + "contents": "do", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Works exactly like the regular variable expression, but doesn't print.", + }, + { + "trigger": "embed", + "contents": "embed", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Combines the behavior of include and extends.", + }, + { + "trigger": "extends", + "contents": "extends", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Can be used to extend a template from another one.", + }, + { + "trigger": "flush", + "contents": "flush", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Flush the output buffer.", + }, + { + "trigger": "for", + "contents": "for", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Loop over each item in a sequence.", + }, + { + "trigger": "if", + "contents": "if", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Conditional statement in Twig.", + }, + { + "trigger": "else", + "contents": "else", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Conditional statement in Twig.", + }, + { + "trigger": "import", + "contents": "import", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "The import tag imports macro names in a local variable.", + }, + { + "trigger": "include", + "contents": "include", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Includes a template and outputs the rendered content of that file.", + }, + { + "trigger": "macro", + "contents": "macro", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Comparable with functions in regular programming languages.", + }, + { + "trigger": "sandbox", + "contents": "sandbox", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Can be used to enable the sandboxing mode for an included template.", + }, + { + "trigger": "set", + "contents": "set", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Assign values to variables.", + }, + { + "trigger": "use", + "contents": "use", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Import the defined blocks into the current template.", + }, + { + "trigger": "verbatim", + "contents": "verbatim", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Marks sections as being raw text that should not be parsed.", + }, + { + "trigger": "with", + "contents": "with", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Creates a new inner scope.", + }, + { + "trigger": "endapply", + "contents": "endapply", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Ending tag for apply tag.", + }, + { + "trigger": "endautoescape", + "contents": "endautoescape", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Ending tag for autoescape tag.", + }, + { + "trigger": "endblock", + "contents": "endblock", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Ending tag for block tag.", + }, + { + "trigger": "endcache", + "contents": "endcache", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Ending tag for cache tag.", + }, + { + "trigger": "endembed", + "contents": "endembed", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Ending tag for embed tag.", + }, + { + "trigger": "endfor", + "contents": "endfor", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Ending tag for for tag.", + }, + { + "trigger": "endif", + "contents": "endif", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Ending tag for if tag.", + }, + { + "trigger": "endmacro", + "contents": "endmacro", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Ending tag for macro tag.", + }, + { + "trigger": "endsandbox", + "contents": "endsandbox", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Ending tag for sandbox tag.", + }, + { + "trigger": "endverbatim", + "contents": "endverbatim", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Ending tag for verbatim tag.", + }, + { + "trigger": "endwith", + "contents": "endwith", + "kind": ["markup", "t", "Twig Tag"], + "annotation": "Twig Tag", + "details": "Ending tag for with tag.", + }, + ], } diff --git a/Completions/Twig Tests.sublime-completions b/Completions/Twig Tests.sublime-completions index e5d74e4..83f9223 100644 --- a/Completions/Twig Tests.sublime-completions +++ b/Completions/Twig Tests.sublime-completions @@ -1,70 +1,70 @@ { - // complete full function signature + // complete full function signature - "scope": "source.twig meta.expression.test", - "completions": [ - { - "trigger": "constant", - "contents": "constant($0)", - "kind": ["type", "t", "Twig Test"], - "annotation": "Twig Test", - "details": "Checks if a variable has the exact same value as a constant.", - }, - { - "trigger": "defined", - "contents": "defined", - "kind": ["type", "t", "Twig Test"], - "annotation": "Twig Test", - "details": "Checks if a variable is defined in the current context.", - }, - { - "trigger": "divisible by", - "contents": "divisible by($0)", - "kind": ["type", "t", "Twig Test"], - "annotation": "Twig Test", - "details": "Checks if a variable is divisible by a number.", - }, - { - "trigger": "empty", - "contents": "empty", - "kind": ["type", "t", "Twig Test"], - "annotation": "Twig Test", - "details": "Checks if a variable is an empty string, an empty array, an empty hash, exactly false, or exactly null.", - }, - { - "trigger": "even", - "contents": "even", - "kind": ["type", "t", "Twig Test"], - "annotation": "Twig Test", - "details": "Checks if the given number is even.", - }, - { - "trigger": "odd", - "contents": "odd", - "kind": ["type", "t", "Twig Test"], - "annotation": "Twig Test", - "details": "Checks if the given number is odd.", - }, - { - "trigger": "iterable", - "contents": "iterable", - "kind": ["type", "t", "Twig Test"], - "annotation": "Twig Test", - "details": "Checks if a variable is an array or a traversable object.", - }, - { - "trigger": "null", - "contents": "null", - "kind": ["type", "t", "Twig Test"], - "annotation": "Twig Test", - "details": "Checks if the variable is null.", - }, - { - "trigger": "same as", - "contents": "same as($0)", - "kind": ["type", "t", "Twig Test"], - "annotation": "Twig Test", - "details": "Checks if a variable is the same as another variable.", - }, - ], + "scope": "source.twig meta.expression.test", + "completions": [ + { + "trigger": "constant", + "contents": "constant($0)", + "kind": ["type", "t", "Twig Test"], + "annotation": "Twig Test", + "details": "Checks if a variable has the exact same value as a constant.", + }, + { + "trigger": "defined", + "contents": "defined", + "kind": ["type", "t", "Twig Test"], + "annotation": "Twig Test", + "details": "Checks if a variable is defined in the current context.", + }, + { + "trigger": "divisible by", + "contents": "divisible by($0)", + "kind": ["type", "t", "Twig Test"], + "annotation": "Twig Test", + "details": "Checks if a variable is divisible by a number.", + }, + { + "trigger": "empty", + "contents": "empty", + "kind": ["type", "t", "Twig Test"], + "annotation": "Twig Test", + "details": "Checks if a variable is an empty string, an empty array, an empty hash, exactly false, or exactly null.", + }, + { + "trigger": "even", + "contents": "even", + "kind": ["type", "t", "Twig Test"], + "annotation": "Twig Test", + "details": "Checks if the given number is even.", + }, + { + "trigger": "odd", + "contents": "odd", + "kind": ["type", "t", "Twig Test"], + "annotation": "Twig Test", + "details": "Checks if the given number is odd.", + }, + { + "trigger": "iterable", + "contents": "iterable", + "kind": ["type", "t", "Twig Test"], + "annotation": "Twig Test", + "details": "Checks if a variable is an array or a traversable object.", + }, + { + "trigger": "null", + "contents": "null", + "kind": ["type", "t", "Twig Test"], + "annotation": "Twig Test", + "details": "Checks if the variable is null.", + }, + { + "trigger": "same as", + "contents": "same as($0)", + "kind": ["type", "t", "Twig Test"], + "annotation": "Twig Test", + "details": "Checks if a variable is the same as another variable.", + }, + ], } diff --git a/Default.sublime-commands b/Default.sublime-commands index 66902e0..f44534c 100644 --- a/Default.sublime-commands +++ b/Default.sublime-commands @@ -1,10 +1,10 @@ [ - { - "caption": "Preferences: Twig Key Bindings", - "command": "edit_settings", - "args": { - "base_file": "${packages}/Twig/Default.sublime-keymap", - "default": "[\n\t${0}\n]\n" - } - } + { + "caption": "Preferences: Twig Key Bindings", + "command": "edit_settings", + "args": { + "base_file": "${packages}/Twig/Default.sublime-keymap", + "default": "[\n\t${0}\n]\n" + } + } ] diff --git a/Default.sublime-keymap b/Default.sublime-keymap index fa84b61..b751808 100644 --- a/Default.sublime-keymap +++ b/Default.sublime-keymap @@ -1,230 +1,230 @@ [ - // Auto-pair braces also in front of , : ; so starting embeddings in CSS properties and values works well. + // Auto-pair braces also in front of , : ; so starting embeddings in CSS properties and values works well. - { "keys": ["{"], "command": "insert_snippet", "args": {"contents": "{$0}"}, "context": - [ - { "key": "selector", "operator": "equal", "operand": "meta.template.twig - meta.template.twig meta.embedded - meta.template.twig string" }, - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "following_text", "operator": "regex_contains", "operand": "^(?:[ \t\\)\\]\\},:;]|$)", "match_all": true } - ] - }, + { "keys": ["{"], "command": "insert_snippet", "args": {"contents": "{$0}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "meta.template.twig - meta.template.twig meta.embedded - meta.template.twig string" }, + { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, + { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^(?:[ \t\\)\\]\\},:;]|$)", "match_all": true } + ] + }, - // Auto-pair braces also in front of closing ' and " in strings + // Auto-pair braces also in front of closing ' and " in strings - { "keys": ["{"], "command": "insert_snippet", "args": {"contents": "{$0}"}, "context": - [ - { "key": "selector", "operator": "equal", "operand": "meta.template.twig - meta.template.twig meta.embedded meta.template.twig string" }, - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "following_text", "operator": "regex_contains", "operand": "^(?:[ \t\\)\\]\\}\"',:;]|$)", "match_all": true } - ] - }, + { "keys": ["{"], "command": "insert_snippet", "args": {"contents": "{$0}"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "meta.template.twig - meta.template.twig meta.embedded meta.template.twig string" }, + { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, + { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^(?:[ \t\\)\\]\\}\"',:;]|$)", "match_all": true } + ] + }, - // Bindings for inserting and removing comment block. + // Bindings for inserting and removing comment block. - // Expand {|} to {# | #} when # is pressed - { - "keys": ["#"], - "command": "insert_snippet", - "args": { - "contents": "# ${0} #" - }, - "context": [ - { "key": "selector", "operator": "equal", "operand": "meta.template.twig - meta.template.twig meta.embedded - meta.template.twig comment - meta.template.twig string" }, - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "{$", "match_all": true }, - { "key": "following_text", "operator": "regex_contains", "operand": "^}", "match_all": true } - ], - }, - // Reduce {#|#} to | when backspace is pressed - { - "keys": ["backspace"], - "command": "chain", - "args": { - "commands": [ - {"command": "left_delete" }, - {"command": "right_delete" }, - {"command": "left_delete" }, - {"command": "right_delete" } - ] - }, - "context": [ - { "key": "selector", "operand": "meta.embedded.comment.twig" }, - { "key": "setting.auto_match_enabled", "operand": true }, - { "key": "selection_empty", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "{#$", "match_all": true }, - { "key": "following_text", "operator": "regex_contains", "operand": "^#}", "match_all": true } - ] - }, - // Expand {#|#} to {# | #} when space is pressed - { - "keys": [" "], - "command": "insert_snippet", - "args": { - "contents": " ${0} " - }, - "context": [ - { "key": "selector", "operand": "meta.embedded.comment.twig" }, - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "{#$", "match_all": true }, - { "key": "following_text", "operator": "regex_contains", "operand": "^#}", "match_all": true } - ], - }, - // Reduce {# | #} to {#|#} when backspace is pressed - { - "keys": ["backspace"], - "command": "chain", - "args": { - "commands": [ - {"command": "left_delete" }, - {"command": "right_delete" } - ] - }, - "context": [ - { "key": "selector", "operand": "meta.embedded.comment.twig" }, - { "key": "setting.auto_match_enabled", "operand": true }, - { "key": "selection_empty", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "{# $", "match_all": true }, - { "key": "following_text", "operator": "regex_contains", "operand": "^ #}", "match_all": true } - ] - }, + // Expand {|} to {# | #} when # is pressed + { + "keys": ["#"], + "command": "insert_snippet", + "args": { + "contents": "# ${0} #" + }, + "context": [ + { "key": "selector", "operator": "equal", "operand": "meta.template.twig - meta.template.twig meta.embedded - meta.template.twig comment - meta.template.twig string" }, + { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "{$", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^}", "match_all": true } + ], + }, + // Reduce {#|#} to | when backspace is pressed + { + "keys": ["backspace"], + "command": "chain", + "args": { + "commands": [ + {"command": "left_delete" }, + {"command": "right_delete" }, + {"command": "left_delete" }, + {"command": "right_delete" } + ] + }, + "context": [ + { "key": "selector", "operand": "meta.embedded.comment.twig" }, + { "key": "setting.auto_match_enabled", "operand": true }, + { "key": "selection_empty", "operand": true, "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "{#$", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^#}", "match_all": true } + ] + }, + // Expand {#|#} to {# | #} when space is pressed + { + "keys": [" "], + "command": "insert_snippet", + "args": { + "contents": " ${0} " + }, + "context": [ + { "key": "selector", "operand": "meta.embedded.comment.twig" }, + { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "{#$", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^#}", "match_all": true } + ], + }, + // Reduce {# | #} to {#|#} when backspace is pressed + { + "keys": ["backspace"], + "command": "chain", + "args": { + "commands": [ + {"command": "left_delete" }, + {"command": "right_delete" } + ] + }, + "context": [ + { "key": "selector", "operand": "meta.embedded.comment.twig" }, + { "key": "setting.auto_match_enabled", "operand": true }, + { "key": "selection_empty", "operand": true, "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "{# $", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^ #}", "match_all": true } + ] + }, - // Bindings for inserting and removing statement block. + // Bindings for inserting and removing statement block. - // Expand {|} to {% | %} when % is pressed - { - "keys": ["%"], - "command": "insert_snippet", - "args": { - "contents": "% ${0} %" - }, - "context": [ - { "key": "selector", "operator": "equal", "operand": "meta.template.twig - meta.template.twig meta.embedded - meta.template.twig comment - meta.template.twig string" }, - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "{$", "match_all": true }, - { "key": "following_text", "operator": "regex_contains", "operand": "^}", "match_all": true } - ], - }, - // Reduce {%|%} to | when backspace is pressed - { - "keys": ["backspace"], - "command": "chain", - "args": { - "commands": [ - {"command": "left_delete" }, - {"command": "right_delete" }, - {"command": "left_delete" }, - {"command": "right_delete" } - ] - }, - "context": [ - { "key": "selector", "operand": "meta.embedded.statement.twig" }, - { "key": "setting.auto_match_enabled", "operand": true }, - { "key": "selection_empty", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "{%$", "match_all": true }, - { "key": "following_text", "operator": "regex_contains", "operand": "^%}", "match_all": true } - ] - }, - // Expand {%|%} to {% | %} when space is pressed - { - "keys": [" "], - "command": "insert_snippet", - "args": { - "contents": " ${0} " - }, - "context": [ - { "key": "selector", "operand": "meta.embedded.statement.twig" }, - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "{%$", "match_all": true }, - { "key": "following_text", "operator": "regex_contains", "operand": "^%}", "match_all": true } - ], - }, - // Reduce {% | %} to {%|%} when backspace is pressed - { - "keys": ["backspace"], - "command": "chain", - "args": { - "commands": [ - {"command": "left_delete" }, - {"command": "right_delete" } - ] - }, - "context": [ - { "key": "selector", "operand": "meta.embedded.statement.twig" }, - { "key": "setting.auto_match_enabled", "operand": true }, - { "key": "selection_empty", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "{% $", "match_all": true }, - { "key": "following_text", "operator": "regex_contains", "operand": "^ %}", "match_all": true } - ] - }, + // Expand {|} to {% | %} when % is pressed + { + "keys": ["%"], + "command": "insert_snippet", + "args": { + "contents": "% ${0} %" + }, + "context": [ + { "key": "selector", "operator": "equal", "operand": "meta.template.twig - meta.template.twig meta.embedded - meta.template.twig comment - meta.template.twig string" }, + { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "{$", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^}", "match_all": true } + ], + }, + // Reduce {%|%} to | when backspace is pressed + { + "keys": ["backspace"], + "command": "chain", + "args": { + "commands": [ + {"command": "left_delete" }, + {"command": "right_delete" }, + {"command": "left_delete" }, + {"command": "right_delete" } + ] + }, + "context": [ + { "key": "selector", "operand": "meta.embedded.statement.twig" }, + { "key": "setting.auto_match_enabled", "operand": true }, + { "key": "selection_empty", "operand": true, "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "{%$", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^%}", "match_all": true } + ] + }, + // Expand {%|%} to {% | %} when space is pressed + { + "keys": [" "], + "command": "insert_snippet", + "args": { + "contents": " ${0} " + }, + "context": [ + { "key": "selector", "operand": "meta.embedded.statement.twig" }, + { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "{%$", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^%}", "match_all": true } + ], + }, + // Reduce {% | %} to {%|%} when backspace is pressed + { + "keys": ["backspace"], + "command": "chain", + "args": { + "commands": [ + {"command": "left_delete" }, + {"command": "right_delete" } + ] + }, + "context": [ + { "key": "selector", "operand": "meta.embedded.statement.twig" }, + { "key": "setting.auto_match_enabled", "operand": true }, + { "key": "selection_empty", "operand": true, "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "{% $", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^ %}", "match_all": true } + ] + }, - // Bindings for inserting and removing expression block. + // Bindings for inserting and removing expression block. - // Expand {|} to {{ | }} when { is pressed - { - "keys": ["{"], - "command": "insert_snippet", - "args": { - "contents": "{ ${0} }" - }, - "context": [ - { "key": "selector", "operator": "equal", "operand": "meta.template.twig - meta.template.twig meta.embedded - meta.template.twig comment - meta.template.twig string" }, - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "{$", "match_all": true }, - { "key": "following_text", "operator": "regex_contains", "operand": "^}", "match_all": true } - ], - }, - // Reduce {{|}} to | when backspace is pressed - { - "keys": ["backspace"], - "command": "chain", - "args": { - "commands": [ - {"command": "left_delete" }, - {"command": "right_delete" }, - {"command": "left_delete" }, - {"command": "right_delete" } - ] - }, - "context": [ - { "key": "selector", "operand": "meta.embedded.expression.twig" }, - { "key": "setting.auto_match_enabled", "operand": true }, - { "key": "selection_empty", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "{{$", "match_all": true }, - { "key": "following_text", "operator": "regex_contains", "operand": "^}}", "match_all": true } - ] - }, - // Expand {{|}} to {{ | }} when space is pressed - { - "keys": [" "], - "command": "insert_snippet", - "args": { - "contents": " ${0} " - }, - "context": [ - { "key": "selector", "operand": "meta.embedded.statement.twig" }, - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "{{$", "match_all": true }, - { "key": "following_text", "operator": "regex_contains", "operand": "^}}", "match_all": true } - ], - }, - // Reduce {{ | }} to {{|}} when backspace is pressed - { - "keys": ["backspace"], - "command": "chain", - "args": { - "commands": [ - {"command": "left_delete" }, - {"command": "right_delete" } - ] - }, - "context": [ - { "key": "selector", "operand": "meta.embedded.expression.twig" }, - { "key": "setting.auto_match_enabled", "operand": true }, - { "key": "selection_empty", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "{{ $", "match_all": true }, - { "key": "following_text", "operator": "regex_contains", "operand": "^ }}", "match_all": true } - ] - } + // Expand {|} to {{ | }} when { is pressed + { + "keys": ["{"], + "command": "insert_snippet", + "args": { + "contents": "{ ${0} }" + }, + "context": [ + { "key": "selector", "operator": "equal", "operand": "meta.template.twig - meta.template.twig meta.embedded - meta.template.twig comment - meta.template.twig string" }, + { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "{$", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^}", "match_all": true } + ], + }, + // Reduce {{|}} to | when backspace is pressed + { + "keys": ["backspace"], + "command": "chain", + "args": { + "commands": [ + {"command": "left_delete" }, + {"command": "right_delete" }, + {"command": "left_delete" }, + {"command": "right_delete" } + ] + }, + "context": [ + { "key": "selector", "operand": "meta.embedded.expression.twig" }, + { "key": "setting.auto_match_enabled", "operand": true }, + { "key": "selection_empty", "operand": true, "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "{{$", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^}}", "match_all": true } + ] + }, + // Expand {{|}} to {{ | }} when space is pressed + { + "keys": [" "], + "command": "insert_snippet", + "args": { + "contents": " ${0} " + }, + "context": [ + { "key": "selector", "operand": "meta.embedded.statement.twig" }, + { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "{{$", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^}}", "match_all": true } + ], + }, + // Reduce {{ | }} to {{|}} when backspace is pressed + { + "keys": ["backspace"], + "command": "chain", + "args": { + "commands": [ + {"command": "left_delete" }, + {"command": "right_delete" } + ] + }, + "context": [ + { "key": "selector", "operand": "meta.embedded.expression.twig" }, + { "key": "setting.auto_match_enabled", "operand": true }, + { "key": "selection_empty", "operand": true, "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "{{ $", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^ }}", "match_all": true } + ] + } ] \ No newline at end of file diff --git a/Main.sublime-menu b/Main.sublime-menu index 6c9efd1..1868a31 100644 --- a/Main.sublime-menu +++ b/Main.sublime-menu @@ -1,36 +1,36 @@ [ - { - "id": "preferences", - "children": [ - { - "caption": "Package Settings", - "mnemonic": "P", - "id": "package-settings", - "children": [ - { - "caption": "Twig", - "children": [ - { - "caption": "Readme", - "command": "open_url", - "args": { - "url": "https://github.com/Sublime-Instincts/BetterTwig/blob/master/README.md" - } - }, - { "caption": "-" }, - { - "caption": "Key Bindings", - "command": "edit_settings", - "args": { - "base_file": "${packages}/Twig/Default.sublime-keymap", - "user_file": "${packages}/User/Default ($platform).sublime-keymap", - "default": "[\n\t$0\n]\n" - } - } - ] - } - ] - } - ] - } + { + "id": "preferences", + "children": [ + { + "caption": "Package Settings", + "mnemonic": "P", + "id": "package-settings", + "children": [ + { + "caption": "Twig", + "children": [ + { + "caption": "Readme", + "command": "open_url", + "args": { + "url": "https://github.com/Sublime-Instincts/BetterTwig/blob/master/README.md" + } + }, + { "caption": "-" }, + { + "caption": "Key Bindings", + "command": "edit_settings", + "args": { + "base_file": "${packages}/Twig/Default.sublime-keymap", + "user_file": "${packages}/User/Default ($platform).sublime-keymap", + "default": "[\n\t$0\n]\n" + } + } + ] + } + ] + } + ] + } ]