[Bug]: Namespace
seemingly has no way to get interspersed type members of different kinds in source code order
#5446
Labels
Describe the bug
For example, if I have:
Then there's seemingly no way to get an array of
Type
objects from theNamespace
that gives me the scalars and models in the right interspersed order. I can get the scalars in order (vianamespace.scalars
) and the models in order (vianamespace.models
), but I have no way to know how the scalars and models were placed relative to each other.The same applies to all other kinds (e.g. unions, nested namespaces, decorator declarations, etc.). Ideally I could do
namespace.types
and get the list of top-level types so I can emit generated code that reflects the order of types in the TypeSpec file.Maybe there is a way and I haven't found it. If that's the case, then maybe it should be more obvious.
Reproduction
See above.
Checklist
The text was updated successfully, but these errors were encountered: