Skip to main content

Hack

The Hack indexer is built into the Hack typechecker.

Run the indexer#

hh_server DIR --write-symbol-info JSON

where

  • DIR is the root directory containing the .php files
  • JSON is the directory in which to write the output .json files

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.

In the shell#

Hack source can also be indexed directly from the Glean shell:

:index hack DIR

Schema#

The schema is in glean/schema/source/hack.angle