redhat-developer / quarkus-ls

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

CodeAction to replace deprecated `#with` into `#let` section #489

Open angelozerr opened 2 years ago

angelozerr commented 2 years ago

In the future, Qute will deprecate #with section.

We should support diagnostic and quickfix fir that:

Given this Qute template:

{@org.acme.qute.Item item}
{#with item}
   {name}
   {price}
{/with}

with should report a deprecated diagnostic and provide a code action to replace with:

{@org.acme.qute.Item item}
{#let name=item.name price=item.price}
   {name}
   {price}
{/let}

@mkouba what do you think about that?

mkouba commented 2 years ago

I'd rather recommend users to use {item.name} and {item.price} instead... but ofc the snippet {#let name=item.name price=item.price} is OK.

angelozerr commented 2 years ago

I'd rather recommend users to use {item.name} and {item.price} instead... but ofc the snippet {#let name=item.name price=item.price} is OK.

Okthanks for your feedback, we should provide this kind of quickfix in priority.

AlexXuChen commented 2 years ago

@mkouba In which version of Qute will #with be deprecated, and should we be setting #with as deprecated?

mkouba commented 2 years ago

@mkouba In which version of Qute will #with be deprecated, and should we be setting #with as deprecated?

There is no plan to deprecate the #with section so far. There is a big warning in the docs though and it explains that this section should not be used in type-safe templates or templates that define type-safe expressions. We could do the same in the ide, or?