Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement .collectWithParameters() and .collectAllParameters() #637
Conversation
| protected void collectAllParameters(final Collection<Param> result) { | ||
| for (Param param : params) { | ||
| if (param instanceof VarParam) { | ||
| ((VarParam) param).fn.collectAllParameters(result); |
dontgitit
Jun 11, 2018
Contributor
is this collecting nested hbars, for example {{#if (anotherHelper) }}? or is this doing something else?
is this collecting nested hbars, for example {{#if (anotherHelper) }}? or is this doing something else?
andrewboni
Jun 20, 2018
Author
doesn't seem to currently; an input of {{capitalize (lower firstName)}} returns TagWithParams(capitalize, firstName, TagType.VAR)
If I include TagType.SUB_EXPRESSION, it does work. Let me change the implementation to template.collectWithParameters(TagType.values())
doesn't seem to currently; an input of {{capitalize (lower firstName)}} returns TagWithParams(capitalize, firstName, TagType.VAR)
If I include TagType.SUB_EXPRESSION, it does work. Let me change the implementation to template.collectWithParameters(TagType.values())
| @Test | ||
| public void collectWithParamsForEachTest() throws IOException { | ||
| List<TagWithParams> tagsWithParams = getTagsWithParameters("{{#each items as |item|}}{{i18n item}}{{/each}}"); | ||
| assertEquals(tagsWithParams.size(), 1); |
dontgitit
Jun 11, 2018
Contributor
hmm shouldn't there be two here? Tag("each", items) and Tag("i18n", item)?
hmm shouldn't there be two here? Tag("each", items) and Tag("i18n", item)?
|
Nice, this looks a lot more comprehensive than |
|
Guys, can you explain why do we need this? why existing implementation doesn't work? Also, I do a commit with a .jar file? Thanks |
|
Hey @jknack , we need this because we'd like to essentially verify some things before we render the In short: |
|
And no, we added the built |
|
can we add params to existing Tag class so we don't introduce a new TagWithParams class? Jar has been added to the pull with this commit. I can't merge this pull with the jar there |
|
Removed the jar |
|
@jknack not sure I follow; can you clarify? There doesn't seem to be an existing |
Codecov Report
@@ Coverage Diff @@
## master #637 +/- ##
=========================================
Coverage ? 87.21%
Complexity ? 863
=========================================
Files ? 79
Lines ? 3089
Branches ? 418
=========================================
Hits ? 2694
Misses ? 268
Partials ? 127Continue to review full report at Codecov.
|
|
@jknack gentle bump; just want to make sure we're on the same page before writing more tests |
|
I thought there was a
With these changes a call to Cool? |
|
@jknack Reasons: |
|
Good stuff, let's make Param a public class. |
|
hey @jknack , finally got around to making the changes you suggested! let me know how it looks... I marked |
Create a new field for internal, unresolved storage

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

This PR implements
.collectWithParameters()and.collectAllParameters()