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 276
276
"default" : true ,
277
277
"description" : " Places open brace on the same line as its associated statement."
278
278
},
279
+ "powershell.codeformatting.newLineAfterOpenBrace" :{
280
+ "type" :" boolean" ,
281
+ "default" : true ,
282
+ "description" : " A new line must follow an open brace."
283
+ },
279
284
"powershell.codeformatting.indentationSize" :{
280
285
"type" :" number" ,
281
286
"default" : 4 ,
Original file line number Diff line number Diff line change @@ -139,11 +139,10 @@ class PSDocumentFormattingEditProvider implements vscode.DocumentFormattingEditP
139
139
let ruleProperty : string ;
140
140
switch ( rule ) {
141
141
case "PSPlaceOpenBrace" :
142
- // TODO Add newlineafter option to settings
143
142
ruleProperty = `${ rule } = @{
144
143
Enable = \$true
145
144
OnSameLine = \$${ settings . codeformatting . openBraceOnSameLine }
146
- NewLineAfter = \$true
145
+ NewLineAfter = \$${ settings . codeformatting . newLineAfterOpenBrace }
147
146
}` ;
148
147
break ;
149
148
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import vscode = require('vscode');
8
8
9
9
export interface ICodeFormattingSettings {
10
10
openBraceOnSameLine : boolean ;
11
+ newLineAfterOpenBrace : boolean ;
11
12
indentationSize : number ;
12
13
}
13
14
@@ -48,6 +49,7 @@ export function load(myPluginId: string): ISettings {
48
49
49
50
let defaultCodeFormattingSettings : ICodeFormattingSettings = {
50
51
openBraceOnSameLine : true ,
52
+ newLineAfterOpenBrace : true ,
51
53
indentationSize : 4
52
54
} ;
53
55
You can’t perform that action at this time.
0 commit comments