Git Product home page Git Product logo

indexstore-db's Introduction

IndexStoreDB

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 swiftlang/llvm-project, for reading raw index data. Raw index data can be produced by compilers such as Apple 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.

Contributing to Swift

Contributions to indexstore-db are welcomed and encouraged! Please see the Contributing to Swift guide.

Before submitting the pull request, please make sure you have tested your changes and that they follow the Swift project guidelines for contributing code.

To be a truly great community, Swift.org needs to welcome developers from all walks of life, with different backgrounds, and with a wide range of experience. A diverse and friendly community will have more great ideas, more unique perspectives, and produce more great code. We will work diligently to make the Swift community welcoming to everyone.

To give clarity of what is expected of our members, Swift has adopted the code of conduct defined by the Contributor Covenant. This document is used across many open source communities, and we think it articulates our values well. For more, see the Code of Conduct.

Development

For more information about developing IndexStoreDB, see Development.

indexstore-db's People

Contributors

ahoppen avatar akyrtzi avatar azoy avatar benlangmuir avatar bnbarham avatar catfish-man avatar compnerd avatar danboduan avatar davidgoldman avatar emixb avatar finagolfin avatar futurejones avatar gmittert avatar hamishknight avatar jakepetroules avatar kevints avatar krzyzanowskim avatar literalpie avatar maxdesiatov avatar mrcull avatar parispittman avatar rofle100lvl avatar seanrolszewski avatar shahmishal avatar tachoknight avatar tayloraswift avatar varungandhi-src avatar woshiccm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

indexstore-db's Issues

build-script-helper.py needs to support Python3 to support Ubuntu 22.04

/home/build-user/indexstore-db/Utilities/build-script-helper.py build --package-path /home/build-user/indexstore-db --build-path /home/build-user/build/buildbot_linux/indexstoredb-linux-x86_64 --configuration release --toolchain /home/build-user/swift-nightly-install/usr --ninja-bin /home/build-user/build/buildbot_linux/ninja-build/ninja
/usr/bin/env: ‘python’: No such file or directory

https://ci.swift.org/job/oss-swift-package-ubuntu-22_04/84/console

Import errors when running `swift build`

I'm following the directions in the README, but when I get to swift build I see a number of import errors:

╰─ swift build                         
Building for debugging...
/Users/stevenhepting/workspace/indexstore-db/lib/Support/PatternMatching.cpp:13:10: fatal error: 'IndexStoreDB/Support/PatternMatching.h' file not found
#include "IndexStoreDB/Support/PatternMatching.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
/Users/stevenhepting/workspace/indexstore-db/lib/LLVMSupport/Support/circular_raw_ostream.cpp:13:10: fatal error: 'llvm/Support/circular_raw_ostream.h' file not found
#include "llvm/Support/circular_raw_ostream.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/stevenhepting/workspace/indexstore-db/lib/LLVMSupport/Support/raw_ostream.cpp:13:10: fatal error: 'llvm/Support/raw_ostream.h' file not found
#include "llvm/Support/raw_ostream.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/stevenhepting/workspace/indexstore-db/lib/Support/Concurrency-Mac.cpp:13:10: fatal error: 'IndexStoreDB/Support/Concurrency.h' file not found
#include "IndexStoreDB/Support/Concurrency.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/stevenhepting/workspace/indexstore-db/lib/Support/Logging.cpp:14:10: fatal error: 'IndexStoreDB/Support/Logging.h' file not found
#include "IndexStoreDB/Support/Logging.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/stevenhepting/workspace/indexstore-db/lib/Support/FilePathWatcher.cpp:13:10: fatal error: 'IndexStoreDB/Support/FilePathWatcher.h' file not found
#include "IndexStoreDB/Support/FilePathWatcher.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/stevenhepting/workspace/indexstore-db/lib/Support/Path.cpp:13:10: fatal error: 'IndexStoreDB/Support/Path.h' file not found
#include "IndexStoreDB/Support/Path.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/stevenhepting/workspace/indexstore-db/lib/LLVMSupport/Support/YAMLTraits.cpp:9:10: fatal error: 'llvm/Support/YAMLTraits.h' file not found
#include "llvm/Support/YAMLTraits.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
[1/87] Compiling YAMLTraits.cpp

Is there perhaps another way to build this project using cmake?

throw an error if `storePath` is incorrect

on linux, at swift-5.10-RELEASE at least, it seems IndexStoreDB.init(storePath:databasePath:library:delegate:useExplicitOutputUnits:waitUntilDoneInitializing:readonly:enableOutOfDateFileWatching:listenToUnitEvents:prefixMappings:) will fail silently if the storePath is incorrect.

could the initializer check if an index store actually exists at that path?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.