Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
angelozerr opened this issue Dec 14, 2021 · 4 comments · May be fixed by #563
Open

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

angelozerr opened this issue Dec 14, 2021 · 4 comments · May be fixed by #563

Comments

@angelozerr
Copy link
Contributor

In the future, Qute will deprecate #with section.

We should support diagnostic and quickfix fir that:

  • report a diagnostic in #with with LSP deprecated diagnostic tag.
  • provide a codeaction which transform #with with #let

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
Copy link
Collaborator

mkouba commented Dec 15, 2021

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
Copy link
Contributor Author

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
Copy link
Contributor

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

@AlexXuChen AlexXuChen linked a pull request Feb 17, 2022 that will close this issue
@mkouba
Copy link
Collaborator

mkouba commented Feb 21, 2022

@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?

@rgrunber rgrunber added this to the v0.11.0 milestone Feb 25, 2022
@angelozerr angelozerr removed this from the v0.11.0 milestone Mar 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants