

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 在 Visual Studio 中设置 CloudFormation 模板的格式
<a name="tkv-cfn-editor-format"></a>
+ 在解决方案资源管理器中，打开模板的上下文（右键单击）菜单，然后选择 **Format Template (格式模板)**。

  或者，要对您当前编辑的模板进行格式设置，请从 **Template (模板)** 菜单中，选择 **Format Template (格式模板)**。  
![\[Dropdown menu showing options to deploy to CloudFormation, estimate cost, and format template.\]](http://docs.aws.amazon.com/zh_cn/toolkit-for-visual-studio/latest/user-guide/images/vs-editor-template-menu-format.png)

  您的 JSON 代码将进行格式设置，以便清晰地呈现其结构。  
![\[JSON code structure for CloudFormation template with UserData and Properties sections.\]](http://docs.aws.amazon.com/zh_cn/toolkit-for-visual-studio/latest/user-guide/images/vs-editor-cfn-formatting.png)