redhat-developer / redhat-developer/quarkus-ls

[qute] @CheckedTemplate(requireTypeSafeExpressions = false) is ignored

Open
#434 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

With a checked template defined as

    @CheckedTemplate(requireTypeSafeExpressions = false)
    public static class Templates {
        public static native TemplateInstance item(Item item); 
    }

The validation still complains about {toto} can't be resolved as a variable.

Screenshot 2021-11-24 at 10 35 21

I'm not too sure how to handle requireTypeSafeExpressions here since it's a warning already, that's still valuable information.

If we make the diagnostic severity configurable, i.e. severity.UndefinedVariable=error, would we have to automatically downgrade it to warning if we detect requireTypeSafeExpressions = false?

@maxandersen @mkouba you got an opinion?

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.

Research direction

Start by tracing checked-template validation for @CheckedTemplate and the UndefinedVariable diagnostic. Determine how requireTypeSafeExpressions = false should affect that diagnostic, then verify that the resulting severity or behavior matches the intended configuration without suppressing valuable information.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.