Swiftpack.co -  apple/indexstore-db as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
Index database library for use with sourcekit-lsp
.package(url: "https://github.com/apple/indexstore-db.git", from: "swift-DEVELOPMENT-SNAPSHOT-2021-06-12-a")


IndexStoreDB is a source code indexing library. It provides a composable and efficient query API for looking up source code symbols, symbol occurrences, and relations. IndexStoreDB uses the libIndexStore library, which lives in llvm-project, for reading raw index data. Raw index data can be produced by compilers such as Clang and Swift using the -index-store-path option. IndexStoreDB enables efficiently querying this data by maintaining acceleration tables in a key-value database built with LMDB.

IndexStoreDB's data model is derived from libIndexStore. For more information about libIndexStore, and producing raw indexing data, see the Indexing While Building whitepaper.

Building IndexStoreDB

IndexStoreDB is built using the Swift Package Manager.

For a standard debug build and test:

$ swift build
$ swift test

Building on Linux

The C++ code in the index requires libdispatch, but unlike Swift code, it cannot find it automatically on Linux. You can work around this by adding a search path manually.

$ swift build -Xcxx -I<path_to_swift_toolchain>/usr/lib/swift -Xcxx -I<path_to_swift_toolchain>/usr/lib/swift/Block

Some Example Users

Pecker: a tool to detect unused code based on SwiftSyntax and IndexStoreDB.


For more information about developing IndexStoreDB, see Development.


Stars: 186
Last commit: 4 days ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API