-
Notifications
You must be signed in to change notification settings - Fork 42
Split Symbol.swift to reduce complexity of the file #8
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
Conversation
Thanks for taking this initiative, @Kyle-Ye! I agree, the Regarding the collision of |
Got it. Maybe we could combine them to be the following: For node struct: parent/node/node.swift
Thus, we got:
What's your opinion about it? @franklinsch |
Makes sense to me! I'll defer to @QuietMisdreavus to do a review as well. |
Thanks so much for this! I like the organization you and Franklin have agreed upon; i think it makes working with the Symbol-related types much cleaner. Consider this my thumbs-up to keep going. |
@swift-ci Please test |
Complete the full PR. It is a little big PR to review. But actually only involves moving files around. Could you please help review it in your spare time? @franklinsch @QuietMisdreavus ❤️ |
I tried many ways, but I can't mark Relationship.swift as "rename" instead of "delete" and "add". Whether I use "git mv", first modify then mv nor first mv then modify can not achieve it. Maybe the only way is to do 2 separate commits😂. (After doing 2 separate commits to achieve this, if I do squash commits, it will change to delete and add again😵💫) |
584b5cb
to
c0836b6
Compare
|
The changes look good. Are you using an automatic formatter/linter? I noticed that the |
Yes, I use an automatic formatter to use the public extension style which is my favor. Since it was not the way swift-docc related repos' style, maybe I should change them back into the original style
|
That makes sense. I think we should stick to the existing style, to remove some churn. (As much as we can with a change like this! 😅) |
Done👌 |
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.
This looks good, thanks so much! Can you rebase and run tests before merging?
Separate into 2 commits because git can't mark it as rename since the change is too big
@swift-ci Please test |
Done. I think we should defer to @franklinsch 's approval before merging. |
Franklin's on vacation until January; are you comfortable keeping this open until then, or would you like me to pull in some other reviewers so we can land it sooner? I don't want to make you rebase this over and over if anything else lands before then, since it's a larger change that i feel is worthwhile to land. |
Maybe we could invite some other reviewers? +1 for this |
Hello @ethan-kusters , would you please help review this MR? Thanks |
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.
This looks great to me! Thank you @Kyle-Ye. I think it makes the codebase much more approachable.
I also generated a DocC archive before and after this change and then diffed them to confirm there's no change in public API here. Looks all good. 👍🏻
I think we should consider cherry-picking this change onto the |
Sorry for reviving the discussion long after the PR is merged. I find the prevalent use of "ParentType+" prefixes in file names makes the repository a little difficult to navigate. For example, in this screenshot of part of the repository structure in Xcode's sidebar: Because of the shared prefixes, it becomes difficult to tell apart the files when their names are long (and the prefixes contribute to the file name lengths). This is can become much worse with types introduced in #12, which can lead to file names like I'd like to open a PR that amends the naming convention to the following, but would like to discuss it here first:
|
Yes, both I and @franklinsch prefer the first approach I propose in the first post. But this way we'll get more collision like
If we use the second approach (which is merged now), the "collision" only occurs once |
The file name will not be that long, it should at most be |
Yes, you're correct. I misinterpreted it. Although, I think my main point stands, that shared prefixes make it more difficult to discern files. |
I agree. So maybe we should only add the prefix when needed? |
The Symbol.swift currently has 1400 lines.
This PR is intended to split the Symbol.swift file into a file system hierarchy.
So that the Symbol.swift only have SymbolGraph.Symbol definition and also makes it easier for writing test case.
Discussion
Or
Currently there are
SymbolGraph.Symbol.DeclarationFragments.Fragment.Kind
andSymbolGraph.Symbol.Kind
.Although they are not in the same folder, they are in the same module. Which is not allowed by Swift
Status
WIPAfter the above 2 discussion is solved, I'll complete the full PR.