diff --git a/package.json b/package.json index e7d79ccc..22c474f3 100755 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "publisher": "sissel", "icon": "images/logo.png", "author": "Νίκος Σαβίδης ", - "version": "3.0.0", + "version": "3.0.1", "keywords": [ "liquid", "shopify", @@ -298,21 +298,9 @@ "editor.defaultFormatter": "sissel.shopify-liquid", "editor.formatOnSave": true }, - "[liquid-css]": { - "editor.bracketPairColorization.enabled": false, - "editor.defaultFormatter": "sissel.shopify-liquid", - "editor.formatOnSave": true - }, - "[liquid-scss]": { - "editor.bracketPairColorization.enabled": false, - "editor.defaultFormatter": "sissel.shopify-liquid", - "editor.formatOnSave": true - }, - "[liquid-javascript]": { - "editor.bracketPairColorization.enabled": false, - "editor.defaultFormatter": "sissel.shopify-liquid", - "editor.formatOnSave": true - }, + "[liquid-css]": {}, + "[liquid-scss]": {}, + "[liquid-javascript]": {}, "files.associations": { "*.json.liquid": "json", "*.yaml.liquid": "yaml", @@ -437,12 +425,13 @@ "correct": { "type": "boolean", "default": false, - "markdownDescription": "Automatically attempts to correct some sloppiness in code." + "title": "Fix Sloppy Code", + "markdownDescription": "Automatically attempts to correct some sloppiness in code. Use this option with care, it may wreak havoc in some cases." }, "attributeCasing": { "type": "string", - "markdownDescription": "Control the casing of attributes.", "default": "preserve", + "markdownDescription": "Control the casing of attributes", "enum": [ "preserve", "lowercase", @@ -453,6 +442,7 @@ "attributeSort": { "type": "boolean", "default": false, + "title": "Sort Attributes", "markdownDescription": "Alphanumerically sort HTML attributes from A to Z." }, "attributeSortList": { @@ -461,12 +451,12 @@ "items": { "type": "string" }, - "markdownDescription": "A list of HTML attribute names. Attributes will be sorted according to this list and then alphanumerically. This option requires `attributeSort` have a value of `true` and does not support Liquid tag names, only HTML names are applicable." + "markdownDescription": "A list of HTML attribute names. Attributes will be sorted according to this list and then alphanumerically. This option requires `attribute_sort` have a value of `true` and does not accept Liquid tag names, only HTML names are applicable." }, "delimiterSpacing": { "type": "boolean", "default": false, - "markdownDescription": "Whether or not Liquid delimiter characters should apply a single space at the start and end points." + "markdownDescription": "Whether or not delimiter characters should apply a single space at the start and end points." }, "commentNewline": { "type": "boolean", @@ -476,12 +466,12 @@ "forceLeadAttribute": { "type": "boolean", "default": false, - "markdownDescription": "Whether the leading attribute should be forced onto a newline when word `wrap` limit is exceeded or if it should be preserved. By default, Prettify preserves the leading attribute when applying wrap indentation. Enabling this option will force indent all attributes if wrap is exceeded. This rule requires a `wrap` level to be defined. If you have `forceAttribute` enabled or using a force attribute limit value it will override this option. If you desire wrap based attribute indentation, set `forceAttribute` to `false` and ensure a `wrap` level is defined.\n#### Disabled (default)\n*Below is an example of how this rule works if it's disabled (ie: `false`) and attributes have exceeded a defined wrap limit. Notice how leading attributes are preserved that have not exceeded wrap, but proceeding attributes are indented onto their own lines, this is the default behavior Prettify uses.*\n```liquid\n\n
\n```#### Enabled\n*Below is an example of how this rule works if it's enabled (ie: `true`) and attributes have exceeded the defined wrap limit. Notice how all attributes and indented onto their own line, including the leading attribute.*\n```liquid\n\n\n```" + "markdownDescription": "**_FORCE LEAD ATTRIBUTE_**\n\n_Whether the leading attribute should be forced onto a newline when word `wrap` limit is exceeded or if it should be preserved. By default, Prettify preserves the leading attribute when applying wrap indentation. Enabling this option will force indent all attributes if wrap is exceeded._\n\n_This rule requires a `wrap` level to be defined. If you have `forceAttribute` enabled or using a force attribute limit value it will override this option. If you desire wrap based attribute indentation, set `forceAttribute` to `false` and ensure a `wrap` level is defined._\n\n---\n\n#### Disabled (default)\nBelow is an example of how this rule works if it's disabled (ie: `false`) and attributes have exceeded a defined wrap limit. Notice how leading attributes are preserved that have not exceeded wrap, but proceeding attributes are indented onto their own lines, this is the default behavior Prettify uses.*\n```liquid\n\n\n
\n\n\n```\n\n---\n\n#### Enabled\nBelow is an example of how this rule works if it's enabled (ie: `true`) and attributes have exceeded the defined wrap limit. Notice how all attributes and indented onto their own line, including the leading attribute.\n\n```liquid\n\n\n\n\n\n```" }, "forceIndent": { "type": "boolean", "default": false, - "markdownDescription": "Will force indentation upon all content and tags without regard for the text nodes." + "markdownDescription": "**_FORCE INDENT_**\n\n_Will force indentation upon all content and tags without regard for the text nodes._\n#### Disabled   👎\n```liquid\nHello World\n\n\n```\n\n---\n\n#### Enabled   👍\n```liquid\n\n Hello World\n\n\n\n```" }, "forceAttribute": { "type": [ @@ -489,26 +479,27 @@ "number" ], "default": false, - "markdownDescription": "If all markup attributes should be indented each onto their own line. You can optionally provide an integer value of `1` or more. When an integer value is passed, attributes will be forced only if the number of attributes contained on the tag exceeds the supplied value limit. When you define a `wrap` level then attributes will be automatically forced. This is typically a better solution than forcing all attributes onto newlines or an even better solution would be to set a limit level.\n\n#### Disabled Example\n*Below is the default, wherein attributes are only forced when wrap is exceeded.*\n```liquid\n
\n
\n```\n#### Enabled Example\n*Below is an example of how this rule works if it's enabled, ie: `true`*\n```liquid\n\n\n```\n#### Limit Example\n*Below we provide a value of `2` so formatting will be applied as such:*\n```liquid\n\n
\n\n\n\n\n\n
\n```" + "markdownDescription": "**_FORCE ATTRIBUTE_**\n\n_Whether all markup attributes should be indented each onto their own line. You can optionally provide an integer value of `1` or more. When an integer value is passed, attributes will be forced only if the number of attributes contained on the tag exceeds the supplied value limit. When you define a `wrap` level then attributes will be automatically forced. This is typically a better solution than forcing all attributes onto newlines or an even better solution would be to set a limit level._\n\n---\n\n#### Disabled   👎\nBelow is the default, wherein attributes are only forced when wrap is exceeded.\n```liquid\n\n
\n
\n\n\n```\n\n---\n\n#### Enabled   👍\nBelow is an example of how this rule works if it's enabled, ie: `true`\n```liquid\n\n\n```\n\n---\n\n#### Limit Example   👍 👍\n*Below we provide a value of `2` so formatting will be applied as such:*\n```liquid\n\n
\n\n\n\n\n\n
\n\n\n```" }, "preserveText": { "type": "boolean", "default": true, + "title": "Preserve Markup Text White Space", "markdownDescription": "If text in the provided document code should be preserved exactly as provided. This option eliminates beautification and wrapping of text content." }, "selfCloseSpace": { "type": "boolean", "default": false, - "markdownDescription": "Markup self-closing tags end will end with ' />' instead of '/>' on the ending delimeters. Please note, that self-closing tags are no longer required as of HTML5, so use this how you wish." + "markdownDescription": "Markup self-closing tags end will end with ' />' instead of '/>' on the ending delimeters.\n\n---\n\n**Disabled**:\n\n\t\n\n**Enabled**:\n\n\t\n\n---\n\n**NOTE:**\n\nThis is optional and self-closing tags are no longer required as of HTML5, so use this how you wish." }, "preserveAttributes": { "type": "boolean", "default": false, - "markdownDescription": "If HTML tags should have their insides (attributes) preserved. This option will prevent attributes from being formatted." + "markdownDescription": "If HTML tags should have their insides (attributes) preserved. This option will prevent attributes from being formatted.\n\n---\n\n**Disabled** 👎\n\n\t
\n\n**Enabled** 👍\n\n\t\n\n---\n\n**NOTE:**\n\nThere might be some situations where you do not desire attributes to be formatted, in such case use this option." }, "quoteConvert": { - "type": "string", "default": "none", + "type": "string", "markdownDescription": "If quotation character should be converted to specific type or not.", "enum": [ "none", @@ -525,71 +516,54 @@ "correct": { "type": "boolean", "default": false, - "description": "Automatically attempts to correct some sloppiness in code." + "title": "Fix Sloppy Code", + "markdownDescription": "Automatically attempts to correct some sloppiness in code. Use this option with care, it may wreak havoc in some cases." }, "braceAllman": { "type": "boolean", "default": false, "title": "Style of Indent", - "description": "Determines if opening curly braces will exist on the same line as their condition or be forced onto a new line. (Allman style indentation)" + "markdownDescription": "Determines if opening curly braces will exist on the same line as their condition or be forced onto a new line. (Allman style indentation)" }, "braceNewline": { "type": "boolean", "default": false, "title": "Brace Lines", - "description": "If true an empty line will be inserted after opening curly braces and before closing curly braces" + "markdownDescription": "If true an empty line will be inserted after opening curly braces and before closing curly braces" }, "bracePadding": { "type": "boolean", "default": false, "title": "Brace Padding", - "description": "Inserts a space after the start of a container and before the end of the container if the contents of that container are not indented; such as: conditions, function arguments, and escaped sequences of template strings" - }, - "braceStyle": { - "type": "string", - "default": "none", - "title": "Brace Style", - "description": "Emulates JSBeautify's brace_style option", - "enum": [ - "collapse", - "collapse-preserve-inline", - "expand", - "none" - ] + "markdownDescription": "Inserts a space after the start of a container and before the end of the container if the contents of that container are not indented; such as: conditions, function arguments, and escaped sequences of template strings" }, "caseSpace": { "type": "boolean", "default": false, "title": "Space Following Case", - "description": "If the colon separating a case's expression (of a switch/case block) from its statement should be followed by a space instead of indentation, thereby keeping the case on a single line of code" - }, - "commentIndent": { - "type": "boolean", - "default": false, - "title": "Comment Indentation", - "description": "This will determine whether comments should always start at position 0 of each line or if comments should be indented according to the code" + "markdownDescription": "If the colon separating a case's expression (of a switch/case block) from its statement should be followed by a space instead of indentation, thereby keeping the case on a single line of code" }, "elseNewline": { "type": "boolean", "default": false, "title": "Else On New Line", - "description": "If else_line is true then the keyword 'else' is forced onto a new line." + "markdownDescription": "If else_line is true then the keyword 'else' is forced onto a new line." }, "endComma": { "type": "string", "default": "none", "title": "Trailing Comma", - "description": "If there should be a trailing comma in arrays and objects", + "markdownDescription": "If there should be a trailing comma in arrays and objects", "enum": [ "none", - "always", - "never" + "never", + "always" ] }, "arrayFormat": { "type": "string", "default": "default", - "description": "Determines if all array indexes should be indented, never indented, or left to the default.", + "markdownDescription": "**_ARRAY FORMAT_**\n\n_Determines if all array indexes should be indented, never indented, or left to the default. The `default` option will leave array indexes intact and not apply any formatting._\n\n---\n#### `inline`   👎\nEnsure all array indexes appear on a single line\n```json\n\n{\n \"object\": [1,2,3,4]\n}\n\n```\n---\n#### `indent`   👍\nAlways indent each index of an array\n\n```json\n\n{\n \"object\": [\n 1,\n 2,\n 3,\n 4\n ]\n}\n\n```", "enum": [ "default", "indent", @@ -600,7 +574,7 @@ "type": "string", "default": "default", "title": "Formatting Arrays", - "description": "Determines if all object keys should be indented, never indented, or left to the default", + "markdownDescription": "Determines if all object keys should be indented, never indented, or left to the default", "enum": [ "default", "indent", @@ -611,66 +585,69 @@ "type": "boolean", "default": false, "title": "Space After Function Name", - "description": "If a space should follow a JavaScript function name" + "markdownDescription": "If a space should follow a JavaScript function name" }, "methodChain": { "type": "number", "default": 3, - "title": "Method Chains", - "description": "When to break consecutively chained methods and properties onto separate lines. A negative value disables this option. A value of 0 ensures method chains are never broken" + "markdownDescription": "**_METHOD CHAINING_**\n\n_When to break consecutively chained methods and properties onto separate lines. A negative value (eg: `-1`) disables this option. A value of `0` ensures method chains are never broken_\n\n---\n#### `0`\nPassing a value of `0` will never break chained methods.\n```js\n\nwindow.property.method(() => {}).foo(() => {})\n\n\n```\n\n---\n\n#### `3` (default)\nWhen there are more than `3` methods and/or properties they will be split onto separate lines.\n```js\n\nwindow\n .property\n .method(() => {})\n .foo(() => {})\n\n\n```" }, "neverFlatten": { "type": "boolean", "default": false, "title": "Never Flatten Destructured Lists", - "description": "If destructured lists in script should never be flattend" + "markdownDescription": "If destructured lists in script should never be flattend" }, "noCaseIndent": { "type": "boolean", "default": false, "title": "Case Indentation", - "description": "If a case statement should receive the same indentation as the containing switch block." + "markdownDescription": "If a case statement should receive the same indentation as the containing switch block." }, "noSemicolon": { "type": "boolean", "default": false, "title": "No Semicolons", - "description": "Removes semicolons that would be inserted by ASI. This option is in conflict with option 'correct' and takes precedence over conflicting features. Use of this option is a possible security/stability risk" + "markdownDescription": "Removes semicolons that would be inserted by ASI. This option is in conflict with option 'correct' and takes precedence over conflicting features. Use of this option is a possible security/stability risk" }, - "preserveComment": { + "objectSort": { "type": "boolean", "default": false, - "title": "Eliminate Word Wrap Upon Comments", - "description": "Prevent comment reformatting due to option wrap" + "markdownDescription": "**_OBJECT SORT_**\n\n_This option will alphabetically sort object properties (keys). This can be an expensive operation when dealing with large objects with over 2k properties._\n\n---\n#### Disabled   👍\nWhen disabled, ie: `false` properties will not be sorted.\n```js\n\n{\n e: \"5\",\n b: \"2\",\n d: \"4\",\n a: \"1\",\n f: \"6\",\n c: \"3\"\n}\n\n\n```\n\n---\n\n#### Enabled   👎\nWhen set to `true` all properties are alphanumerically sorted\n```js\n\n{\n a: \"1\",\n b: \"2\",\n c: \"3\",\n d: \"4\",\n e: \"5\",\n f: \"6\"\n}\n\n\n```" }, "quoteConvert": { "default": "none", "title": "Convert Quotes", - "description": "If the quotes of script strings or document attributes should be converted to single quotes or double quotes", + "markdownDescription": "If the quotes of script strings or document attributes should be converted to single quotes or double quotes", "type": "string", "enum": [ - "none", "double", - "single" + "single", + "none" ] }, "functionSpace": { "type": "boolean", "default": false, "title": "Function Space", - "description": "Inserts a space following the function keyword for anonymous functions" + "markdownDescription": "Inserts a space following the function keyword for anonymous functions" }, "ternaryLine": { "type": "boolean", "default": false, "title": "Keep Ternary Statements On One Line", - "description": "If ternary operators in JavaScript ? and : should remain on the same line" + "markdownDescription": "If ternary operators in JavaScript ? and : should remain on the same line" }, "variableList": { "type": "boolean", "default": false, "title": "Variable Declaration Lists", - "description": "If consecutive JavaScript variables should be merged into a comma separated list or if variables in a list should be separated" + "markdownDescription": "If consecutive JavaScript variables should be merged into a comma separated list or if variables in a list should be separated" + }, + "vertical": { + "type": "boolean", + "default": false, + "markdownDescription": "**_VERTICAL LIST_**\n\n_If consecutive JavaScript variables should be merged into a comma separated list or if variables in a list should be separated_\n\n---\n#### Before Formatting\nBelow is an example of how this rule works if it's enabled, ie: `true`\n```js\n\nconst object = {\n someProperty: 'x',\n anotherProperty: 'x',\n fooProperty: 'x'\n};\n\n\n```\n\n---\n\n#### After Formatting\nAfter formatting all declaration lists will be aligned in a vertical manner.\n```js\n\nconst object = {\n someProperty : 'x',\n anotherProperty : 'x',\n fooProperty : 'x'\n};\n\n\n```" } } }, @@ -682,27 +659,29 @@ "correct": { "type": "boolean", "default": false, - "markdownDescription": "Automatically attempts to correct some sloppiness in code." + "title": "Fix Sloppy Code", + "markdownDescription": "Automatically attempts to correct some sloppiness in code. Use this option with care, it may wreak havoc in some cases." }, "braceAllman": { "type": "boolean", "default": false, + "title": "Style of Indent", "markdownDescription": "Determines if opening curly braces will exist on the same line as their condition or be forced onto a new line. (Allman style indentation)" }, "comments": { "type": "boolean", "default": false, - "markdownDescription": "This will determine whether comments should always start at position `0` of each line or if comments should be indented according to the code" + "markdownDescription": "This will determine whether comments should always start at position 0 of each line or if comments should be indented according to the code" }, "sortSelectors": { "type": "boolean", "default": false, - "markdownDescription": "Sorts CSS Selectors in an alphanumerical order" + "markdownDescription": "Sort Selectors" }, "sortProperties": { "type": "boolean", "default": false, - "markdownDescription": "Sort Selectors in an alphanumerical order" + "markdownDescription": "**_SORT PROPERTIES_**\n\n_This option will alphabetically sort object properties (keys). This can be an expensive operation when dealing with large objects with over 2k properties._\n\n---\n#### Before   \nWhen disabled, ie: `false` properties will not be sorted.\n```css\n.class {\n width: 100px;\n color: blue;\n font-size: 20px;\n background: pink\n}\n\n```\n\n---\n\n#### After   👎\nWhen set to `true` all properties are alphanumerically sorted\n```json\n\n.class {\n color: blue;\n background: pink;\n font-size: 20px;\n width: 100px;\n}\n\n```" }, "classPadding": { "type": "boolean", @@ -713,12 +692,25 @@ "noLeadZero": { "type": "boolean", "default": false, - "markdownDescription": "Whether leading `0s` in CSS values immediately preceding a decimal should be removed or prevented." + "title": "Leading 0s", + "markdownDescription": "Whether leading 0s in CSS values immediately preceding a decimal should be removed or prevented." }, "selectorList": { "type": "boolean", "default": false, + "title": "Single Lined Selectors", "markdownDescription": "If comma separated CSS selectors should present on a single line of code." + }, + "quoteConvert": { + "default": "none", + "title": "Convert Quotes", + "markdownDescription": "If the quotes of script strings or document attributes should be converted to single quotes or double quotes", + "type": "string", + "enum": [ + "none", + "double", + "single" + ] } } }, @@ -730,7 +722,7 @@ "arrayFormat": { "type": "string", "default": "default", - "markdownDescription": "The `arrayFormat` rule controls how arrays on objects are formatted. This rules will determines if all array indexes should be indented, never indented, or left to the default.", + "markdownDescription": "**_ARRAY FORMAT_**\n\n_Determines if all array indexes should be indented, never indented, or left to the default. The `default` option will leave array indexes intact and not apply any formatting._\n\n---\n#### `inline`   👎\nEnsure all array indexes appear on a single line\n```json\n\n{\n \"object\": [1,2,3,4]\n}\n\n```\n---\n#### `indent`   👍\nAlways indent each index of an array\n\n```json\n\n{\n \"object\": [\n 1,\n 2,\n 3,\n 4\n ]\n}\n\n```", "enum": [ "default", "indent", @@ -740,34 +732,28 @@ "braceAllman": { "type": "boolean", "default": false, - "markdownDescription": "Determines if opening curly braces will exist on the same line as their condition or be forced onto a new line. (Allman style indentation)\n#### Disabled\n\n```json\n[\n { \"prop\": \"value\" },\n { \"prop\": \"value\" },\n { \"prop\": \"value\" }\n]\n```\n#### Enabled\n\n```json\n[\n {\n \"prop\": \"value\"\n },\n {\n \"prop\": \"value\"\n },\n {\n \"prop\": \"value\"\n }\n]\n```" + "markdownDescription": "**_BRACE ALLMAN_**\n\n_Determines if opening curly braces will exist on the same line as their condition or be forced onto a new line. The formatting structure is known as [Allman](https://en.wikipedia.org/wiki/Indentation_style#Allman_style) style indentation_.\n\n---\n\n#### Disabled   👎\nBelow is an example when this option is set to `false` and each object in the array starts curly braces inline.\n```json\n\n[\n { \"prop\": \"value\" },\n { \"prop\": \"value\" },\n { \"prop\": \"value\" }\n]\n\n```\n---\n#### Enabled   👍\nBelow is an example when this option is set to `true` and each object in the array starts on a newline.\n```json\n\n[\n {\n \"prop\": \"value\"\n },\n {\n \"prop\": \"value\"\n },\n {\n \"prop\": \"value\"\n }\n]\n\n```" }, "bracePadding": { "type": "boolean", "default": false, - "markdownDescription": "If true an empty line will be inserted after opening curly braces and before closing curly braces" - }, - "braceStyle": { - "type": "string", - "default": "none", - "markdownDescription": "Emulates JSBeautify's brace_style option", - "oneOf": [ - "collapse", - "collapse-preserve-inline", - "expand", - "none" - ] + "title": "Brace Lines", + "markdownDescription": "**_BRACE PADDING_**\n\n_The `bracePadding` rule will insert newlines at the top and bottom of nested properties._\n\n---\n#### Disabled   👍\nBelow is an example when this option is set to `true`\n```json\n\n{\n \"one\": {\n \"xx\": {\n \"xx\": false\n }\n }\n}\n\n```\n\n---\n\n#### Enabled   👎\nBelow is an example when this option is set to `false`\n```json\n\n{\n \"one\": {\n\n \"xx\": {\n\n \"xx\": false\n\n }\n\n }\n}\n\n```" }, "objectIndent": { "type": "string", "default": "default", - "title": "Formatting Objects", - "markdownDescription": "Determines if all object keys should be indented, never indented, or left to the default", + "markdownDescription": "**Object Indent**\n\nControls how arrays on objects are formatted. We will exclude the `inline` option to prevent unreadable objects. If all object keys should be indented, never indented, or left to the default.", "enum": [ "default", "indent", "inline" ] + }, + "objectSort": { + "type": "boolean", + "default": false, + "markdownDescription": "**_OBJECT SORT_**\n\n_This option will alphabetically sort object properties (keys). This can be an expensive operation when dealing with large objects with over 2k properties._\n\n---\n#### Disabled   👍\nWhen disabled, ie: `false` properties will not be sorted.\n```json\n\n{\n \"e\": \"5\",\n \"b\": \"2\",\n \"d\": \"4\",\n \"a\": \"1\",\n \"f\": \"6\",\n \"c\": \"3\"\n}\n\n```\n\n---\n\n#### Enabled   👎\nWhen set to `true` all properties are alphanumerically sorted\n```json\n\n{\n \"a\": \"1\",\n \"b\": \"2\",\n \"c\": \"3\",\n \"d\": \"4\",\n \"e\": \"5\",\n \"f\": \"6\"\n}\n\n```" } } } @@ -818,7 +804,7 @@ }, "dependencies": { "@liquify/liquid-language-specs": "^0.1.4", - "@liquify/prettify": "0.1.4-beta.1", + "@liquify/prettify": "0.1.6-beta.1", "anymatch": "^3.1.2", "parse-json": "^6.0.2", "rambdax": "8.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c5390021..28108b5f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,7 +4,7 @@ specifiers: '@liquify/eslint-config': ^1.1.0 '@liquify/liquid-language-specs': ^0.1.4 '@liquify/prettier-config': ^1.0.1 - '@liquify/prettify': 0.1.4-beta.1 + '@liquify/prettify': 0.1.6-beta.1 '@types/vscode': ^1.71.0 anymatch: ^3.1.2 eslint: ^8.24.0 @@ -19,7 +19,7 @@ specifiers: dependencies: '@liquify/liquid-language-specs': 0.1.4 - '@liquify/prettify': 0.1.4-beta.1 + '@liquify/prettify': 0.1.6-beta.1 anymatch: 3.1.2 parse-json: 6.0.2 rambdax: 8.1.0 @@ -151,8 +151,8 @@ packages: prettier: 2.7.1 dev: true - /@liquify/prettify/0.1.4-beta.1: - resolution: {integrity: sha512-blRaTPj8+ftGIdZX++m1ehlwEjtatn14p8V6dPAon1IDaLMmEyC3dBO1MlTWY8scwadvU/1ypEYBypHKazt01A==} + /@liquify/prettify/0.1.6-beta.1: + resolution: {integrity: sha512-8a5kKXgYBIXYxGb4blUUvdFgwylJkgqbCkbpXeobrfoc8JjfFvMoT2d1bDn4YbG9fFDHg6wy0JTj7FnYHNY+2w==} engines: {node: '>=12', pnpm: '>=4'} dev: false diff --git a/readme.md b/readme.md index bd5c551a..08782e3c 100644 --- a/readme.md +++ b/readme.md @@ -124,7 +124,7 @@ Below are the available commands exposed to the vscode command palette (`cmd + s # Workspace Settings -The extension provides various workspace/user settings. The options available to `liquid.format` can be controlled using a `.liquidrc` configuration file or alternatively you can define format option on a `prettify` field in a node `package.json` file. Take a look at the [configuration](#configuration) section for more information. +The extension provides various workspace/user settings. The options available to `liquid.format` can be controlled using a `.liquidrc` configuration file or alternatively you can define format options via a `prettify` field in a node `package.json` file. Take a look at the [configuration](#configuration) section for more information. By default, it is assumed you are using vscode workspace/user settings. @@ -338,7 +338,7 @@ By default, it is assumed you are using vscode workspace/user settings. ### Config Base URL -The `liquid.config.baseUrl` option can be used to define a **relative** directory path for resolving config files. The option will only work in projects that use `.liquidrc` files or define formatting rules on a package.json `prettify` field (see: [Configuration](#configuration)). Consider the following directory layout: +The `liquid.config.baseUrl` option can be used to define a **relative** directory path for resolving config files. The option will only work in projects that use `.liquidrc` files or define formatting rules in as package.json `prettify` field (see: [Configuration](#configuration)). Consider the following directory layout: ```bash root @@ -477,26 +477,28 @@ _Be sure to define only the languages you wish to have formatted by the extensio { // Enables formatting of .liquid files "[liquid]": { - "editor.defaultFormatter": "sissel.shopify-liquid" + "editor.defaultFormatter": "sissel.shopify-liquid", + "editor.formatOnSave": true }, // Enables formatting of all .js.liquid files "[liquid-javascript]": { - "editor.defaultFormatter": "sissel.shopify-liquid" + "editor.defaultFormatter": "sissel.shopify-liquid", + "editor.formatOnSave": false }, // Enables formatting of all .css.liquid files "[liquid-css]": { - "editor.defaultFormatter": "sissel.shopify-liquid" + "editor.defaultFormatter": "sissel.shopify-liquid", + "editor.formatOnSave": false }, // Enables formatting of all .scss.liquid files "[liquid-scss]": { - "editor.defaultFormatter": "sissel.shopify-liquid" + "editor.defaultFormatter": "sissel.shopify-liquid", + "editor.formatOnSave": false } } ``` -In addition the above defaults, you can also choose to have Prettify beautify other supported languages. Please note, that when extending to the below languages that Prettify is still in its early stages so results may not be perfect. - -> Liquid syntax contained in any of these languages is supported! +In addition the above defaults, you can also choose to have Prettify beautify other supported languages. Please note, that when extending to the below languages that Prettify is still in its early stages so results may not be perfect. Liquid syntax contained in any of these languages is supported! ```jsonc { @@ -619,63 +621,68 @@ Below is the **default** rules. It is important to note that if the `liquid.form ```jsonc { "ignore": [], - "crlf": false, + "wrap": 0, "commentIndent": true, - "endNewline": false, - "indentChar": " ", + "crlf": false, "indentSize": 2, - "preserveComment": false, + "preserveComment": true, "preserveLine": 2, - "wrap": 0, + "endNewLine": true, "markup": { - "correct": false, - "commentNewline": false, + "commentNewline": true, + "forceLeadAttribute": false, + "forceAttribute": false, + "forceIndent": false, "attributeCasing": "preserve", - "attributeValues": "preserve", "attributeSort": false, "attributeSortList": [], - "forceAttribute": false, - "forceLeadAttribute": false, - "forceIndent": false, - "preserveText": false, + "correct": false, + "delimiterSpacing": false, "preserveAttributes": false, - "selfCloseSpace": false, - "quoteConvert": "none" + "preserveText": true, + "quoteConvert": "none", + "selfCloseSpace": false + }, + "json": { + "arrayFormat": "default", + "braceAllman": false, + "bracePadding": false, + "objectIndent": "default", + "objectSort": false }, "style": { - "correct": false, + "braceAllman": false, "classPadding": false, - "noLeadZero": false, + "sortProperties": false, "sortSelectors": false, - "sortProperties": false + "selectorList": false, + "comments": false, + "correct": false, + "noLeadZero": false, + "quoteConvert": "none" }, "script": { "correct": false, - "braceNewline": false, - "bracePadding": false, - "braceStyle": "none", + "arrayFormat": "indent", "braceAllman": false, - "caseSpace": false, - "inlineReturn": true, - "elseNewline": false, + "methodChain": 3, + "caseSpace": true, "endComma": "never", - "arrayFormat": "default", - "objectIndent": "default", + "quoteConvert": "single", + "elseNewline": true, "functionNameSpace": false, - "functionSpace": false, - "styleGuide": "none", - "ternaryLine": false, - "methodChain": 4, + "functionSpace": true, + "ternaryLine": true, + "braceNewline": false, + "bracePadding": true, + "braceStyle": "none", "neverFlatten": false, - "noCaseIndent": false, + "noCaseIndent": true, "noSemicolon": false, - "quoteConvert": "none" - }, - "json": { - "arrayFormat": "default", - "braceAllman": false, - "bracePadding": false, - "objectIndent": "default" + "objectIndent": "indent", + "objectSort": false, + "vertical": false, + "variableList": false } } ``` diff --git a/schema/liquidrc.json b/schema/liquidrc.json index d69db544..06f389c1 100644 --- a/schema/liquidrc.json +++ b/schema/liquidrc.json @@ -47,25 +47,6 @@ "markdownDescription": "A list of HTML attribute names. Attributes will be sorted according to this list and then alphanumerically. This option requires \"attribute_sort\" have a value of true and does not support Liquid tag names, only HTML names are applicable.", "markdownDescription": "A list of HTML attribute names. Attributes will be sorted according to this list and then alphanumerically. This option requires `attribute_sort` have a value of `true` and does not accept Liquid tag names, only HTML names are applicable." }, - "attributeValues": { - "default": "preserve", - "type": "string", - "markdownDescription": "How attribute values should be handled. By default, Prettify strips extraneous whitespaces from HTML attribute values but preserves newlines. You can control how attribute values should be processed.\\n\\nPlease note that this option is experimental and may not fully work as intended.", - "oneOf": [ - { - "enum": ["preserve"] - }, - { - "enum": ["wrap"] - }, - { - "enum": ["strip"] - }, - { - "enum": ["collapse"] - } - ] - }, "delimiterSpacing": { "type": "boolean", "default": false, @@ -80,17 +61,17 @@ "forceLeadAttribute": { "type": "boolean", "default": false, - "markdownDescription": "Whether the leading attribute should be forced onto a newline when word `wrap` limit is exceeded or if it should be preserved. By default, Prettify preserves the leading attribute when applying wrap indentation. Enabling this option will force indent all attributes if wrap is exceeded. This rule requires a `wrap` level to be defined. If you have `forceAttribute` enabled or using a force attribute limit value it will override this option. If you desire wrap based attribute indentation, set `forceAttribute` to `false` and ensure a `wrap` level is defined.\n#### Disabled (default)\n*Below is an example of how this rule works if it's disabled (ie: `false`) and attributes have exceeded a defined wrap limit. Notice how leading attributes are preserved that have not exceeded wrap, but proceeding attributes are indented onto their own lines, this is the default behavior Prettify uses.*\n```liquid\n\n
\n```\n#### Enabled\n*Below is an example of how this rule works if it's enabled (ie: `true`) and attributes have exceeded the defined wrap limit. Notice how all attributes and indented onto their own line, including the leading attribute.*\n```liquid\n\n
\n```" + "markdownDescription": "**_FORCE LEAD ATTRIBUTE_**\n\n_Whether the leading attribute should be forced onto a newline when word `wrap` limit is exceeded or if it should be preserved. By default, Prettify preserves the leading attribute when applying wrap indentation. Enabling this option will force indent all attributes if wrap is exceeded._\n\n_This rule requires a `wrap` level to be defined. If you have `forceAttribute` enabled or using a force attribute limit value it will override this option. If you desire wrap based attribute indentation, set `forceAttribute` to `false` and ensure a `wrap` level is defined._\n\n---\n\n#### Disabled (default)\nBelow is an example of how this rule works if it's disabled (ie: `false`) and attributes have exceeded a defined wrap limit. Notice how leading attributes are preserved that have not exceeded wrap, but proceeding attributes are indented onto their own lines, this is the default behavior Prettify uses.*\n```liquid\n\n\n
\n\n\n```\n\n---\n\n#### Enabled\nBelow is an example of how this rule works if it's enabled (ie: `true`) and attributes have exceeded the defined wrap limit. Notice how all attributes and indented onto their own line, including the leading attribute.\n\n```liquid\n\n\n\n\n\n```" }, "forceIndent": { "type": "boolean", "default": false, - "markdownDescription": "Will force indentation upon all content and tags without regard for the text nodes." + "markdownDescription": "**_FORCE INDENT_**\n\n_Will force indentation upon all content and tags without regard for the text nodes._\n#### Disabled   👎\n```liquid\nHello World\n\n\n```\n\n---\n\n#### Enabled   👍\n```liquid\n\n Hello World\n\n\n\n```" }, "forceAttribute": { "type": ["boolean", "number"], "default": false, - "markdownDescription": "If all markup attributes should be indented each onto their own line. You can optionally provide an integer value of `1` or more. When an integer value is passed, attributes will be forced only if the number of attributes contained on the tag exceeds the supplied value limit. When you define a `wrap` level then attributes will be automatically forced. This is typically a better solution than forcing all attributes onto newlines or an even better solution would be to set a limit level.\n\n#### Disabled Example\n*Below is the default, wherein attributes are only forced when wrap is exceeded.*\n```liquid\n
\n
\n```\n#### Enabled Example\n*Below is an example of how this rule works if it's enabled, ie: `true`*\n```liquid\n\n```\n#### Limit Example\n*Below we provide a value of `2` so formatting will be applied as such:*\n```liquid\n\n
\n\n\n\n\n\n
\n```" + "markdownDescription": "**_FORCE ATTRIBUTE_**\n\n_Whether all markup attributes should be indented each onto their own line. You can optionally provide an integer value of `1` or more. When an integer value is passed, attributes will be forced only if the number of attributes contained on the tag exceeds the supplied value limit. When you define a `wrap` level then attributes will be automatically forced. This is typically a better solution than forcing all attributes onto newlines or an even better solution would be to set a limit level._\n\n---\n\n#### Disabled   👎\nBelow is the default, wherein attributes are only forced when wrap is exceeded.\n```liquid\n\n
\n
\n\n\n```\n\n---\n\n#### Enabled   👍\nBelow is an example of how this rule works if it's enabled, ie: `true`\n```liquid\n\n\n```\n\n---\n\n#### Limit Example   👍 👍\n*Below we provide a value of `2` so formatting will be applied as such:*\n```liquid\n\n
\n\n\n\n\n\n
\n\n\n```" }, "preserveText": { "type": "boolean", @@ -157,7 +138,7 @@ "sortProperties": { "type": "boolean", "default": false, - "markdownDescription": "Sort Selectors" + "markdownDescription": "**_SORT PROPERTIES_**\n\n_This option will alphabetically sort object properties (keys). This can be an expensive operation when dealing with large objects with over 2k properties._\n\n---\n#### Before   \nWhen disabled, ie: `false` properties will not be sorted.\n```css\n.class {\n width: 100px;\n color: blue;\n font-size: 20px;\n background: pink\n}\n\n```\n\n---\n\n#### After   👎\nWhen set to `true` all properties are alphanumerically sorted\n```json\n\n.class {\n color: blue;\n background: pink;\n font-size: 20px;\n width: 100px;\n}\n\n```" }, "classPadding": { "type": "boolean", @@ -176,6 +157,25 @@ "default": false, "title": "Single Lined Selectors", "markdownDescription": "If comma separated CSS selectors should present on a single line of code." + }, + "quoteConvert": { + "default": "none", + "title": "Convert Quotes", + "markdownDescription": "If the quotes of script strings or document attributes should be converted to single quotes or double quotes", + "oneOf": [ + { + "enum": ["double"], + "markdownDescription": "Converts single quotes to double quotes" + }, + { + "enum": ["none"], + "markdownDescription": "Ignores this option" + }, + { + "enum": ["single"], + "markdownDescription": "Converts double quotes to single quotes" + } + ] } } }, @@ -235,17 +235,6 @@ "title": "Space Following Case", "markdownDescription": "If the colon separating a case's expression (of a switch/case block) from its statement should be followed by a space instead of indentation, thereby keeping the case on a single line of code" }, - "commentIndent": { - "type": "boolean", - "default": false, - "title": "Comment Indentation", - "markdownDescription": "This will determine whether comments should always start at position 0 of each line or if comments should be indented according to the code" - }, - "inlineReturn": { - "type": "boolean", - "default": false, - "title": "If can return inline" - }, "elseNewline": { "type": "boolean", "default": false, @@ -321,8 +310,7 @@ "methodChain": { "type": "number", "default": 3, - "title": "Method Chains", - "markdownDescription": "When to break consecutively chained methods and properties onto separate lines. A negative value disables this option. A value of 0 ensures method chains are never broken" + "markdownDescription": "**_METHOD CHAINING_**\n\n_When to break consecutively chained methods and properties onto separate lines. A negative value (eg: `-1`) disables this option. A value of `0` ensures method chains are never broken_\n\n---\n#### `0`\nPassing a value of `0` will never break chained methods.\n```js\n\nwindow.property.method(() => {}).foo(() => {})\n\n\n```\n\n---\n\n#### `3` (default)\nWhen there are more than `3` methods and/or properties they will be split onto separate lines.\n```js\n\nwindow\n .property\n .method(() => {})\n .foo(() => {})\n\n\n```" }, "neverFlatten": { "type": "boolean", @@ -342,11 +330,10 @@ "title": "No Semicolons", "markdownDescription": "Removes semicolons that would be inserted by ASI. This option is in conflict with option 'correct' and takes precedence over conflicting features. Use of this option is a possible security/stability risk" }, - "preserveComment": { + "objectSort": { "type": "boolean", "default": false, - "title": "Eliminate Word Wrap Upon Comments", - "markdownDescription": "Prevent comment reformatting due to option wrap" + "markdownDescription": "**_OBJECT SORT_**\n\n_This option will alphabetically sort object properties (keys). This can be an expensive operation when dealing with large objects with over 2k properties._\n\n---\n#### Disabled   👍\nWhen disabled, ie: `false` properties will not be sorted.\n```js\n\n{\n e: \"5\",\n b: \"2\",\n d: \"4\",\n a: \"1\",\n f: \"6\",\n c: \"3\"\n}\n\n\n```\n\n---\n\n#### Enabled   👎\nWhen set to `true` all properties are alphanumerically sorted\n```js\n\n{\n a: \"1\",\n b: \"2\",\n c: \"3\",\n d: \"4\",\n e: \"5\",\n f: \"6\"\n}\n\n\n```" }, "quoteConvert": { "default": "none", @@ -373,41 +360,6 @@ "title": "Function Space", "markdownDescription": "Inserts a space following the function keyword for anonymous functions" }, - "styleGuide": { - "type": "string", - "default": "none", - "title": "Script Styleguide", - "markdownDescription": "Provides a collection of option presets to easily conform to popular JavaScript style guides.", - "oneOf": [ - { - "enum": ["none"] - }, - { - "enum": ["airbnb"] - }, - { - "enum": ["crockford"] - }, - { - "enum": ["google"] - }, - { - "enum": ["jquery"] - }, - { - "enum": ["mediawiki"] - }, - { - "enum": ["semistandard"] - }, - { - "enum": ["standard"] - }, - { - "enum": ["yandex"] - } - ] - }, "ternaryLine": { "type": "boolean", "default": false, @@ -419,6 +371,11 @@ "default": false, "title": "Variable Declaration Lists", "markdownDescription": "If consecutive JavaScript variables should be merged into a comma separated list or if variables in a list should be separated" + }, + "vertical": { + "type": "boolean", + "default": false, + "markdownDescription": "**_VERTICAL LIST_**\n\n_If consecutive JavaScript variables should be merged into a comma separated list or if variables in a list should be separated_\n\n---\n#### Before Formatting\nBelow is an example of how this rule works if it's enabled, ie: `true`\n```js\n\nconst object = {\n someProperty: 'x',\n anotherProperty: 'x',\n fooProperty: 'x'\n};\n\n\n```\n\n---\n\n#### After Formatting\nAfter formatting all declaration lists will be aligned in a vertical manner.\n```js\n\nconst object = {\n someProperty : 'x',\n anotherProperty : 'x',\n fooProperty : 'x'\n};\n\n\n```" } } }, @@ -427,98 +384,30 @@ "arrayFormat": { "type": "string", "default": "default", - "title": "Formatting Arrays", - "markdownDescription": "Determines if all array indexes should be indented, never indented, or left to the default.", - "oneOf": [ - { - "enum": ["default"], - "markdownDescription": "Default formatting" - }, - { - "enum": ["indent"], - "markdownDescription": "Always indent each index of an array" - }, - { - "enum": ["inline"], - "markdownDescription": "Ensure all array indexes appear on a single line" - } - ] + "markdownDescription": "**_ARRAY FORMAT_**\n\n_Determines if all array indexes should be indented, never indented, or left to the default. The `default` option will leave array indexes intact and not apply any formatting._\n\n---\n#### `inline`   👎\nEnsure all array indexes appear on a single line\n```json\n\n{\n \"object\": [1,2,3,4]\n}\n\n```\n---\n#### `indent`   👍\nAlways indent each index of an array\n\n```json\n\n{\n \"object\": [\n 1,\n 2,\n 3,\n 4\n ]\n}\n\n```", + "enum": ["default", "indent", "inline"] }, "braceAllman": { "type": "boolean", "default": false, - "title": "Style of Indent", - "markdownDescription": "Determines if opening curly braces will exist on the same line as their condition or be forced onto a new line. (Allman style indentation)\n#### Disabled\n\n```json\n[\n { \"prop\": \"value\" },\n { \"prop\": \"value\" },\n { \"prop\": \"value\" }\n]\n```\n#### Enabled\n\n```json\n[\n {\n \"prop\": \"value\"\n },\n {\n \"prop\": \"value\"\n },\n {\n \"prop\": \"value\"\n }\n]\n```" + "markdownDescription": "**_BRACE ALLMAN_**\n\n_Determines if opening curly braces will exist on the same line as their condition or be forced onto a new line. The formatting structure is known as [Allman](https://en.wikipedia.org/wiki/Indentation_style#Allman_style) style indentation_.\n\n---\n\n#### Disabled   👎\nBelow is an example when this option is set to `false` and each object in the array starts curly braces inline.\n```json\n\n[\n { \"prop\": \"value\" },\n { \"prop\": \"value\" },\n { \"prop\": \"value\" }\n]\n\n```\n---\n#### Enabled   👍\nBelow is an example when this option is set to `true` and each object in the array starts on a newline.\n```json\n\n[\n {\n \"prop\": \"value\"\n },\n {\n \"prop\": \"value\"\n },\n {\n \"prop\": \"value\"\n }\n]\n\n```" }, "bracePadding": { "type": "boolean", "default": false, "title": "Brace Lines", - "markdownDescription": "If true an empty line will be inserted after opening curly braces and before closing curly braces" - }, - "braceStyle": { - "type": "string", - "default": "none", - "title": "Brace Style", - "markdownDescription": "Emulates JSBeautify's brace_style option", - "oneOf": [ - { - "enum": ["collapse"], - "markdownDescription": "Sets options.format_object to 'indent' and options.neverflatten to true" - }, - { - "enum": ["collapse-preserve-inline"], - "markdownDescription": "Sets options.bracepadding to true and options.format_object to 'inline'" - }, - { - "enum": ["expand"], - "markdownDescription": "Sets options.braces to true, options.format_object to 'indent', and options.never flatten to true." - }, - { - "enum": ["none"], - "markdownDescription": "Ignores this option" - } - ] - }, - "formatArray": { - "type": "string", - "default": "default", - "title": "Formatting Arrays", - "markdownDescription": "Determines if all array indexes should be indented, never indented, or left to the default.", - "oneOf": [ - { - "enum": ["default"], - "markdownDescription": "Default formatting" - }, - { - "enum": ["indent"], - "markdownDescription": "Always indent each index of an array" - }, - { - "enum": ["inline"], - "markdownDescription": "Ensure all array indexes appear on a single line" - } - ] + "markdownDescription": "**_BRACE PADDING_**\n\n_The `bracePadding` rule will insert newlines at the top and bottom of nested properties._\n\n---\n#### Disabled   👍\nBelow is an example when this option is set to `true`\n```json\n\n{\n \"one\": {\n \"xx\": {\n \"xx\": false\n }\n }\n}\n\n```\n\n---\n\n#### Enabled   👎\nBelow is an example when this option is set to `false`\n```json\n\n{\n \"one\": {\n\n \"xx\": {\n\n \"xx\": false\n\n }\n\n }\n}\n\n```" }, "objectIndent": { "type": "string", "default": "default", - "title": "Formatting Objects", - "markdownDescription": "Determines if all object keys should be indented, never indented, or left to the default", - "oneOf": [ - { - "enum": ["default"], - "markdownDescription": "Default formatting" - }, - { - "enum": ["indent"], - "markdownDescription": "Always indent each key/value pair" - }, - { - "enum": ["inline"], - "markdownDescription": "Ensure all key/value pairs appear on the same single line" - } - ] + "markdownDescription": "**Object Indent**\n\nControls how arrays on objects are formatted. We will exclude the `inline` option to prevent unreadable objects. If all object keys should be indented, never indented, or left to the default.", + "enum": ["default", "indent", "inline"] + }, + "objectSort": { + "type": "boolean", + "default": false, + "markdownDescription": "**_OBJECT SORT_**\n\n_This option will alphabetically sort object properties (keys). This can be an expensive operation when dealing with large objects with over 2k properties._\n\n---\n#### Disabled   👍\nWhen disabled, ie: `false` properties will not be sorted.\n```json\n\n{\n \"e\": \"5\",\n \"b\": \"2\",\n \"d\": \"4\",\n \"a\": \"1\",\n \"f\": \"6\",\n \"c\": \"3\"\n}\n\n```\n\n---\n\n#### Enabled   👎\nWhen set to `true` all properties are alphanumerically sorted\n```json\n\n{\n \"a\": \"1\",\n \"b\": \"2\",\n \"c\": \"3\",\n \"d\": \"4\",\n \"e\": \"5\",\n \"f\": \"6\"\n}\n\n```" } } }, diff --git a/snippets/schema.json b/snippets/schema.json index ea6b35ff..7b6874a0 100644 --- a/snippets/schema.json +++ b/snippets/schema.json @@ -183,8 +183,7 @@ "\t\"placeholder\": \"${1:placeholder}\"", "}" ], - "scope": "liquid","description": "schema: number - " + "description": "schema: number" }, "schema: range": { "scope": "liquid", diff --git a/snippets/tags.json b/snippets/tags.json index 70fad8d5..6d2a2b42 100755 --- a/snippets/tags.json +++ b/snippets/tags.json @@ -228,7 +228,7 @@ "body": ["{%${1:-} # $2 ${1:-}%}"] }, "comment, block": { - "prefix": "#", + "prefix": "comment", "body": [ "{%${1:-} comment ${1:-}%}", "\t$0", diff --git a/src/providers/CompletionProvider.ts b/src/providers/CompletionProvider.ts index 34e8e023..4f7cb65d 100644 --- a/src/providers/CompletionProvider.ts +++ b/src/providers/CompletionProvider.ts @@ -24,8 +24,6 @@ import { CompletionItemKind } from 'vscode'; - - /** * Completion Provider * @@ -40,16 +38,15 @@ import { */ export class CompletionProvider implements CompletionItemProvider { - constructor(engine: Engines, enable: Workspace.Completion) { - - for (const active in enable) this.enable[active] = enable[active] + constructor (engine: Engines, enable: Workspace.Completion) { + for (const active in enable) this.enable[active] = enable[active]; if (engine === 'shopify') { - q.setEngine(Engine.shopify) + q.setEngine(Engine.shopify); this.engine = engine === 'shopify' ? Engine.shopify - : Engine.standard + : Engine.standard; } if (this.enable.tags) { @@ -61,16 +58,16 @@ export class CompletionProvider implements CompletionItemProvider - + - + + {{- page_title -}} {%- if current_tags -%} @@ -24,61 +28,18 @@ {%- render "favicons" -%} {%- render "meta_tags" -%} - <link - crossorigin - href="https://api.ipstack.com" - rel="dns-prefetch"> - <link - crossorigin - href="https://api.brixtol.com" - rel="dns-prefetch"> - <link - crossorigin - href="https://s.pinimg.com" - rel="dns-prefetch"> - <link - crossorigin - href="https://brixtol.cloud" - rel="dns-prefetch"> - <link - crossorigin - href="https://cdn.shopify.com" - rel="preconnect"> - <link - crossorigin - href="https://use.typekit.net" - rel="preconnect"> - <link - crossorigin - href="https://brixtol.cloud" - rel="preconnect"> - <link - as="font" - crossorigin - href="{{ 'catalogue-ll-regular.woff2' | asset_url }}" - rel="preload" - type="font/woff2"> - <link - as="font" - crossorigin - href="{{ 'catalogue-ll-italic.woff2' | asset_url }}" - rel="preload" - type="font/woff2"> - <link - as="style" - crossorigin - href="{{ 'stylesheet.css' | asset_url }}" - rel="preload"> - <link - as="style" - crossorigin - href="{{ 'theme.css' | asset_url }}" - rel="preload"> - <link - as="script" - crossorigin - href="{{ 'bundle.js' | asset_url -}}" - rel="preload"> + <link crossorigin href="https://api.ipstack.com" rel="dns-prefetch"> + <link crossorigin href="https://api.brixtol.com" rel="dns-prefetch"> + <link crossorigin href="https://s.pinimg.com" rel="dns-prefetch"> + <link crossorigin href="https://brixtol.cloud" rel="dns-prefetch"> + <link crossorigin href="https://cdn.shopify.com" rel="preconnect"> + <link crossorigin href="https://use.typekit.net" rel="preconnect"> + <link crossorigin href="https://brixtol.cloud" rel="preconnect"> + <link as="font" crossorigin href="{{ 'catalogue-ll-regular.woff2' | asset_url }}" rel="preload" type="font/woff2"> + <link as="font" crossorigin href="{{ 'catalogue-ll-italic.woff2' | asset_url }}" rel="preload" type="font/woff2"> + <link as="style" crossorigin href="{{ 'stylesheet.css' | asset_url }}" rel="preload"> + <link as="style" crossorigin href="{{ 'theme.css' | asset_url }}" rel="preload"> + <link as="script" crossorigin href="{{ 'bundle.js' | asset_url -}}" rel="preload"> <style> @@ -86,15 +47,10 @@ </style> - <link - href="{{ 'stylesheet.css' | asset_url }}" - rel="stylesheet"> - <link - href="{{ 'theme.css' | asset_url }}" - rel="stylesheet"> + <link href="{{ 'stylesheet.css' | asset_url }}" rel="stylesheet"> + <link href="{{ 'theme.css' | asset_url }}" rel="stylesheet"> - <script - data-spx-eval="false"> + <script data-spx-eval="false"> {%- render 'shop.js' -%} {%- if condition -%} const foo = {}; @@ -102,30 +58,18 @@ {%- endif -%} </script> - <script - data-spx-eval="false"> + <script data-spx-eval="false"> {%- render 'i18n.js' -%} </script> - <script - data-spx-eval="false" - defer - src="{{ 'bundle.js' | asset_url }}" - type="module"> + <script data-spx-eval="false" defer src="{{ 'bundle.js' | asset_url }}" type="module"> window.app(); </script> - <script - async - defer - src="https://www.googletagmanager.com/gtag/js?id=g-htnv2npht6"></script> + <script async defer src="https://www.googletagmanager.com/gtag/js?id=g-htnv2npht6"></script> {%- if template contains "customers" -%} - <script - async - src="{{ 'shopify_common.js' | shopify_asset_url -}}"></script> - <script - async - src="{{ 'customer_area.js' | shopify_asset_url }}"></script> + <script async src="{{ 'shopify_common.js' | shopify_asset_url -}}"></script> + <script async src="{{ 'customer_area.js' | shopify_asset_url }}"></script> {%- endif -%} {%- capture content_header -%} @@ -135,17 +79,16 @@ {{ content_header | replace: "<script", "<script data-spx-eval="false"" }} </head> - <body - attr="{{ object.prop.prop['string'][10] | filter: false }}"> + <body attr="{{ object.prop.prop['string'][10] | filter: false }}"> - <h1></h1> + <h1> + {{ }} + </h1> - <div - id="foo" - {{ object.prop.prop[string][10] | filter: false }}></div> - {%- if condition -%} - {%- endif -%} + + <div id="foo" {{ object.prop.prop[string][10] | filter: false }}></div> + {%- if condition -%}{%- endif -%} {%- render "drawer_menu", overlay: "drawer-overlay" -%} @@ -164,4 +107,3 @@ </body> </html> - diff --git a/vsix/shopify-liquid-3.0.0.vsix b/vsix/shopify-liquid-3.0.0.vsix index be467842..a8054949 100644 Binary files a/vsix/shopify-liquid-3.0.0.vsix and b/vsix/shopify-liquid-3.0.0.vsix differ diff --git a/shopify-liquid-3.0.0.vsix b/vsix/shopify-liquid-3.0.1.vsix similarity index 93% rename from shopify-liquid-3.0.0.vsix rename to vsix/shopify-liquid-3.0.1.vsix index 06a08170..5bd72519 100644 Binary files a/shopify-liquid-3.0.0.vsix and b/vsix/shopify-liquid-3.0.1.vsix differ