-
Notifications
You must be signed in to change notification settings - Fork 22
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
DynamicListOf Fixes #157
DynamicListOf Fixes #157
Conversation
As part of this pull request, I'm looking to solve a myriad of issues around Attrs and List parsing. We would like create a tree with nodes for each option, and child nodes where an option is an attribute or list. The main problem is that For this reason we have certain attribute paths missing from one of our test cases - they're simply not currently retrieved nix-gui/nixui/tests/test_parser.py Lines 77 to 107 in 02231f5
Therefore when we must use python (for now) to parse the branch of the syntax tree under which
our infrastructure will only retrieve the syntax tree node for Changing lib.nix to recursively get all option (and submodule attribute members) pathsI attempted to make lib.nix recurse through all definitions until either the child definition isn't within the same module OR there is an error. However Changing parser.py to recursively get all attribute paths and expression stringsWe already have the infrastructure to recursively get all attribute paths and expression strings given a starting point - the position in the file of the "base level" attribute path. For example, given the location of However if For this approach to work we need to find every instance in which an option definition occurs. Lazy approachOne way to make this work is collect every definition ( E.g. If we have a This method introduces many edge cases, for example if a variable named Less lazy, less prone to failure, but definitely incomplete approach:Collect all definition nodes in the syntax tree as we currently do using This still of course leaves us with edge cases, for example
In this case, SummaryNone of these solutions are very good, I need to do more thinking. |
@adrianparvino any thoughts on whether recursing into submodule attributes is possible within I wrote this but
Unfortunately
I'd prefer doing this in Another question, what risks do you see in getting declarations via |
…eria for this PR)
DynamicListOf
(fixes Complete Implementation of ListOf #30)[ ] implement calculation of value for list - check the descendants and produceexpression_string
(fixes Implement CHECK DESCENDANTS #124)StaticListOf
being selected instead ofDynamicListOf
for nav listDynamicListOf
andDynamicAttrsOf
are always the navlist for foranything
types and descendents. (fixed in Dont show dynamic AttrsOf or ListOf in fields group #169)