-
Notifications
You must be signed in to change notification settings - Fork 55
Feat: New plugin flag for skipping synthesized symbols #28
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
Feat: New plugin flag for skipping synthesized symbols #28
Conversation
* Added `--skip-synthesized-symbols` flag as plugin flag to override the symbol graph option `includeSynthesized` and set it to false * Array of plugin flags that overrides the defaults of the symbol graph generation * Conformance of `PluginFlag` to `Equatable` protocol * Unit tests for `--skip-synthesized-symbols` * Integration test to make sure that synthesized symbols are excluded from the .doccarchive when `--skip-synthesized-symbols` is passed
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.
Looks good - thank you! I left some initial feedback and I'll want to do some more testing as well before we land this.
...s/Fixtures/PackageWithConformanceSymbols/Sources/PackageWithConformanceSymbols/FooTest.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftDocCPluginUtilities/PluginFlags/SkipSynthesizedSymbolsFlag.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftDocCPluginUtilities/PluginFlags/SkipSynthesizedSymbolsFlag.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftDocCPluginUtilities/PluginFlags/SkipSynthesizedSymbolsFlag.swift
Outdated
Show resolved
Hide resolved
* Renamed flag to `--experimental-skip-synthesized-symbols` * Changed flag description * Integration test now conforms to `Hashable` protocol instead of `SwiftUI`
Conflicts: Plugins/SharedPackagePluginExtensions/PackageManager+getSymbolGraphsForDocC.swift Plugins/Swift-DocC Convert/SwiftDocCConvert.swift Plugins/Swift-DocC Preview/SwiftDocCPreview.swift
Hi @sofiaromorales would you mind taking a look at the merge conflicts here when you have a chance? I believe #34 introduced a few since it also touches some of this same code. It would be great to land this in the next release alongside extension support if we can. |
Conflicts: IntegrationTests/Package.swift Plugins/SharedPackagePluginExtensions/PackageManager+getSymbolGraphsForDocC.swift Sources/SwiftDocCPluginUtilities/ParsedArguments.swift Tests/SwiftDocCPluginUtilitiesTests/HelpInformationTests.swift Tests/SwiftDocCPluginUtilitiesTests/ParsedArgumentsTests.swift
@@ -201,7 +201,8 @@ private extension ParsedArguments { | |||
switch self { | |||
case .dumpSymbolGraph: | |||
return [ | |||
PluginFlag.extendedTypes | |||
PluginFlag.extendedTypes, | |||
PluginFlag.skipSynthesizedSymbols |
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.
I followed along the same strategy as in #34 since--experimental-skip-synthesized-symbol
is transformed to -skip-synthesized-members
flag of the swift package dump-symbol-graph
command
@swift-ci please test |
Tests/SwiftDocCPluginUtilitiesTests/PluginFlags/PluginFlagTests.swift
Outdated
Show resolved
Hide resolved
IntegrationTests/Tests/DocCConvertSynthesizedSymbolsTests.swift
Outdated
Show resolved
Hide resolved
CC: @theMomax I'm having trouble adding you as reviewer for some reason – but would appreciate your review on this as well. |
@ethan-kusters that's probably because I don't have commit access to Swift repositories and thus cannot formally approve a PR. As for the review, I think it looks good! One thing I didn't check, though, is whether the |
@swift-ci please test |
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.
Looks great. Thank you @sofiaromorales!
Bug/issue #, if applicable: #27
Summary
This pull request aims to support the generation of archives without synthesized symbols by passing a new plugin flag
--skip-synthesized-symbols
. This would reduce the size of the generated doccarchive.The plugin flag
--skip-synthesized-symbols
has been added to achieve this. It doesn't transform any of the passed arguments but overrides the default value ofsymbolGraphOptions.includeSynthesized
to false. Also, with the proposed implementation, more flags could be added to override other settings of the symbol graph options.Dependencies
N/A
Testing
For automated testing run the integration tests suite.
For manual testing:
Package.swift
set the right path forswift-docc-plugin
dependencyswift package generate-documentation
, andswift package generate-documentation --skip-synthesized-symbols
, for both compare the files generated atPackageWithConformanceSymbols.doccarchive/data/documentation/packagewithconformancesymbols/bar
PackageWithConformanceSymbols.zip
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/test
script and it succeeded