File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 408
408
"default" : true ,
409
409
"description" : " Does not reformat one-line code blocks, such as \" if (...) {...} else {...}\" ."
410
410
},
411
+ "powershell.codeFormatting.alignPropertyValuePairs" : {
412
+ "type" : " boolean" ,
413
+ "default" : true ,
414
+ "description" : " Align assignment statements in a hashtable or a DSC Configuration."
415
+ },
411
416
"powershell.integratedConsole.showOnStartup" : {
412
417
"type" : " boolean" ,
413
418
"default" : true ,
Original file line number Diff line number Diff line change @@ -174,7 +174,8 @@ class PSDocumentFormattingEditProvider implements
174
174
"PSPlaceCloseBrace" ,
175
175
"PSPlaceOpenBrace" ,
176
176
"PSUseConsistentWhitespace" ,
177
- "PSUseConsistentIndentation" ] ;
177
+ "PSUseConsistentIndentation" ,
178
+ "PSAlignAssignmentStatement" ]
178
179
179
180
// Allows edits to be undone and redone is a single step.
180
181
// It is usefuld to have undo stops after every edit while debugging
@@ -426,6 +427,10 @@ class PSDocumentFormattingEditProvider implements
426
427
ruleSettings [ "CheckSeparator" ] = psSettings . codeFormatting . whitespaceAfterSeparator ;
427
428
break ;
428
429
430
+ case "PSAlignAssignmentStatement" :
431
+ ruleSettings [ "CheckHashtable" ] = psSettings . codeFormatting . alignPropertyValuePairs ;
432
+ break ;
433
+
429
434
default :
430
435
break ;
431
436
}
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ export interface ICodeFormattingSettings {
15
15
whitespaceAroundOperator : boolean ;
16
16
whitespaceAfterSeparator : boolean ;
17
17
ignoreOneLineBlock : boolean ;
18
+ alignPropertyValuePairs : boolean ;
18
19
}
19
20
20
21
export interface IScriptAnalysisSettings {
@@ -71,7 +72,8 @@ export function load(myPluginId: string): ISettings {
71
72
whitespaceBeforeOpenParen : true ,
72
73
whitespaceAroundOperator : true ,
73
74
whitespaceAfterSeparator : true ,
74
- ignoreOneLineBlock : true
75
+ ignoreOneLineBlock : true ,
76
+ alignPropertyValuePairs : true
75
77
} ;
76
78
77
79
let defaultIntegratedConsoleSettings : IIntegratedConsoleSettings = {
You can’t perform that action at this time.
0 commit comments