【问题标题】:How do I stop VSCode auto formatting from deleting spaces inside parentheses?如何阻止 VSCode 自动格式化删除括号内的空格?
【发布时间】:2019-04-25 17:44:28
【问题描述】:

例如,当我写作时

foo( bar ){}  

它将被格式化为

foo(bar){}  

如何让它保留 2 个空格?

编辑:
这是与How to change indentation in Visual Studio Code?不同的问题

【问题讨论】:

  • @JustLearning 上面的链接是一个完全不同的问题。

标签: visual-studio-code vscode-settings


【解决方案1】:

投入

 "javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": true

在设置中 json 解决了这个问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-21
    • 1970-01-01
    • 2020-04-22
    • 2020-08-04
    • 2021-05-25
    • 1970-01-01
    相关资源
    最近更新 更多