hashicorp / hcl

HCL is the HashiCorp configuration language.
Mozilla Public License 2.0
5.31k stars 599 forks source link

feat: return an `ExprSyntaxError` for invalid references that end in a dot #692

Closed ansgarm closed 3 months ago

ansgarm commented 3 months ago

Return an ExprSyntaxError for invalid references that end in a dot (commonly occurs in editors for completions).

Detect value expressions of the ExprSyntaxError type when parsing object constructor expressions and use them to add an item to the result even though we skip parsing the object due to recovery after the invalid expression.

This allows the Terraform language server to support completions for object attributes after a dot was typed.