extract dependencies from user attributes
commitae26fde392de7ce60a8878f1ca4aca57a3783a32
authorMichael Thomas <mjt@fb.com>
Mon, 8 Mar 2021 13:40:27 +0000 (8 05:40 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Mon, 8 Mar 2021 13:42:51 +0000 (8 05:42 -0800)
tree7dfb2117b80828ca9045f0bb66cec00a7328b8b2
parentc00f3bbd487b958713c8bd63b26e6ec1acef2ecb
extract dependencies from user attributes

Summary:
The dependency extraction logic  of extract-standalone currently uses decls to discover the transitive closure of target dependencies then retrieves the related NASTs and renders. Since user attributes are not used for type checking, they are not contained within the decls and are therefore not collected as dependencies. However, when NASTs are rendered, the user attributes are generated meaning that the output of extract-standalone will fail to type check because of the missing definitions.

This diff updates dependency extraction to also use NASTs, and extract classes appearing in user attributes.

Reviewed By: madgen

Differential Revision: D26750069

fbshipit-source-id: f9618f0d3481fb179cdc125b214428a0ddfdebca
15 files changed:
hphp/hack/src/server/serverExtractStandalone.ml
hphp/hack/test/integration/data/dependencies/expected/__WithMethodWithUserAttr++foo.php.exp [new file with mode: 0644]
hphp/hack/test/integration/data/dependencies/expected/__WithPropWithUserAttr++foo.php.exp [new file with mode: 0644]
hphp/hack/test/integration/data/dependencies/expected/__WithStaticPropWithUserAttr++foo.php.exp [new file with mode: 0644]
hphp/hack/test/integration/data/dependencies/expected/__WithTypeConstantWithUserAttr++foo.php.exp [new file with mode: 0644]
hphp/hack/test/integration/data/dependencies/expected/__WithUserAttr++foo.php.exp [new file with mode: 0644]
hphp/hack/test/integration/data/dependencies/expected/__enum_with_user_attr.php.exp [new file with mode: 0644]
hphp/hack/test/integration/data/dependencies/expected/__opaque_with_user_attr.php.exp [new file with mode: 0644]
hphp/hack/test/integration/data/dependencies/expected/__transparent_with_user_attr.php.exp [new file with mode: 0644]
hphp/hack/test/integration/data/dependencies/expected/__with_constr_prop_with_user_attr.php.exp [new file with mode: 0644]
hphp/hack/test/integration/data/dependencies/expected/__with_param_with_user_attr.php.exp [new file with mode: 0644]
hphp/hack/test/integration/data/dependencies/expected/__with_tparam_with_user_attr.php.exp [new file with mode: 0644]
hphp/hack/test/integration/data/dependencies/expected/__with_user_attr.php.exp [new file with mode: 0644]
hphp/hack/test/integration/data/dependencies/toplevel.php
hphp/hack/test/integration/test_extract_standalone.py