-
Notifications
You must be signed in to change notification settings - Fork 21
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
Options listed after and outside a condition are not showing #67
Comments
can you do a pr for this one too please? :) |
According to the docs (https://yarnspinner.dev/docs/writing/controlling/#options):
I have written some tests that helped me get further in determining exactly what is going wrong. Currently, if the line after the first option is not another option, then none of the remaining lines are returned. It's as if it were treating the first option as a shortcut. All available options, excluding those within a shortcut, should be collected and returned only when the end of the node is reached. |
My fork now has the runner handling options correctly. The problem was that options within a conditional (of the same nest level of a node) were being yielded instead of accumulated for the end of that node and nest level. "Nest level" refers to nested or hierarchical lines indented beneath a shortcut. My new tests for this are passing. I don't know the protocol for submitting multiple PRs with cumulative changes, so I will have to learn that before I submit this PR. |
I've submitted PR #69 that resolves this issue. |
According to the documentation found here https://yarnspinner.dev/docs/tutorial#options, an option outside of and after any conditions should be included in the available options for a node. The current bondage.js behavior is that as soon as a conditional option is parsed, other non-conditional options from the node are not added to the available options.
That isn't to say that there are not other issues related to conditions and/or options that may be at the root of the problem, but this describes the behavior I am seeing for my case.
I believe that this is an issue with the runner and so I will add a runner test to my fork that isolates the problem.
The text was updated successfully, but these errors were encountered: