Skip to content

Commit 2792b92

Browse files
committed
Add symbol graph options to swift driver
1 parent 88cef93 commit 2792b92

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,8 @@ extension Driver {
907907
try commandLine.appendLast(.includeSpiSymbols, from: &parsedOptions)
908908
try commandLine.appendLast(.emitExtensionBlockSymbols, .omitExtensionBlockSymbols, from: &parsedOptions)
909909
try commandLine.appendLast(.symbolGraphMinimumAccessLevel, from: &parsedOptions)
910+
try commandLine.appendLast(.symbolGraphPrettyPrint, from: &parsedOptions)
911+
try commandLine.appendLast(.symbolGraphSkipSynthesizedMembers, from: &parsedOptions)
910912
}
911913

912914
mutating func addEntry(_ entries: inout [VirtualPath.Handle: [FileType: VirtualPath.Handle]], input: TypedVirtualPath?, output: TypedVirtualPath) throws {

Sources/SwiftOptions/Options.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,8 @@ extension Option {
889889
public static let switchCheckingInvocationThresholdEQ: Option = Option("-switch-checking-invocation-threshold=", .joined, attributes: [.helpHidden, .frontend, .noDriver])
890890
public static let symbolGraphAllowAvailabilityPlatforms: Option = Option("-symbol-graph-allow-availability-platforms", .separate, attributes: [.helpHidden, .frontend, .noInteractive, .supplementaryOutput], metaVar: "<platforms>", helpText: "Restrict availability metadata to the given platforms, e.g. 'macOS,Swift'")
891891
public static let symbolGraphBlockAvailabilityPlatforms: Option = Option("-symbol-graph-block-availability-platforms", .separate, attributes: [.helpHidden, .frontend, .noInteractive, .supplementaryOutput], metaVar: "<platforms>", helpText: "Remove the given platforms from symbol graph availability metadata, e.g. 'macOS,Swift'")
892+
public static let symbolGraphPrettyPrint: Option = Option("-symbol-graph-pretty-print", .flag, attributes: [.helpHidden, .noInteractive], helpText: "Pretty-print the output symbol graph JSON")
893+
public static let symbolGraphSkipSynthesizedMembers: Option = Option("-symbol-graph-skip-synthesized-members", .flag, attributes: [.helpHidden, .noInteractive], helpText: "Skip members inherited through classes or default implementations")
892894
public static let symbolGraphMinimumAccessLevel: Option = Option("-symbol-graph-minimum-access-level", .separate, attributes: [.helpHidden, .frontend, .noInteractive, .supplementaryOutput], metaVar: "<level>", helpText: "Include symbols with this access level or more when emitting a symbol graph")
893895
public static let sysroot: Option = Option("-sysroot", .separate, attributes: [.frontend, .synthesizeInterface, .argumentIsPath], metaVar: "<sysroot>", helpText: "Native Platform sysroot")
894896
public static let S: Option = Option("-S", .flag, alias: Option.emitAssembly, attributes: [.frontend, .noInteractive], group: .modes)
@@ -1860,6 +1862,8 @@ extension Option {
18601862
Option.symbolGraphAllowAvailabilityPlatforms,
18611863
Option.symbolGraphBlockAvailabilityPlatforms,
18621864
Option.symbolGraphMinimumAccessLevel,
1865+
Option.symbolGraphPrettyPrint,
1866+
Option.symbolGraphSkipSynthesizedMembers,
18631867
Option.sysroot,
18641868
Option.S,
18651869
Option.tabWidth,

0 commit comments

Comments
 (0)