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 408408 "default" : true ,
409409 "description" : " Does not reformat one-line code blocks, such as \" if (...) {...} else {...}\" ."
410410 },
411+ "powershell.codeFormatting.alignPropertyValuePairs" : {
412+ "type" : " boolean" ,
413+ "default" : true ,
414+ "description" : " Align assignment statements in a hashtable or a DSC Configuration."
415+ },
411416 "powershell.integratedConsole.showOnStartup" : {
412417 "type" : " boolean" ,
413418 "default" : true ,
Original file line number Diff line number Diff line change @@ -174,7 +174,8 @@ class PSDocumentFormattingEditProvider implements
174174 "PSPlaceCloseBrace" ,
175175 "PSPlaceOpenBrace" ,
176176 "PSUseConsistentWhitespace" ,
177- "PSUseConsistentIndentation" ] ;
177+ "PSUseConsistentIndentation" ,
178+ "PSAlignAssignmentStatement" ]
178179
179180 // Allows edits to be undone and redone is a single step.
180181 // It is usefuld to have undo stops after every edit while debugging
@@ -426,6 +427,10 @@ class PSDocumentFormattingEditProvider implements
426427 ruleSettings [ "CheckSeparator" ] = psSettings . codeFormatting . whitespaceAfterSeparator ;
427428 break ;
428429
430+ case "PSAlignAssignmentStatement" :
431+ ruleSettings [ "CheckHashtable" ] = psSettings . codeFormatting . alignPropertyValuePairs ;
432+ break ;
433+
429434 default :
430435 break ;
431436 }
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ export interface ICodeFormattingSettings {
1515 whitespaceAroundOperator : boolean ;
1616 whitespaceAfterSeparator : boolean ;
1717 ignoreOneLineBlock : boolean ;
18+ alignPropertyValuePairs : boolean ;
1819}
1920
2021export interface IScriptAnalysisSettings {
@@ -71,7 +72,8 @@ export function load(myPluginId: string): ISettings {
7172 whitespaceBeforeOpenParen : true ,
7273 whitespaceAroundOperator : true ,
7374 whitespaceAfterSeparator : true ,
74- ignoreOneLineBlock : true
75+ ignoreOneLineBlock : true ,
76+ alignPropertyValuePairs : true
7577 } ;
7678
7779 let defaultIntegratedConsoleSettings : IIntegratedConsoleSettings = {
You can’t perform that action at this time.
0 commit comments