redhat-developer / redhat-developer/quarkus-ls

Disable missing template validation via the @Locate annotation.

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

Nobody has claimed this yet.

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

Description

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

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 how @Locate template locators are handled during build-time template validation and how missing-template errors and the "create template" codelens are produced. Use the provided bar.html and foo.* example to verify that a resource referencing bar.html produces neither an error nor the codelens.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.