justarandomgeek / vscode-factoriomod-debug

Factorio Mod Tool Kit
Other
97 stars 21 forks source link

Sort table key listings in debug views #129

Open infogulch opened 1 week ago

infogulch commented 1 week ago

When browsing large lists in the Variables, Watch, or variable hover views while debugging, it is frustrating to search for keys in big tables like data.raw and data.raw["items"]. It would be much easier if keys for these tables were sorted before they are displayed.

This could have the downside of sorting "struct" keys for prototypes (because there is no actual difference between "structs" and "dicts" in lua, everything is a table), which is obviously undesirable. A potential workaround is to sort a table's keys for display only if it doesn't have a "type" key, since all prototypes have a type and no big lists of prototypes have an element named "type".