Skip to content
Converts DXR's clang plugin output to LSIF format
C++ TypeScript Shell Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
.vscode
clang
examples
src
.editorconfig
.gitignore
.prettierignore
.prettierrc
README.md
build
buildkite.yml
ci
dev
generate-csv
jest.config.js
package.json
prettier.config.js
run
tsconfig.json
tslint.json
yarn.lock

README.md

C/C++ LSIF indexer

This project is at the proof-of-concept stage.

Language Server Index Format

The purpose of the Language Server Index Format (LSIF) is to define a standard format for language servers or other programming tools to dump their knowledge about a workspace. This dump can later be used to answer language server LSP requests for the same workspace without running the language server itself. Since much of the information would be invalidated by a change to the workspace, the dumped information typically excludes requests used when mutating a document. So, for example, the result of a code complete request is typically not part of such a dump.

A first draft specification can be found here.

Quickstart

Build the instrumented compiler and the LSIF conversion tool:

./build

Compile a C/C++ project with the instrumented compiler to generate intermediate CSV output:

env \
  CLEAN=true \
  ABSROOTDIR=$PWD/examples/cross-app/root \
  ABSOUTDIR=$PWD/examples/cross-app/output \
  ./generate-csv "\$CXX -c *.cpp"

Convert those CSV files into LSIF:

node \
  ./out/main.js \
  --csvFileGlob="examples/cross-app/output/*.csv" \
  --root=examples/cross-app/root \
  --out app.lsif

Upload the LSIF data to Sourcegraph:

env \
  SRC_ENDPOINT=http://localhost:3080 \
  REPOSITORY=127.0.0.1-3434/repos/cross-lib/root \
  COMMIT=$libcommit \
  bash ~/github.com/sourcegraph/sourcegraph/lsif/upload.sh app.lsif
You can’t perform that action at this time.