panoply / vscode-liquid

💧Liquid language support for VS Code
https://marketplace.visualstudio.com/items?itemName=sissel.shopify-liquid
Other
173 stars 22 forks source link

Incorrect comment blocks in Liquid files with this extension enabled #119

Closed t3pfaffe closed 1 year ago

t3pfaffe commented 2 years ago

Using the keybind ctrl+/ to generate a new comment block erroneously produces a string of characters ({%\s*#) instead of the expected {% comment %} {% endcomment %}. I previously had the extension Liquid Comments enabled although this issue appears to happen regardless of that being enabled. The issue only occurs when this liquid extension is enabled. This issue has only started happening in the last day.

I have not changed my VSCode configuration in that time outside of a VSCode update/restart and I don't think there has been any new updates from this extension.

icantrank commented 1 year ago

This is also happening to me with .css.liquid files using the liquid-css language and ctrl+/ hotkey. I would usually expect /* */ but I get this {%\s*# instead.

ArturoDent commented 1 year ago

I see this in the liquid-css.language-configuration.json file:

"comments": {
  "lineComment": "{%\\s*#",
  "blockComment": ["/*", "*/"]
},

there is a regex for the lineComment value. Are regex's allowed there?

@icantrank Are there line comments in .css.liquid files or only a surrounding block comment of the form /* * when you hit ctrl+/?

ArturoDent commented 1 year ago

Until this issue is fixed, I posted a workaround at SO: [VSCode not commenting css.liquid lines correctly](https://stackoverflow.com/questions/74181082/vscode-not-commenting-css-liquid-lines-correctly)

liquidComments

I am not familiar with liquid comment styles so let me know if something needs to be changed.

panoply commented 1 year ago

Hey guys,

This one is on me. It seems I added an expression in the language configuration. I'll apply a patch later today for this.

FHoogland commented 1 year ago

@panoply Hey, has this issue been fixed yet? Is there any extension-setting I should change for the fix to take effect? I updated the extension yesterday but the problem still persists on liquid.css files

panoply commented 1 year ago

Shipping this today. Sorry, I have been sick last couple of days.

FHoogland commented 1 year ago

No worries, was just wondering if I was doing something wrong. Hope you feel better soon!

panoply commented 1 year ago

🚢 Shipped - Update and reload vscode everything should work as intended.