Creating Eclipse Patterns

I write django templates in Eclipse-> prefrences-> templates to autocomplete DJango templates. I wrote this

{% block ${cursor} %} {% endblock %} 

Now, when I request and execute autocomplete, after entering {% autocomplete

 {% {% block %} {% endblock %} 

While I would like

 {% block %} {% endblock %} 

With cursor after block. How can i do this?

+7
eclipse django templates eclipse-plugin
source share
1 answer

Instead of entering {% and choosing dj_for_empty , try dj_ and then dj_ autocomplete. It will behave as you expect in this case.

BOTTOM-LINE: You automatically fill out templates in the editor based on the name of the template, and not based on the contents of the template.

It seems that autocomplete has two sources: regular HTML tags (because of which I cannot find definitions for changes in Eclipse, sorry) and the templates themselves (which you correctly demonstrated in your comment on the screenshot).

Take a look at this image:

alt text

Instead of typing <t and starting autocomplete, I typed t . You can see that there are entries with <> indicating that these are auto-complete based on the actual HTML tag, and c # entries indicating that these are auto-completion based on the template.

It looks like templates should be accessible by template name. Note that the named table template provides a full <table> and not just a <table></table> which is automatically populated if you just type <tab and autocompletes.

+4
source share

All Articles