diff --git a/HTML (Liquid).sublime-syntax b/HTML (Liquid).sublime-syntax new file mode 100644 index 0000000..1e17370 --- /dev/null +++ b/HTML (Liquid).sublime-syntax @@ -0,0 +1,95 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: HTML (Liquid) +file_extensions: + - liquid +scope: text.html.liquid +contexts: + main: + - match: '{%-?\s*comment\s*-?%}' + push: + - meta_scope: comment.block.liquid + - match: '{%-?\s*endcomment\s*-?%}' + pop: true + - match: "{{-?" + push: + - meta_scope: punctuation.output.liquid + - match: "-?}}" + pop: true + - include: template_var + - match: "{%-?" + push: + - meta_scope: punctuation.tag.liquid + - match: "-?%}" + pop: true + - include: template_tag_name + - include: template_var + - include: scope:text.html.basic + - include: scope:source.json + - include: scope:source.js + - include: scope:source.css + assign_op: + - match: /= + scope: keyword.operator.assignment.augmented.liquid + logic_expression: + - match: /= + scope: keyword.operator.assignment.augmented.liquid + logic_op: + - match: \s+(and|or|not|contains|(\!\=|\=\=|<\=|>\=|<|>)\s+ + scope: keyword.operator.logical.liquid + template_tag_name: + - match: '(?<={%)\s*(\w+)' + scope: entity.name.tag.liquid + - match: '(?<={%-)\s*(\w+)' + scope: entity.name.tag.liquid + template_var: + - match: '(\[)(\|)(?=[^\]]*)(?=\])' + captures: + 2: invalid.illegal.filter.liquid + 3: invalid.illegal.filter.liquid + - match: (?<=\s)(\+|\-|\/|\*)(?=\s) + scope: invalid.illegal.filter.liquid + - match: (false|true|nil) + scope: constant.language.liquid + - match: '(?=if|unless|elsif)\s*[^%}]+\s(in)\s' + captures: + 3: invalid.illegal.operator.liquid + - match: \s+(and|or|not|contains|in|by|((\!|\=|\<|\>)\=))\s+ + scope: keyword.operator.liquid + - match: '(?<=assign)([^\=]+)(\=\=+)' + captures: + 2: invalid.illegal.assignment.liquid + - match: '\|\s+(?![\.0-9])[a-zA-Z0-9_-]+\:\s+' + scope: support.function.with-args.liquid + - match: '\|\s+(?![\.0-9])[a-zA-Z0-9_-]+\s+' + scope: support.function.without-args.liquid + - match: (?<=\s)(with|offset\:|limit\:)(?=\s) + scope: keyword.control.liquid + - match: (?<=include)(.*)(with\:|offset|limit)(?=\s) + captures: + 2: invalid.illegal.argument.liquid + - match: (?<=\s)(\w+\:)(?=\:\s) + scope: invalid.illegal.liquid + - match: '"' + push: + - meta_scope: string.quoted.double.liquid + - match: '"' + pop: true + - match: "'" + push: + - meta_scope: string.quoted.single.liquid + - match: "'" + pop: true + - match: '(-|\+)?\s*[0-9]+(\.[0-9]+)?' + scope: constant.numeric.liquid + - match: \b(collection|product|linklist|linklists|order|link|customer|customer_address|line_item|shop|collections|page_title|template|image|blog|blogs|cart|pages|theme|themes|variant|items|comment|forloop|settings|schema|javascript|stylesheet)\b + scope: support.class.liquid + - match: \b(assets|author|body|body_raw|current|date|excerpt_raw|meta|next|pages|parent|posts|previous|site|tags|taxonomy|title|url)\b + scope: support.class.liquid + - match: ((?<=\w\:\s)\w+) + scope: variable.parameter.liquid + - match: (?<=\.)\w+\b + scope: support.variable.liquid + - match: \w+ + scope: variable.other.liquid diff --git a/Snippets/endjavascript.sublime-snippet b/Snippets/endjavascript.sublime-snippet new file mode 100644 index 0000000..9f78a3a --- /dev/null +++ b/Snippets/endjavascript.sublime-snippet @@ -0,0 +1,7 @@ + + + + endjavascript + text.html.liquid + endjavascript + \ No newline at end of file diff --git a/Snippets/endschema.sublime-snippet b/Snippets/endschema.sublime-snippet new file mode 100644 index 0000000..fb0c4ea --- /dev/null +++ b/Snippets/endschema.sublime-snippet @@ -0,0 +1,7 @@ + + + + endschema + text.html.liquid + endschema + \ No newline at end of file diff --git a/Snippets/endstylesheet.sublime-snippet b/Snippets/endstylesheet.sublime-snippet new file mode 100644 index 0000000..a4eef8c --- /dev/null +++ b/Snippets/endstylesheet.sublime-snippet @@ -0,0 +1,7 @@ + + + + endstylesheet + text.html.liquid + endstylesheet + \ No newline at end of file diff --git a/Snippets/javascript.sublime-snippet b/Snippets/javascript.sublime-snippet new file mode 100644 index 0000000..fbb411b --- /dev/null +++ b/Snippets/javascript.sublime-snippet @@ -0,0 +1,7 @@ + + + + javascript + text.html.liquid + javascript + \ No newline at end of file diff --git a/Snippets/schema.sublime-snippet b/Snippets/schema.sublime-snippet new file mode 100644 index 0000000..6ef6226 --- /dev/null +++ b/Snippets/schema.sublime-snippet @@ -0,0 +1,7 @@ + + + + schema + text.html.liquid + schema + \ No newline at end of file diff --git a/Snippets/stylesheet.sublime-snippet b/Snippets/stylesheet.sublime-snippet new file mode 100644 index 0000000..76c2208 --- /dev/null +++ b/Snippets/stylesheet.sublime-snippet @@ -0,0 +1,7 @@ + + + + stylesheet + text.html.liquid + stylesheet + \ No newline at end of file diff --git a/Syntaxes/HTML (Liquid).YAML-tmLanguage b/Syntaxes/HTML (Liquid).YAML-tmLanguage deleted file mode 100644 index 81a4750..0000000 --- a/Syntaxes/HTML (Liquid).YAML-tmLanguage +++ /dev/null @@ -1,96 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmLanguage -name: HTML (Liquid) -scopeName: text.html.liquid -fileTypes: [liquid] -uuid: f2a39460-98fd-11e1-a8b0-0800200c9a66 - -patterns: -- name: comment.block.liquid - begin: '{%-?\s*comment\s*-?%}' - end: '{%-?\s*endcomment\s*-?%}' - -- name: punctuation.output.liquid - begin: '{{-?' - end: '-?}}' - patterns: - - include: '#template_var' - -- name: punctuation.tag.liquid - begin: '{%-?' - end: '-?%}' - patterns: - - include: '#template_tag_name' - - include: '#template_var' - -- include: text.html.basic - -repository: - assign_op: - patterns: - - name: keyword.operator.assignment.augmented.liquid - match: /= - - logic_expression: - patterns: - - match: /= - name: keyword.operator.assignment.augmented.liquid - - logic_op: - patterns: - - name: keyword.operator.logical.liquid - match: \s+(and|or|not|contains|(\!\=|\=\=|<\=|>\=|<|>)\s+ - template_tag_name: - patterns: - - name: entity.name.tag.liquid - match: (?<={%)\s*(\w+) - - name: entity.name.tag.liquid - match: (?<={%-)\s*(\w+) - template_var: - patterns: - - match: (\[)(\|)(?=[^\]]*)(?=\]) - captures: - '2': {name: invalid.illegal.filter.liquid} - '3': {name: invalid.illegal.filter.liquid} - - name: invalid.illegal.filter.liquid - match: (?<=\s)(\+|\-|\/|\*)(?=\s) - - name: constant.language.liquid - match: (false|true|nil) - - match: (?=if|unless|elsif)\s*[^%}]+\s(in)\s - captures: - '3': {name: invalid.illegal.operator.liquid} - - name: keyword.operator.liquid - match: \s+(and|or|not|contains|in|by|((\!|\=|\<|\>)\=))\s+ - - match: (?<=assign)([^\=]+)(\=\=+) - captures: - '2': {name: invalid.illegal.assignment.liquid} - - name: support.function.with-args.liquid - match: \|\s+(?![\.0-9])[a-zA-Z0-9_-]+\:\s+ - - name: support.function.without-args.liquid - match: \|\s+(?![\.0-9])[a-zA-Z0-9_-]+\s+ - - name: keyword.control.liquid - match: (?<=\s)(with|offset\:|limit\:)(?=\s) - - match: (?<=include)(.*)(with\:|offset|limit)(?=\s) - captures: - '2': {name: invalid.illegal.argument.liquid} - - name: invalid.illegal.liquid - match: (?<=\s)(\w+\:)(?=\:\s) - - name: string.quoted.double.liquid - begin: '"' - end: '"' - - name: string.quoted.single.liquid - begin: '''' - end: '''' - - name: constant.numeric.liquid - match: (-|\+)?\s*[0-9]+(\.[0-9]+)? - - name: support.class.liquid - match: \b(collection|product|linklist|linklists|order|link|customer|customer_address|line_item|shop|collections|page_title|template|image|blog|blogs|cart|pages|theme|themes|variant|items|comment|forloop|settings)\b - - name: support.class.liquid - match: \b(assets|author|body|body_raw|current|date|excerpt_raw|meta|next|pages|parent|posts|previous|site|tags|taxonomy|title|url)\b - - name: variable.parameter.liquid - match: ((?<=\w\:\s)\w+) - - name: support.variable.liquid - match: (?<=\.)\w+\b - - name: variable.other.liquid - match: \w+ -foldingStartMarker: (?x){%\s*(if|unless|for|paginate|capture|form|case|tablerow|raw|comment)[^(%})]+%} -foldingStopMarker: (?x){%\s*(endif|endunless|endfor|endpaginate|endcapture|endform|endcase|endtablerow|endraw|endcomment)[^(%})]+%} diff --git a/Syntaxes/HTML (Liquid).tmLanguage b/Syntaxes/HTML (Liquid).tmLanguage deleted file mode 100644 index 8acd1a6..0000000 --- a/Syntaxes/HTML (Liquid).tmLanguage +++ /dev/null @@ -1,279 +0,0 @@ - - - - - fileTypes - - liquid - - foldingStartMarker - (?x){%\s*(if|unless|for|paginate|capture|form|case|tablerow|raw|comment)[^(%})]+%} - foldingStopMarker - (?x){%\s*(endif|endunless|endfor|endpaginate|endcapture|endform|endcase|endtablerow|endraw|endcomment)[^(%})]+%} - name - HTML (Liquid) - patterns - - - begin - {%-?\s*comment\s*-?%} - end - {%-?\s*endcomment\s*-?%} - name - comment.block.liquid - - - begin - {{-? - end - -?}} - name - punctuation.output.liquid - patterns - - - include - #template_var - - - - - begin - {%-? - end - -?%} - name - punctuation.tag.liquid - patterns - - - include - #template_tag_name - - - include - #template_var - - - - - include - text.html.basic - - - repository - - assign_op - - patterns - - - match - /= - name - keyword.operator.assignment.augmented.liquid - - - - logic_expression - - patterns - - - match - /= - name - keyword.operator.assignment.augmented.liquid - - - - logic_op - - patterns - - - match - \s+(and|or|not|contains|(\!\=|\=\=|<\=|>\=|<|>)\s+ - name - keyword.operator.logical.liquid - - - - template_tag_name - - patterns - - - match - (?<={%)\s*(\w+) - name - entity.name.tag.liquid - - - match - (?<={%-)\s*(\w+) - name - entity.name.tag.liquid - - - - template_var - - patterns - - - captures - - 2 - - name - invalid.illegal.filter.liquid - - 3 - - name - invalid.illegal.filter.liquid - - - match - (\[)(\|)(?=[^\]]*)(?=\]) - - - match - (?<=\s)(\+|\-|\/|\*)(?=\s) - name - invalid.illegal.filter.liquid - - - match - (false|true|nil) - name - constant.language.liquid - - - captures - - 3 - - name - invalid.illegal.operator.liquid - - - match - (?=if|unless|elsif)\s*[^%}]+\s(in)\s - - - match - \s+(and|or|not|contains|in|by|((\!|\=|\<|\>)\=))\s+ - name - keyword.operator.liquid - - - captures - - 2 - - name - invalid.illegal.assignment.liquid - - - match - (?<=assign)([^\=]+)(\=\=+) - - - match - \|\s+(?![\.0-9])[a-zA-Z0-9_-]+\:\s+ - name - support.function.with-args.liquid - - - match - \|\s+(?![\.0-9])[a-zA-Z0-9_-]+\s+ - name - support.function.without-args.liquid - - - match - (?<=\s)(with|offset\:|limit\:)(?=\s) - name - keyword.control.liquid - - - captures - - 2 - - name - invalid.illegal.argument.liquid - - - match - (?<=include)(.*)(with\:|offset|limit)(?=\s) - - - match - (?<=\s)(\w+\:)(?=\:\s) - name - invalid.illegal.liquid - - - begin - " - end - " - name - string.quoted.double.liquid - - - begin - ' - end - ' - name - string.quoted.single.liquid - - - match - (-|\+)?\s*[0-9]+(\.[0-9]+)? - name - constant.numeric.liquid - - - match - \b(collection|product|linklist|linklists|order|link|customer|customer_address|line_item|shop|collections|page_title|template|image|blog|blogs|cart|pages|theme|themes|variant|items|comment|forloop|settings)\b - name - support.class.liquid - - - match - \b(assets|author|body|body_raw|current|date|excerpt_raw|meta|next|pages|parent|posts|previous|site|tags|taxonomy|title|url)\b - name - support.class.liquid - - - match - ((?<=\w\:\s)\w+) - name - variable.parameter.liquid - - - match - (?<=\.)\w+\b - name - support.variable.liquid - - - match - \w+ - name - variable.other.liquid - - - - - scopeName - text.html.liquid - uuid - f2a39460-98fd-11e1-a8b0-0800200c9a66 - -