0

{%- -%} is a whitespace delimiter in Shopify liquid. I am trying to edit the default emmet function in PhpStorm's twig language to instead output this rather than the default {% %}.

Also looking to change the default twig comment style from {# #} to {% comment %}{% endcomment %}

As this is specific to Liquid, I don't have access to editing the delimiters, such as is the case using something like Vue

s0rfi949
  • 378
  • 1
  • 4
  • 18
  • 1) *"`{%- -%}`"* Sadly, Twig plugin does not allow customizing the lexer syntax yet -- https://youtrack.jetbrains.com/issue/WI-15739 ; 2) *"`{% comment %}{% endcomment %}`"* -- similar story. Watch after https://youtrack.jetbrains.com/issue/RUBY-7210 for proper Liquid support. – LazyOne Nov 09 '19 at 21:01
  • 3) *"...default emmet function in PhpStorm's twig language..."* Commenting functionality is not provided by Emmet by any means -- it's implemented by plugin specifically for this language. If you want to use some emmet-like abbreviation that will expand into `{% comment %}{% endcomment %}` -- you are welcome to create custom Live Template and use it ("Settings (Preferences on macOS) | Editor | Live Templates | Editor | Live Templates") – LazyOne Nov 09 '19 at 21:05
  • Possible duplicate of [Conflict on Template of Twig and Vue.js](https://stackoverflow.com/questions/31480612/conflict-on-template-of-twig-and-vue-js) – DarkBee Nov 10 '19 at 15:59

1 Answers1

1

Sadly, Twig support plugin does not allow customizing the lexer syntax yet.

https://youtrack.jetbrains.com/issue/WI-15739 -- watch this ticket (star/vote/comment) to get notified on any progress.


{% comment %}{% endcomment %} -- similar story (you cannot customize what symbols/tags are used for comments.

Proper Liquid templates support is tracked in the following ticket: https://youtrack.jetbrains.com/issue/RUBY-7210 -- star/vote/comment it to get notified on any progress. Hopefully devs can bring some updates in one of the next major versions (at very least there was some activity in this ticket in terms of expected Liquid support/functionality).


...default emmet function in PhpStorm's twig language...

Commenting functionality is not provided by Emmet by any means -- it's implemented by plugin specifically for this language (IDE has standard "Block Comment" and "Line Comment" actions and plugins for corresponding language just provides how the commenting should be handled.

If you want to use some emmet-like abbreviation that will expand into {% comment %}some text here{% endcomment %} or alike then you are welcome to create custom Live Template and use it even right now (e.g. as a "Surround with..." kind of template). You can create one at Settings (Preferences on macOS) | Editor | Live Templates.

https://www.jetbrains.com/help/phpstorm/using-live-templates.html

LazyOne
  • 158,824
  • 45
  • 388
  • 391