redhat-developer / quarkus-ls

Language server for Quarkus tooling
Eclipse Public License 2.0
44 stars 15 forks source link

Quick fix to insert all missing attributes for user tag in Qute file adds a `nested-content` attribute #841

Closed datho7561 closed 1 year ago

datho7561 commented 1 year ago

Let's say you have a user tag: (this is one from quarkus-renarde-todo)

formElement.html:

<label class="form-label" for="{name}">{label}</label>
<div class="mb-3 {class??}">
    {nested-content}
{#ifError name}
    <span class="invalid-feedback">​{#error name/}</span>​
{/ifError}
</div>

and you reference it from another Qute template like this:

{#formElement}
  <h3>Hello!</h3>
{/}

Then there is a quick fix that appears on #formElement to add all the missing attributes to the user tag. However, this quick fix adds an attribute called nested-content. However, nested-content is a special key that gets replace with the content of the user tag (in this case <h3>Hello!</h3>). It doesn't makes sense to add it as an attribute with the quick fix.

angelozerr commented 1 year ago

@JessicaJHee could you look at this issue when you will have time, I think the fix should be easy.