VS Code's default implementation for code folding just looks for indentation. Right now, our Terraform files have headers delineating each section. By indenting all the actual section code by one level, we get the ability to fold a file (ctrl+k+1) into a list of sections. For instance, here's the iam-roles.tf file mostly collapsed, only revealing one section:
Indentation has been added to:
main.tf
api-deployments.tf
api-gateway.tf
iam-policies.tf
iam-roles.tf
I've been meaning to do this refactor for a long time, ran it by Louis a couple months back. The new Segment analytics stuff is rebased on top of this, seems like a good time to get it done.
VS Code's default implementation for code folding just looks for indentation. Right now, our Terraform files have headers delineating each section. By indenting all the actual section code by one level, we get the ability to fold a file (
ctrl
+k
+1
) into a list of sections. For instance, here's theiam-roles.tf
file mostly collapsed, only revealing one section:Indentation has been added to:
main.tf
api-deployments.tf
api-gateway.tf
iam-policies.tf
iam-roles.tf
I've been meaning to do this refactor for a long time, ran it by Louis a couple months back. The new Segment analytics stuff is rebased on top of this, seems like a good time to get it done.