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

Data model template matcher support #1021

Merged

Conversation

angelozerr
Copy link
Contributor

This PR provides the capability to inject data model parameter with pattern (instead of just template uri). This mechanims is used by roq extension to add site and page on each Qute template which are a roq application.

To test this PR,

image

  • create a Qute expression and open completion, you should see site and page

image

This auto injection of data parameter is generic. Roq extension defines a template data model like this:

[Trace - 11:48:52 PM] Sending response 'qute/template/projectDataModel - (17)'. Processing request took 94877ms
Result: {
    "templates": [
        {
            "templateMatcher": {
                "includes": [
                    "**/**"
                ]
            },
            "parameters": [
                {
                    "key": "site",
                    "sourceType": "io.quarkiverse.roq.frontmatter.runtime.model.Site"
                },
                {
                    "key": "page",
                    "sourceType": "io.quarkiverse.roq.frontmatter.runtime.model.Page"
                }
            ]
        }

includes is set to / which means that any Qute template have siteand page parameters, but we can use a glob pattern to define some specific folders.

@angelozerr angelozerr added the enhancement New feature or request label Nov 5, 2024
@angelozerr angelozerr added this to the 0.21.0 milestone Nov 5, 2024
@angelozerr angelozerr self-assigned this Nov 5, 2024
@angelozerr angelozerr force-pushed the auto_inject_datamodel branch 5 times, most recently from fade04b to 52b6008 Compare November 6, 2024 09:40
Signed-off-by: azerr <azerr@redhat.com>
@angelozerr angelozerr merged commit a02c519 into redhat-developer:master Nov 6, 2024
1 check passed
@angelozerr angelozerr added the qute label Nov 6, 2024
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
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant