Open
Description
Context
Currently, whenever there is a missing required attribute we attach a diagnostic to the body which expected the attribute. While this is semantically correct (from the perspective that required attributes are defined by the body), it is usually unhelpful to the user, because:
- bodies can be very long, so we end up underlining a lot of code which isn't necessarily causing the problem
- we may end up hiding diagnostics related to other declared attributes within the body (e.g. deprecation) due to ^

Proposal
Associate the range for "missing required attribute" diagnostic with the header of the block, i.e. in the example above resource "aws_security_group_rule" "name"
, rather than the body (i.e. code between {
and }
).