-
Notifications
You must be signed in to change notification settings - Fork 125
'simple' resolvers should somehow warn in mustachio if a parent node resolves for them #2667
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
Comments
simple
resolvers should somehow warn in mustachio if a parent node resolves for them
Marking as a P2 enhancement, but I am concerned that innocuous refactors that add a new visibleType requirement might cause the templates to resolve against the wrong thing. If this seems to happen a lot, elevate to P1. |
Oh my gosh I grok the issue now. What a bummer. I really don't like mustache's resolution rules sometimes (most of the time). Do you think the solution would be to always error in this case? That is, given the following context object stack:
then when rendering a
|
Yes, this, exactly. I think (assuming I understand mustache correctly...) the sticky wicket here for mustache-compliance will be if you do |
Somehow, it would be nice if a simple resolver would warn if it could have resolved something if it was part of the visibleTypes, but failed to do so. An example case that made me scratch my head for an hour or two was:
dartdoc/lib/templates/html/class.html
Line 19 in 0922660
I had erroneously thought my refactor in #2665 meant I could delete
DefinedElementType
from the visibleTypes list. When I did so and mustachio went to resolvelinkedName
here, it skipped over theDefinedElementType
insidepublicSuperChainReversed
and instead resolvedlinkedName
against the class. This meant that the class's name repeated in the superchain list.This was particularly troublesome to debug as unless someone was actually looking at the generated HTML there was no way to know, and everything looked correct in the debugger, the superchain list objects were correct, and so forth. In fact, if it wasn't for that I remembered I had removed that and noticed that the superchain was a collection of
DefinedElementType
s I might still be scratching my head.I am not sure how to make this warning happen without making simple resolvers much less simple...
The text was updated successfully, but these errors were encountered: