Autocomplete global symbol table generator app
commitbb7fb053f624a4bbf3005810e65e1355423e8624
authorTed Spence <tspence@fb.com>
Fri, 12 Apr 2019 01:12:38 +0000 (11 18:12 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Fri, 12 Apr 2019 01:18:47 +0000 (11 18:18 -0700)
tree860cd0bb083c1a414e42062f871e908f44357758
parent209bc472361c6bd5a1700a75268e7f46ccd20b07
Autocomplete global symbol table generator app

Summary:
Create a program, global_index_builder, that can scan WWW and generate a saved-state containing autocomplete global symbols.

An autocomplete global is:
* A name (string)
* A kind (integer, indicating class, interface, enum, trait, unknown, mixed, function, or typedef)

The program produces:
* A SQLite database with symbols and kinds.
* A text file written as one symbol per line followed by a space followed by the integer number of the kind

Syntax:
```
$ global_index_builder --sqlite ./www.autocomplete.db --text ./www.autocomplete.txt ~/www
Building global symbol index for [/data/users/tspence/www-hg/]
Scanning repository /data/users/tspence/www-hg/...  [11.0 secs]
Parsing 1536385 files...  [87.5 secs]
Writing 2209147 symbols to sqlite...  [66.7 secs]
Writing 2209147 symbols to text...  [41.0 secs]

Global Index Built successfully: [206.5 secs]
```

Differential Revision: D14645751

fbshipit-source-id: e35124a8451a2ad5d019f71524cd58d72f108f4d
hphp/hack/src/facts/facts.ml
hphp/hack/src/facts/facts_parser.ml
hphp/hack/src/facts/facts_parser.mli
hphp/hack/src/facts/symbols/indexBuilder.ml [new file with mode: 0644]
hphp/hack/src/facts/symbols/indexBuilderTypes.ml [new file with mode: 0644]
hphp/hack/src/facts/symbols/jsonIndexWriter.ml [new file with mode: 0644]
hphp/hack/src/facts/symbols/sqliteIndexWriter.ml [new file with mode: 0644]
hphp/hack/src/facts/symbols/textIndexWriter.ml [new file with mode: 0644]
hphp/hack/src/hh_single_compile.ml