You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
now this gets a bit confusing because If we remove an option from the markup (for example the recentlyUsedMaxItems), I expect the this.options.recentlyUsedMaxItems contains the default value from the parser but its missing completely in the dict:
There is a smartypants grouping functionality since long, which is confusing, I agree.
The grouping depends on the defined arguments via parser.addArgument, not the actual arguments used in the markup.
So, there was no change when removing the argument from the markup (good) but there was a change when removing the argument from the argument definition (bad for consistency).
I'd agree to see this even as a bug and this should be fixed - maybe with an option which always normalizes the argument list to camel case without any grouping.
But there is already something similar for new-style base class based patterns: If you define parser_group_options in the Patterns base class, no grouping, but also no camelCasing will take place. Instead you'd access the arguments exactly the way you had defined them. In this case this.options["recently-used-key"]. I'd use this instead of the automatic but unstable grouping.
Activity
thet commentedon Oct 3, 2024
There is a smartypants grouping functionality since long, which is confusing, I agree.
The grouping depends on the defined arguments via
parser.addArgument, not the actual arguments used in the markup.So, there was no change when removing the argument from the markup (good) but there was a change when removing the argument from the argument definition (bad for consistency).
I'd agree to see this even as a bug and this should be fixed - maybe with an option which always normalizes the argument list to camel case without any grouping.
But there is already something similar for new-style base class based patterns: If you define
parser_group_optionsin the Patterns base class, no grouping, but also no camelCasing will take place. Instead you'd access the arguments exactly the way you had defined them. In this casethis.options["recently-used-key"]. I'd use this instead of the automatic but unstable grouping.See: https://github.com/Patternslib/Patterns/blob/master/src/core/basepattern.js#L20
https://github.com/Patternslib/Patterns/blob/master/src/core/parser.js#L377