Hack
The Hack indexer is built into the Hack typechecker. Stable and nightly binaries of the Hack indexer are available.
Run the indexerβ
Ensure that you have built and installed Glean and
the glean executable is on your PATH.
Index your Hack repository with:
glean index hack DIR --db-root DB --db NAME/INSTANCE
where
DBis the directory where you want to store your Glean DBsDIRis the root directory containing the Hack project (with.hhconfig)NAME/INSTANCEis the name of the repository to create
In the shellβ
Hack source can also be indexed directly from the Glean shell:
:index hack DIR
Run the indexer (manually)β
hh_server DIR --write-symbol-info JSON \
--config symbol_write_include_hhi=false \
--config symbolindex_search_provider=NoIndex \
--config lazy_decl=true \
--config lazy_parse=true \
--config lazy_init2=true \
where
DIRis the root directory containing the.phpfilesJSONis the directory in which to write the output.jsonfiles- We need several config flags to instantiate hh_server for indexing
The generated files can be ingested into a Glean database using glean create.
Derived predicatesβ
Several predicates should be derived after indexing. For each stored predicate in the schema you should glean derive the predicate.
Schemaβ
The schema is in glean/schema/source/hack.angle