Print prebuilt module declarations like produced by Xcode


When I write in Xcode code such as import Darwin and click Jump to Definition, I get an output like so:

import Darwin.AssertMacros
import Darwin.Availability
import Darwin.C
import Darwin.ConditionalMacros
import Darwin.MacTypes
import Darwin.Mach
import Darwin.POSIX
import Darwin.TargetConditionals
import Darwin.__wctype
import Darwin._locale
import Darwin._types
import Darwin._wctype
import Darwin.alloca
import Darwin.architecture
import Darwin.block
import Darwin.bsm
import Darwin.cdefs
import Darwin.device
import Darwin.getopt
import Darwin.hfs
import Darwin.libc
import Darwin.machine
import Darwin.malloc
import Darwin.ncurses
import Darwin.os
import Darwin.runetype
import Darwin.sys
import Darwin.sysexits
import Darwin.uuid
import Darwin
import Darwin.libkern
import SwiftOverlayShims

@available(swift, deprecated: 3.0, message: "Please use 'Double.ulpOfOne' or '.ulpOfOne'.")
public let DBL_EPSILON: Double


However, when I run echo ":print_module Darwin" | xcrun swift -deprecated-integrated-repl , I get a huge output of all submodules without listing them.

How can I get the output which is exactly produced by Xcode?


Terms of Service

Privacy Policy

Cookie Policy