Store the name of the extended module in the SymbolGraph.#86057
Open
dylansturg wants to merge 1 commit into
Open
Store the name of the extended module in the SymbolGraph.#86057dylansturg wants to merge 1 commit into
dylansturg wants to merge 1 commit into
Conversation
…sentation. The extended module's name is typically extracted from the filename of the symbolgraph. This approach is problematic for modules with long names, because the filename "ModuleA@ModuleB" can exceed the limits for filepath segments on common file systems, e.g. there's a limit of 255 on macOS. This root problem has an opt-in workaround now, with the changes in swiftlang#83782 to support a new option "symbol-graph-shorten-output-names". But that approach alone leaves swift-docc-symbolkit in a tough spot to handle the alternative naming convention. It would be nice to also support the symbolgraph files of modules with long names in swift-docc-symbolkit. That library extracts the name of the symbolgraph's module to use for merging declarations in the same module. In some modes, extensions are merged with declarations from the extended module instead of the declaring module. When generating symbolgraphs with `-symbol-graph-shorten-output-names`, swift-docc-symbolkit cannot determine the extended module name. There appears to be 2 options to solve this: (A) propagate the rename map file throughout symbolkit and its callers to lookup the extended module's name as needed, or (B) store the extended module in the symbolgraph JSON representation. This change enables option B. This option reduces the complexity of changes in swift-docc-symbolkit, while allowing simple backwards compatibility by defaulting to the current "Module@Extended" naming scheme.
This was referenced Dec 15, 2025
Contributor
Author
|
I'm not sure how to handle the multi-PR aspect here, across the different repos. I believe that every individual PR is perfectly fine in isolation, and would be fully backwards and forwards compatible. Please advise if I should do something specific here. It probably helps to look at the other 2 PRs to get a sense of the overall approach. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The extended module's name is typically extracted from the filename of the symbolgraph. This approach is problematic for modules with long names, because the filename "ModuleA@ModuleB" can exceed the limits for filepath segments on common file systems, e.g. there's a limit of 255 on macOS. This root problem has an opt-in workaround now, with the changes in #83782 to support a new option "symbol-graph-shorten-output-names". But that approach alone leaves swift-docc-symbolkit in a tough spot to handle the alternative naming convention.
It would be nice to also support the symbolgraph files of modules with long names in swift-docc-symbolkit. That library extracts the name of the symbolgraph's module to use for merging declarations in the same module. In some modes, extensions are merged with declarations from the extended module instead of the declaring module. When generating symbolgraphs with
-symbol-graph-shorten-output-names, swift-docc-symbolkit cannot determine the extended module name. There appears to be 2 options to solve this: (A) propagate the rename map file throughout symbolkit and its callers to lookup the extended module's name as needed, or (B) store the extended module in the symbolgraph JSON representation.This change enables option B. This option reduces the complexity of changes in swift-docc-symbolkit, while allowing simple backwards compatibility by defaulting to the current "Module@Extended" naming scheme.
swiftlang/swift-docc#1399
Dependencies