-
Notifications
You must be signed in to change notification settings - Fork 12
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
Improving output quality #58
Comments
Interesting... it's not on the roadmap as-such (at least not until this moment), but I can definitely see the need.
Yeah, that's a consequence of the metadata only including comments that are attached to something it is actually emitting - "loose" comments get ignored.
That's probably relatively easy to add data for since Dear Bindings already knows quite a lot of that information already.
I'm not entirely sure what you mean here - attached comments are logically related to the thing that they are attached to, but don't really have any context beyond that... unless I'm missing something there isn't really any grouping?
Yeah... that would be nice. Section detection would be beneficial elsewhere too, come to think of it (mainly when adding generated definitions - at the moment it's kinda ad-hoc in how it tries to place those). One thought that sprang to mind that I'm not sure on the viability of but seemed interesting - do you think there would be an value in providing a "template" that definitions could be slotted into? I'm thinking something along the lines of "take the Does that sound like something that would be at all useful? |
What's confusing to me here is that other comments in that section for forward declarations are in the metadata, e.g.
Has its comment but ImGuiIO does not. Maybe because the underlying structure isn't emitted?
cimgui.h does a lot of column alignment around types, variable names, values, and comments. I can ignore alignment for most things but the comments need to be aligned for their content, e.g. ImGuiPlatformIO_t comments for what calls which platform function. It's not exactly clear when/how to reset these "tab stops". Generally a single-line preceding comment preserves the alignment, and preceding comments with an extra line in groups seem to preserve them as well? Maybe there's a heuristic/algorithm here that works well? Or I could just not include the comments :)
I think I would just focus on things that are easy and useful to your primary goals. I had originally thought cimgui.h was built from the metadata, so was curious what I could do to improve my output. Then I looked at the scripts and saw that's not how things are structured. The comments for the issue are the biggest things that stand out, but it's already coming along pretty well! I still have a few more things to finish up before I'm comfortable releasing this (particularly around flags that I want to revisit now that bug has fixed). I've added both you and Omar to my prototype repo in case you want to take a look early. |
In a roundabout way, yes. Basically what's happening here is that ImGuiIO has both a forward-declaration (with a comment) and a real declaration (which doesn't have one). In that situation Dear Bindings prefers to emit the full version in the metadata, which results in the comment getting lost. However ImDrawListSharedData only has a forward declaration, so that is what gets emitted into the metadata (with the comment intact). It might make sense for the metadata to merge comments from forward-declarations and actual declarations, which would avoid this problem - I think that would work in most situations, but there might be some in which it causes problems...
That's what Dear Bindings does internally - And thanks for the invite to the prototype repo! I don't have much of a reference point but on a casual look the output seems nice and readable. |
I'm using cimgui.h as a reference and there are things it can do better than what I can do with the metadata. E.g.
None of this is critical, but if it's on your roadmap I could make use of it.
The text was updated successfully, but these errors were encountered: