-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intial support for vsCodeTagSnippets #589
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🆒 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 |
@@ -4,6 +4,7 @@ | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: