TypeScript
To index TypeScript we use SourceGraph's SCIP indexer for TypeScript. SCIP is a format for tools to share information about code.
Prerequisitesβ
You will need:
- scip-typescript, installable with
npm install -g @sourcegraph/scip-typescript - scip-to-glean, the SCIP-to-Glean converter
- A Node.js runtime
Run the indexerβ
Ensure that you have built and installed Glean and
the glean executable is on your PATH.
Index your TypeScript repository with:
glean index typescript DIR --db-root DB --db NAME/INSTANCE
where
DBis the directory where you want to store your Glean DBsDIRis the root directory containing the TypeScript projectNAME/INSTANCEis the name of the repository to create
To index very large TypeScript repositories, it may be necessary to use more heap memory in Node.js. Setting export NODE_OPTIONS="--max-old-space-size=8192" in the environment may help.
In the shellβ
TypeScript source can also be indexed directly from the Glean shell:
:index typescript DIR
The shell will pick a DB name and hash for you based on DIR.
Schemaβ
The schema is in glean/schema/source/scip.angle