Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hclsyntax: Hint about possible unescaped ${ for other languages
It's a common error to accidentally include a ${ intended to be processed as part of another language after HCL processing, such as a shell script or an AWS IAM policy document. Exactly what sort of error will appear in that case unfortunately depends on the syntax for that other language, but a lot of them happen to end up in the codepath where we report the "Extra characters after interpolation expression" diagnostic message. For that reason, this extends that error message with an additional hint about escaping, and I've also included a special case for colons because they happen to arise in both Bash and AWS IAM interpolation syntax, albeit with different meanings. Because this message is coming from HCL and HCL doesn't typically assume anything about the application where it's being used, the hint message is pretty generic and focuses only on the hint about the escaping syntax, in the hope that this will be hint enough to prompt the user to think about what they are currently working on and realize how to respond to this error.
- Loading branch information