Skip to content

Allow default, global configuration for autocompletion on all .html files #20

Closed
@phillipuniverse

Description

First of all, thanks for the awesome work on this plugin! Preliminary testing has this looking pretty good.

Over at Broadleaf we use Thymeleaf heavily in our project. However, we have our Thymeleaf templates split out into loads of various partials and then sew them together with th:substitueby. Arguably, this is how most Thymeleaf projects should operate so that you can have separation of concerns as well as remove code duplication in some cases.

If I'm using the current plugin the current way it is designed, then that means that I need to go and add an xmlns to all of my template files. In some of the cases with partials, there isn't even a root element defined (the template is just a collection of sibling HTML elements) so I would also have to add the xmlns to all of those sibling HTML elements as well.

To be a little more explicit, if I have a Thymeleaf template that looks like this (sorry that this is mostly a contrived example):

<div class="container">
    <input th:value="${aModelVariable}"
           class="listgrid-criteria-input datepicker"
           type="text"
           placeholder="Start Date"/>
    <i class="icon-calendar"></i>
</div>
<br />
<div class="datepicker-container">
    <input th:value="${bModelVariable}"
           class="listgrid-criteria-input datepicker"
           type="text"
           placeholder="End Date"/>
    <i class="icon-calendar"></i>
</div>

This is then included in a parent template with a th:substituteby. Then in order to get the benefits of the Eclipse plugin, I would have to change the above to:

<div xmlns:th="http://www.thymeleaf.org" class="container">
    <input th:value="${aModelVariable}"
           class="listgrid-criteria-input datepicker"
           type="date"
           placeholder="Start Date"/>
    <i class="icon-calendar"></i>
</div>
<br />
<div xmlns:th="http://www.thymeleaf.org" class="datepicker-container">
    <input th:value="${bModelVariable}"
           class="listgrid-criteria-input datepicker"
           type="date"
           placeholder="End Date"/>
    <i class="icon-calendar"></i>
</div>

This is really more of an enhancement request, and I'm curious if this is how others are using Thymeleaf in their projects. For us, all of our template files are in Thymeleaf, so it would be nice if there is some sort of global configuration for 'Give content assist to all of the following file suffixes'.

I would love to help contribute but my knowledge of Eclipse plugins is slim to none. I will attempt to come up with something towards this goal but wanted to get this on paper publicly rather than let it just sit in my head :)

Again, thanks for all the hard work!

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions