# Is there a way to extract all type symbols of a current Xcode module?

**URL:** <https://forums.swift.org/t/is-there-a-way-to-extract-all-type-symbols-of-a-current-xcode-module/10572>\
**Category:** Using Swift\
**Created:** [March 4, 2018, 4:49pm UTC](https://forums.swift.org/t/is-there-a-way-to-extract-all-type-symbols-of-a-current-xcode-module/10572 "2018-03-04T16:49:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DevAndArtist](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/devandartist/32/287_2.png) [@DevAndArtist](https://forums.swift.org/u/DevAndArtist)\
**Post date:** [March 4, 2018, 4:49pm UTC](https://forums.swift.org/t/is-there-a-way-to-extract-all-type-symbols-of-a-current-xcode-module/10572/1 "2018-03-04T16:49:55Z")

</div>

Hi there, is there a way using any CLI to extract all type symbols of a particular module?

Xcode has a symbol navigator but it is worthless to me because it does not display the outer type for nested types. For instance the following two nested types will be displayed as `Data` in the symbols navigator.

```swift
struct Foo { struct Data {} }
struct Bar { struct Data {} }

```

* * *

I seek just for a list of types just like this:

```swift
Foo
Foo.Data
Bar
Bar.Data

```

---

<div class="post-metadata">

**Author:** ![Michael\_Ilseman](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/michael_ilseman/32/44640_2.png) [@Michael\_Ilseman](https://forums.swift.org/u/Michael_Ilseman)\
**Post date:** [March 5, 2018, 12:13am UTC](https://forums.swift.org/t/is-there-a-way-to-extract-all-type-symbols-of-a-current-xcode-module/10572/2 "2018-03-05T00:13:17Z")

</div>

I don't know how best to hook into your workflow, but the [swift-api-dump](https://github.com/apple/swift/blob/master/utils/swift-api-dump.py) script might give you an idea where to start. It uses Swift's AST printer (which is configurable depending on the task) to dump out the interface for a module. This is similar to Xcode's generated interface.

SourceKit also has access to this information, and you might be able to glean useful info from the [interface-generation tests](https://github.com/apple/swift/blob/master/test/SourceKit/InterfaceGen/gen_swift_type.swift), which also seem to have some sort of filtering.

Finally, if you've built swift locally, the repl there supports `:print_module Foo` and `:print_decl Bar`.

Perhaps some choice from the above 3 and/or a filtering mechanism would help.

CC @Xi_Ge for advice on using SourceKit.
