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

sebastienros/fluid#578 Implement tag names #579

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

knightmeister
Copy link

@knightmeister knightmeister commented Jun 14, 2023

I've implemented support to retrieve tag names from the statement list as discussed in #578.

ExtensibilityTests have been amended; let me know if I've missed anything obvious.

In terms of design, I opted to add another interface IHasTagName for a few reasons:

  1. It means that the various statement types (EmptyBlockStatement, EmptyTagStatement, ParserBlockStatement, ParserTagStatement) now have a shared interface type
  2. The above types were all internal and this hasn't changed visibility
  3. The root class Statement is used throughout the codebase and wasn't an appropriate change point.

The change means that I can do what I needed to do quite simply, basically

template.Statements.Where(x => x.GetType() == typeof(IHasTagName)).First(y => y.TagName == "what i'm looking for")

I've also added an interface IHasValue for retrieving the interface value from a statement. This Value will hold an individual value passed in, or in the case of using ArgumentsList you'll get an List of FilterArgument.

If you need any amendments let me know.

@knightmeister
Copy link
Author

@sebastienros any feedback on this PR or plans to incorporate it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant