-
Notifications
You must be signed in to change notification settings - Fork 420
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
Improve documentation comments of some commonly used types #2922
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the documentation @Jeehut 🙏🏽 You added the documentation to generated files. Could you add the documentation in the corresponding places in CodeGeneration and run code generation to make sure the committed files match what would be generated?
Co-authored-by: Alex Hoppen <[email protected]>
@ahoppen I've really done my best to accommodate all your comments and address them all. But please note that, like I've mentioned in my initial comment on this PR, I'm having a hard time finding the right places in the CodeGeneration package to place the documentation comments. I have now done my best to find the right places and add the documentation code to the type, which I could find some of, but it was a very time-consuming task. But there were a few reuses of some comments in multiples places (such as But most importantly, pretty much ALL of my provided documentation comments for any initializers I couldn't find a place to add them in the CodeGeneration package. It doesn't seem to be trivial to add documentation comments, which is a bummer. If you checkout my branch and run If you can guide me how to add documentation comments for those, e.g. by giving an example for one of those, I might be able to get more comments into the CodeGeneration package. For now, this is all I could do. |
Thanks for your effort @Jeehut. The initializers are generated here. Lines 46 to 62 in eae92fe
I didn’t check all the comments you wrote on initializers but I think we should be able to re-use some of the existing infrastructure to generate them:
|
This resolves #2906 for an initial set of types. To keep the PR relatively small, I have focused on improving docs of those types that I have personally needed & used for my first macro (which I haven't released yet, as it's not finished).
@ahoppen I didn't quite understand if your "I would" in this comment literally meant that it's something you would do after my PR is merged, of if it's something you suggested me to do.
In any case, I found it very confusing that all the types I searched for were inside a
generated
folder and the file names were suffixed by alphabetic characters likeQRS
inSyntaxNodesQRS.swift
. I have a feeling that I added the documentation comments to the wrong place. But I couldn't find any mentions ofStringSegmentSyntax
, for example inside theCodeGeneration
folder. In that particular case, I did find the text of the comment "A literal segment inside a string segment." inside theExprNodes.swift
file, but then again where to add the documentation comments for the initializers, which are very important when discovering APIs via code completion in Xcode? 🤔I think I need some guidance here to adjust this PR properly. Thank you in advance for your patience!