Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.
/ lsif-clang Public archive
forked from sourcegraph/lsif-clang

Language Server Indexing Format (LSIF) generator for C, C++ and Objective C.

Notifications You must be signed in to change notification settings

pixie-io/lsif-clang

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lsif-clang indexer Status: Development

GIF displaying usage on the linux kernel.

This project is a fork of clangd with patches to add support for outputting LSIF indexes. Specifically, a fork of the clang-tools-extra/clangd subdirectory of the llvm-project repo.

This project has only been tested extensively on C++ projects and C projects, but Objective C projects should both be supported as well following the same instructions.

Alternatives for C++ Projects

If you can't get lsif-clang working with your project, first file an issue! We want this to work everywhere. But the C++ ecosystem is fragmented, and it's possible that your project simply won't play nice with the clang toolchain. lsif-cpp is also available, which acts as a plugin for arbitrary C++ compilers and might therefore be compatible. Unfortunately, it has several major defects compared to lsif-clang (it is much slower and does not provide hovers), and is not the recommended option.

Usage

Follow the installation instructions to get the tool set up, then the compilation database instructions to generate a compilation database. Then run

lsif-clang compile_commands.json

If you get missing header warnings (common on MacOS), you can try

lsif-clang --extra-arg="-resource-dir=$(clang -print-resource-dir)" compile_commands.json

If you are still missing headers, there's likely an error in the way the compilation database was set up, or some generated code that's necessary for c++ compilation hasn't been output yet.

See the examples of producing LSIF indexes for a variety of OSS repositories to help troubleshoot.

Testing the output

You can use the lsif-validate tool for basic sanity checking, or upload the index to a Sourcegraph instance to see the hovers, definitions, and references in action.

About

Language Server Indexing Format (LSIF) generator for C, C++ and Objective C.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 97.5%
  • TypeScript 1.2%
  • Other 1.3%