File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed
Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 276276 "default" : true ,
277277 "description" : " Places open brace on the same line as its associated statement."
278278 },
279+ "powershell.codeformatting.newLineAfterOpenBrace" :{
280+ "type" :" boolean" ,
281+ "default" : true ,
282+ "description" : " A new line must follow an open brace."
283+ },
279284 "powershell.codeformatting.indentationSize" :{
280285 "type" :" number" ,
281286 "default" : 4 ,
Original file line number Diff line number Diff line change @@ -139,11 +139,10 @@ class PSDocumentFormattingEditProvider implements vscode.DocumentFormattingEditP
139139 let ruleProperty : string ;
140140 switch ( rule ) {
141141 case "PSPlaceOpenBrace" :
142- // TODO Add newlineafter option to settings
143142 ruleProperty = `${ rule } = @{
144143 Enable = \$true
145144 OnSameLine = \$${ settings . codeformatting . openBraceOnSameLine }
146- NewLineAfter = \$true
145+ NewLineAfter = \$${ settings . codeformatting . newLineAfterOpenBrace }
147146 }` ;
148147 break ;
149148
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import vscode = require('vscode');
88
99export interface ICodeFormattingSettings {
1010 openBraceOnSameLine : boolean ;
11+ newLineAfterOpenBrace : boolean ;
1112 indentationSize : number ;
1213}
1314
@@ -48,6 +49,7 @@ export function load(myPluginId: string): ISettings {
4849
4950 let defaultCodeFormattingSettings : ICodeFormattingSettings = {
5051 openBraceOnSameLine : true ,
52+ newLineAfterOpenBrace : true ,
5153 indentationSize : 4
5254 } ;
5355
You can’t perform that action at this time.
0 commit comments