redhat-developer / redhat-developer/quarkus-ls

Validation issue with {#with}

Open
#450 11 comments 0 reactions 1 assignee View on GitHub

@angelozerr is already working on this.

Since Dec 2, 2021.

bug qute template-file
Dominant language
Java
Stars
50
Forks
18
Avg merge
22h 11m
Merged PRs (30d)
3

Description

The following snippet validates properly with qute-ls but fails during quarkus build:

{#let title="WELCOME" }
	{title} 

	{#with title}
		{blank}
	{/}
	{{title}}
  {/let}
java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.qute.deployment.QuteProcessor#processTemplateErrors threw an exception: io.quarkus.qute.TemplateException: Found template problems (2):
[1] Incorrect expression found: {blank}
        - Only type-safe expressions are allowed in the checked template defined via: org.acme.ItemResource$Templates.list(); an expression must be based on a checked template parameter [items], or bound via a param declaration, or the requirement must be relaxed via @CheckedTemplate(requireTypeSafeExpressions = false)
        - at ItemResource/list.qute.html:12

Another case:

{#each item in items}
  {#with item}
	{name}
  {/with}
{each}

No error in qute-ls but at build time you get:

[2] Incorrect expression found: {name}
        - Only type-safe expressions are allowed in the checked template defined via: org.acme.ItemResource$Templates.list(); an expression must be based on a checked template parameter [items], or bound via a param declaration, or the requirement must be relaxed via @CheckedTemplate(requireTypeSafeExpressions = false)

@mkouba how come those 2 cases are incorrect in Qute proper?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.