Announcing scip-clang: a new indexer for C and C++ based on Clang

Hey folks! I wanted to share a project that I’ve been working on for the past few months: scip-clang. Copying over some context from my comment on Reddit:

The TLDR […] is that it lets you access IDE-like code navigation for C++ projects in the browser. If you’re an open source maintainer, you can index your project on a regular basis (e.g. for every commit, or nightly) in CI, and access precise navigation on after uploading the index. This is helpful when collaborating (e.g. sharing links to code when discussing issues) and on-boarding new contributors.

The closest public code search tool that’s similar to this is Chromium’s code search.

The announcement blog post has more details, including a demo on the LLVM codebase itself.

Answering some potential questions up front:

Q: Why not reuse clangd’s indexing code / IndexStoreDB / Kythe / Glean / <some other solution>?
A: See this GitHub comment.

Q: Thoughts on upstreaming the indexer (or parts of it) into clang(d)?
A: Our use of third-party dependencies (e.g. libraries for IPC, JSON, logging), need to be able to move quickly (including cutting releases), separate CI infrastructure and exclusive use of Bazel are all at odds with how things are done in the LLVM monorepo. Having the key code be split across the LLVM monorepo and a separate repo downstream would likely increase maintenance burden; we’re already at capacity on that front with only me working on the indexer.

Meta: I wasn’t sure I’ve categorized this post correctly under ‘Clang Frontend’, happy to change that if someone has a better suggestion.