Skip to content

Commit 37eb4a8

Browse files
author
Kapil Borle
committed
Change alignAssignmentsInHashtable to alignPropertyValuePairs
The property value pairs defined in a DSC configuration are in fact key value pairs of a hashtable. This can be easily verified by parsing a DSC configuration and examining the AST nodes. However, while naming they are referred to as part of DSC configuration and not a hashtable. Therefore the option name "alignAssignmentsInHashtable" would sound somewhat misleading to users, if enabling the option would format even the property value pairs in a DSC configuration.
1 parent d1145d3 commit 37eb4a8

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@
408408
"default": true,
409409
"description": "Does not reformat one-line code blocks, such as \"if (...) {...} else {...}\"."
410410
},
411-
"powershell.codeFormatting.alignAssignmentsInHashtable": {
411+
"powershell.codeFormatting.alignPropertyValuePairs": {
412412
"type": "boolean",
413413
"default": true,
414414
"description": "Align assignment statements in a hashtable."

src/features/DocumentFormatter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ class PSDocumentFormattingEditProvider implements
428428
break;
429429

430430
case "PSAlignAssignmentStatement":
431-
ruleSettings["CheckHashtable"] = psSettings.codeFormatting.alignAssignmentsInHashtable;
431+
ruleSettings["CheckHashtable"] = psSettings.codeFormatting.alignPropertyValuePairs;
432432
break;
433433

434434
default:

src/settings.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface ICodeFormattingSettings {
1515
whitespaceAroundOperator: boolean;
1616
whitespaceAfterSeparator: boolean;
1717
ignoreOneLineBlock: boolean;
18-
alignAssignmentsInHashtable: boolean;
18+
alignPropertyValuePairs: boolean;
1919
}
2020

2121
export interface IScriptAnalysisSettings {
@@ -73,7 +73,7 @@ export function load(myPluginId: string): ISettings {
7373
whitespaceAroundOperator: true,
7474
whitespaceAfterSeparator: true,
7575
ignoreOneLineBlock: true,
76-
alignAssignmentsInHashtable: true
76+
alignPropertyValuePairs: true
7777
};
7878

7979
let defaultIntegratedConsoleSettings: IIntegratedConsoleSettings = {

0 commit comments

Comments
 (0)