I am writing django templates in Eclipse->prefrences->templates, to autocomplete DJango templates. I wrote this
{% block ${cursor} %}
{% endblock %}
Now, when I request and do autocompletion, after typing {% the autocompletion is
{% {% block %}
{% endblock %}
While I would like
{% block %}
{% endblock %}
With cursor after block. How can I do this?
Instead of typing
{%and selectingdj_for_empty, try typingdj_and then auto-completing. It will behave the way you expect in that case.BOTTOM-LINE: You auto-complete the templates into the editor based on the template name, not based on the template contents.
It appears that autocompletion has two sources: regular HTML tags (for which I can’t find the definitions to change anywhere in Eclipse, sorry) and the templates themselves (which you correctly demonstrated in your comment with the screenshot).
Look at this image:
Instead of typing
<tand triggering auto-complete, I typedt. You can see that there are entries with<>– indicating these are autocompletions based on the actual HTML tag – and entries with#– indicating these are autocompletions based on a template.It appears templates are to be accessed by the name of the template. Notice that the template named
tableprovides a complete<table>and not just the<table></table>that is autocompleted if you just type<taband autocompletes.