improve Shapes::idx / Shapes::idx lint by underlining invalid property
commit9fb9701bbe6bfa057e2e7096add70fcc353efe2d
authorNikhil Thomas <nzthomas@fb.com>
Tue, 7 Sep 2021 19:30:52 +0000 (7 12:30 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 7 Sep 2021 19:34:24 +0000 (7 12:34 -0700)
treeeb54a9ab2626798b26af7712f53db50bb118cdce
parentb36688e261f554223565edc0cbe7294da83d8a09
improve Shapes::idx / Shapes::idx lint by underlining invalid property

Summary: The lint for Shapes::idx / Shapes::at for a key not defined on the shape currently underlines the entirety of the call to Shapes::idx/at(). I changed the AST position passed into the field_checker to correspond to the property looked up.

Reviewed By: Wilfred

Differential Revision: D30703226

fbshipit-source-id: 950ad4ddd604872e7d9b22346475e33ab8bbe086
hphp/hack/src/typing/tast_check/shape_field_check.ml
hphp/hack/test/tast/finally.php.exp
hphp/hack/test/typecheck/finally_tyvars.php.exp
hphp/hack/test/typecheck/shape/shape_field_check/shape_at2.php.exp
hphp/hack/test/typecheck/shape/shape_field_check/shape_idx_undefined_key_closed_shape.php.exp
hphp/hack/test/typecheck/shape/shape_field_check/shape_idx_unset_key_closed_shape.php.exp
hphp/hack/test/typecheck/shape/shape_field_check/shape_idx_unset_key_open_shape.php.exp
hphp/hack/test/typecheck/shape/shape_field_check/shape_idx_with_default_argument.php.exp
hphp/hack/test/typecheck/shape/shape_field_check/shape_idx_with_default_argument_2.php.exp
hphp/hack/test/typecheck/shape_remove_key2.php.exp