<i id='7AS4N'><tr id='7AS4N'><dt id='7AS4N'><q id='7AS4N'><span id='7AS4N'><b id='7AS4N'><form id='7AS4N'><ins id='7AS4N'></ins><ul id='7AS4N'></ul><sub id='7AS4N'></sub></form><legend id='7AS4N'></legend><bdo id='7AS4N'><pre id='7AS4N'><center id='7AS4N'></center></pre></bdo></b><th id='7AS4N'></th></span></q></dt></tr></i><div id='7AS4N'><tfoot id='7AS4N'></tfoot><dl id='7AS4N'><fieldset id='7AS4N'></fieldset></dl></div>
  • <small id='7AS4N'></small><noframes id='7AS4N'>

      <tfoot id='7AS4N'></tfoot>

        • <bdo id='7AS4N'></bdo><ul id='7AS4N'></ul>
      1. <legend id='7AS4N'><style id='7AS4N'><dir id='7AS4N'><q id='7AS4N'></q></dir></style></legend>

        如何设置 VSCode 以将花括号放在新行上?

        时间:2023-05-29
          <bdo id='fXMuj'></bdo><ul id='fXMuj'></ul>

          <i id='fXMuj'><tr id='fXMuj'><dt id='fXMuj'><q id='fXMuj'><span id='fXMuj'><b id='fXMuj'><form id='fXMuj'><ins id='fXMuj'></ins><ul id='fXMuj'></ul><sub id='fXMuj'></sub></form><legend id='fXMuj'></legend><bdo id='fXMuj'><pre id='fXMuj'><center id='fXMuj'></center></pre></bdo></b><th id='fXMuj'></th></span></q></dt></tr></i><div id='fXMuj'><tfoot id='fXMuj'></tfoot><dl id='fXMuj'><fieldset id='fXMuj'></fieldset></dl></div>

              <tfoot id='fXMuj'></tfoot>

                <small id='fXMuj'></small><noframes id='fXMuj'>

                  <legend id='fXMuj'><style id='fXMuj'><dir id='fXMuj'><q id='fXMuj'></q></dir></style></legend>
                    <tbody id='fXMuj'></tbody>
                  本文介绍了如何设置 VSCode 以将花括号放在新行上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  假设我输入以下代码并对其进行格式化.

                  Let's say I type in the following code and format it.

                  if (condition) { /* Hello! */ }
                  

                  如果这是 C# 代码,格式如下:

                  If this is C# code, it is formatted like this:

                  if (condition)
                  {
                      // Hello!
                  }
                  

                  如果是 JavaScript,VSCode 的格式是这样的:

                  If it is JavaScript, VSCode formats it like this:

                  if (condition) {
                      // Hello!
                  }
                  

                  那么我怎样才能为所有语言使用第一种格式样式(新行上的花括号)?我找不到设置或类似的东西.有什么建议吗?

                  So how can I use the first formatting style (curly braces on new lines) for all languages? I can't find a setting or something similar. Suggestions?

                  推荐答案

                  按照以下步骤使 Visual Studio Code 格式在 Java Script 的新行上打开花括号> 和 键入脚本.

                  Follow the steps below to make Visual Studio Code format opening curly braces on a new line for Java Script and Type Script.

                  在 Visual Studio 代码 (v1.20.0)

                  1. 转到文件首选项设置
                  2. 在用户设置"(在右侧窗格中)中添加以下行

                  1. Go to FilePreferencesSettings
                  2. Add the following lines in 'User Settings' (in the right side pane)

                  "javascript.format.placeOpenBraceOnNewLineForControlBlocks": true, 
                  "javascript.format.placeOpenBraceOnNewLineForFunctions": true,
                  
                  "typescript.format.placeOpenBraceOnNewLineForControlBlocks": true,
                  "typescript.format.placeOpenBraceOnNewLineForFunctions": true,
                  

                • 保存用户设置"即可完成!

                  这篇关于如何设置 VSCode 以将花括号放在新行上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                • 上一篇:格式化 HTML 表格单元格以便 Excel 格式化为文本 下一篇:用于人类友好的相对日期格式的 Javascript 库

                  相关文章

                  最新文章

                  1. <legend id='C68sF'><style id='C68sF'><dir id='C68sF'><q id='C68sF'></q></dir></style></legend>
                    <tfoot id='C68sF'></tfoot>
                        <bdo id='C68sF'></bdo><ul id='C68sF'></ul>

                      <small id='C68sF'></small><noframes id='C68sF'>

                      <i id='C68sF'><tr id='C68sF'><dt id='C68sF'><q id='C68sF'><span id='C68sF'><b id='C68sF'><form id='C68sF'><ins id='C68sF'></ins><ul id='C68sF'></ul><sub id='C68sF'></sub></form><legend id='C68sF'></legend><bdo id='C68sF'><pre id='C68sF'><center id='C68sF'></center></pre></bdo></b><th id='C68sF'></th></span></q></dt></tr></i><div id='C68sF'><tfoot id='C68sF'></tfoot><dl id='C68sF'><fieldset id='C68sF'></fieldset></dl></div>