Intial support for vsCodeTagSnippets#589
Conversation
mattcoley
left a comment
There was a problem hiding this comment.
🆒 Looks like if/elif are missing the jinjavaparam in the doc, can you add it here?
|
I think set tag is a bit custom here since I think you want |
|
I updated the output in at the top of the page. I did notice for a lot of them (i.e. if, else, macro, etc.) We have no jinjava annotation for body, would it be worthwhile to add that so we can represent where code would go in an if statement for example? |
@phalaphone do you mean something like this? If so, I think that would be helpful. Each |
| import com.hubspot.jinjava.doc.annotations.JinjavaMetaValue; | ||
| import com.hubspot.jinjava.doc.annotations.JinjavaParam; | ||
| import com.hubspot.jinjava.doc.annotations.JinjavaSnippet; | ||
| import com.hubspot.jinjava.doc.annotations.JinjavaVSCodeSnippet; |
There was a problem hiding this comment.
I'm not sure if this should be VSCode specific. This syntax is technically borrowed from Textmate and other editors use a similar format so I think this could be used across other editors pretty easily
|
Here is the current list: Any changes before we get this out as a starting point? |
|
Thanks @phalaphone! I made some changes to some snippets below: {% import '${1:path}' ${2: as ${3:import_name}} %}
{% elif ${1:condition} %}
$0
{% autoescape %}
{% endautoescape %}
{% from '${1:path}' import ${2:macro_name} %}
{% macro ${1:macro_name}(${2:argument_names}) %}
$0
{% endmacro %}**
{% raw %}
{% endraw %}
{% else %}
$0
{% if ${1:condition} %}
$0
{% endif %}
{% print ${1:expr} %}
{% do ${1:expr} %}
{% cycle ${1:string_to_print} %}
{% unless ${1:expr} %}
$0
{% endunless %}
{% include '${1:path}' %}
{% ifchanged %}
$0
{% endifchanged %}
{% set ${1:var} = ${2:expr} %}
{% block ${1:block_name} %}
$0
{% endblock {$1} %}
{% call ${1:macro_name}(${2:argument_names}) %}
$0
{% endcall %}
{% extends '${1:path}' %}
{% for ${1:items} in ${2:list} %}
{{ ${1} }}$0
{% endfor %}```
The most notable change is that the code placeholder should just be `$0`, but there are a bunch of small changes to most of these. Let me know if you have any questions about any changes. |
Added new method to produce a string of tag snippets formatted for use in the hubspot vscode plugin.
Updated
(1/29) Output: