Closed angelozerr closed 1 year ago
Here a demo with the current work of this PR:
I have improved completion with user tag parameters by using computing the optional state of each parameter.
Here a demo:
@FromMage I think this issue could interest you and should improve the use of renarde user tag.
If I have the following custom tag: ( I don't know if custom tags support the type declarations )
{@java.lang.String title}
<hr />
<h3>{title.toUpperCase}</h3>
{nested-content}
<hr />
then the snippet doesn't generate title
as a parameter to the custom tag
If you have this custom tag:
<hr />
<h3>{titularTitle}</h3>
{#set subTitle="some text"}
<small>{subTitle}</small>
{/set}
<p>
{nested-content}
</p>
<hr />
Then the snippet inserts subTitle
as a parameter. I think this case is hard to handle. Unless you disagree and think you could handle this case easily, I think we should do this in a different PR.
This feature works well! I don't have any suggestions so far but will take a look at the code once it is ready
Then the snippet inserts subTitle as a parameter. I think this case is hard to handle. Unless you disagree and think you could handle this case easily, I think we should do this in a different PR.
It should be fixed now.
If I have the following custom tag: ( I don't know if custom tags support the type declarations )
{@java.lang.String title}
<hr />
<h3>{title.toUpperCase}</h3>
{nested-content}
<hr />
then the snippet doesn't generate title as a parameter to the custom tag
Are you sure? I have add a test with your sample and it is working.
But your sample give me a new idea. For the moment I consider that all parameter are string (when parameter value is generated, I generate double quote). I think it should be really nice to use this parameter declaration type to know if it is a string or not to avoid generating double quote if it is not a string. We could do that in a an another PR.
Are you sure? I have add a test with your sample and it is working.
I tried it again with the latest push, and it's still not working. It provides completion for the parameter when I open it like this:
{#user |}
{/user}
but the snippet still doesn't add the title
when I first open it, despite the fact that it's required.
I tried it again with the latest push, and it's still not working. It provides completion for the parameter when I open it like this:
Oh sorry I though it was a problem to collect the parameter but not for required state. Fixed with test.
Great!
Improve User tag snippet completion
Fixes #784
Signed-off-by: azerr azerr@redhat.com