2016-06-10 177 views
11

當我在VS代碼編輯器中使用自動套用格式功能,它花括號像在此之前插入空格:VS碼 - 花括號之前代碼格式化空間

來源:

<Button onClick={this.callMyFunc.bind(this, screenSet.index)}>Add</Button> 

要:

<Button onClick={this.callMyFunc.bind(this, screenSet.index) }>Add</Button> 

來自:

))} 

收件人:

)) } 

我找不到選項這是什麼設置...任何人都可以幫助我嗎?

回答

4

嘗試把給你的用戶設置:

"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, 

,也許這也

"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, 
+5

不幸的是,它並沒有幫助... –

2

看來,儘管這些配置設置,它尚未supportedVSCode。 :(

1

偏好,應將這些設置true

"javascript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": true, 
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": true