Open JoedowJoedow opened 1 year ago
Please, provide a full snippet and a screenshot, because it works for me:
Hey hurricup, thanks for your quick reply. I pasted a screenshot taken from PyCharm and at least there I get the error message as you see on the upper right corner. It's also independent if I use parameters or not. Greets Cristof
Please, provide a snippet, not a screenshot.
[% MACRO print_message BLOCK %] [% RAWPERL %] print($context->stash->{'message'} . "\n"); [% END %] [% END %]
[% MACRO print_message(message) BLOCK %] [% RAWPERL %] print($context->stash->{'message'} . "\n"); [% END %] [% END %]
In the screenshot you see the red welled line and when you hoover over it it messages: TT2: TT2_IDENTIFIER expected, got '%]'
Hope that clarifies it. Greets Cristof
Hey *, I would have have a feature request regarding following topic:
Template Toolkit has a feature regarding macros allowing anonymous block. (http://www.template-toolkit.org/docs/manual/Directives.html#section_MACRO) The syntax looks like
[% MACRO header BLOCK %] ...content... [% END %]
[% header %]
When Pycharm parses the .tt2 file it detects an error (TT2: TT2_IDENTIFIER expected, got '%]'
I would assume that the TemplateToolkit.bnf file needs do consider for macro_directive the optional "BLOCK" directive
Thanks a lot for your work on this plugin
PS.: seen on latest PyCharm 2023.1.3, Win 10