terraform
The community/lang/terraform
directory contains files to enable voice control of Terraform code using Talon.
The most important files are:
terraform.talon
: This file contains the Talon commands for working with Terraform code. It defines tags to activate the grammar, and commands to insert various elements, such as resource and data blocks, module blocks, common properties, and operators.- The file also uses custom actions to insert module, resource, and data blocks.
- It enables c-like comments and code blocks, as well as common operators.
terraform.py
: This file contains the Python implementation of the custom actions and lists used interraform.talon
.- It defines lists of common types (string, number, bool, etc.) and common Terraform properties (name, type, description, etc.).
- It implements the custom actions used in
terraform.talon
for inserting Terraform blocks and operators. For example,code_terraform_module_block(text)
inserts a module-related block of a given type, andcode_terraform_resource(text)
inserts a new resource block. - It also defines the behavior for inserting operators such as assignment, subtraction, addition, multiplication, division, modulo, equality, inequality, greater than, less than, and/or, etc.
These files work together to provide a comprehensive set of commands for controlling Terraform code by voice. The terraform.talon
file defines the grammar and calls actions in terraform.py
to insert code. The lists defined in terraform.py
are used to provide voice commands to insert types, properties, and module blocks.