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

Disable missing template validation via the @Locate annotation. #912

Open
fbricon opened this issue Jul 23, 2023 · 0 comments
Open

Disable missing template validation via the @Locate annotation. #912

fbricon opened this issue Jul 23, 2023 · 0 comments
Labels
enhancement New feature or request qute

Comments

@fbricon
Copy link
Collaborator

fbricon commented Jul 23, 2023

According to https://quarkus.io/guides/qute-reference#template-locator-registration, if a template locator is registered for @locate names or patterns, validation should be disabled at build time.

The easiest way to register template locators is to make them CDI beans. As the custom locator is not available during the build time when a template validation is done, you need to disable the validation via the @Locate annotation.

So given:

@Locate("bar.html") 
@Locate("foo.*") 
public class CustomLocator implements TemplateLocator {

    @Override
    public Optional<TemplateLocation> locate(String templateId) {
        return Optional.empty();
    }

}

Then there should be no error, nor "create template" codelens, in a resource referencing a Template bar:

Screenshot 2023-07-23 at 13 54 35
@fbricon fbricon added enhancement New feature or request qute labels Jul 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request qute
Projects
None yet
Development

No branches or pull requests

1 participant