Skip to content

Add new powershell.codeFormatting settings for new options in PSSA 1.18: WhitespaceInsideBrace and WhitespaceAroundPipe #1668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@
"properties": {
"powershell.sideBar.CommandExplorerVisibility": {
"type": "boolean",
"default":true,
"default": true,
"description": "Specifies the visibility of the Command Explorer in the PowerShell Side Bar."
},
"powershell.powerShellExePath": {
Expand Down Expand Up @@ -611,6 +611,16 @@
"default": true,
"description": "Adds a space after a separator (',' and ';')."
},
"powershell.codeFormatting.WhitespaceInsideBrace": {
"type": "boolean",
"default": true,
"description": "Adds a space after an opening brace ('}') and before a closing brace ('}')."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You say "opening brace" but then use a closing brace as an example. I think that should be ('{').

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well spotted, thanks. I fixed it

},
"powershell.codeFormatting.WhitespaceAroundPipe": {
"type": "boolean",
"default": true,
"description": "Adds a space before and after a pipeline ('|')."
Copy link
Contributor

@rkeithhill rkeithhill Mar 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should refer to this symbol as it is referred to in the docs "pipeline operator" e.g. "... before and after the pipeline operator ('|').".

},
"powershell.codeFormatting.ignoreOneLineBlock": {
"type": "boolean",
"default": true,
Expand Down
4 changes: 4 additions & 0 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export interface ICodeFormattingSettings {
whitespaceBeforeOpenParen: boolean;
whitespaceAroundOperator: boolean;
whitespaceAfterSeparator: boolean;
WhitespaceInsideBrace: true;
WhitespaceAroundPipe: true;
ignoreOneLineBlock: boolean;
alignPropertyValuePairs: boolean;
}
Expand Down Expand Up @@ -129,6 +131,8 @@ export function load(): ISettings {
whitespaceBeforeOpenParen: true,
whitespaceAroundOperator: true,
whitespaceAfterSeparator: true,
WhitespaceInsideBrace: true,
WhitespaceAroundPipe: true,
ignoreOneLineBlock: true,
alignPropertyValuePairs: true,
};
Expand Down