Summary
Public static methods defined in a @TemplateExtension class are reported as "unused" by IntelliJ's code inspection, even though they are actively called from Qute templates. These methods render correctly at runtime — the warning is a false positive.
Environment
- Quarkus version: 3.32.2
- Qute version: bundled with Quarkus 3.x
- IDE: IntelliJ IDEA with Quarkus plugin
Steps to Reproduce
A repository is available to reproduce the error : link
- Create a @TemplateExtension class with an extension method, see example
@TemplateExtension
public class GlobalExtension {
public static String ellipsis(String value, int maxLength) {
if (value == null || value.length() <= maxLength) {
return value;
}
return value.substring(0, maxLength) + "…";
}
}
- Call it from a Qute template:
<p>{description.ellipsis(20)}</p>
- Open GlobalExtension.java in IntelliJ and observe the inspection warning on ellipsis().
Expected Behavior
No "unused" warning should be raised. The Quarkus plugin should recognize that public static methods in @TemplateExtension classes are callable as virtual methods on their first parameter type in Qute templates.
Summary
Public static methods defined in a @TemplateExtension class are reported as "unused" by IntelliJ's code inspection, even though they are actively called from Qute templates. These methods render correctly at runtime — the warning is a false positive.
Environment
Steps to Reproduce
A repository is available to reproduce the error : link
Expected Behavior
No "unused" warning should be raised. The Quarkus plugin should recognize that public static methods in @TemplateExtension classes are callable as virtual methods on their first parameter type in Qute templates.