Skip to content

Add option to ignore formatting of one line constructs #493

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 2 commits into from
Feb 11, 2017

Conversation

kapilmb
Copy link

@kapilmb kapilmb commented Feb 8, 2017

The user can set powershell.codeFormatting.ignoreOneLineBlock to true to ignore formatting of one line constructs, e.g.,
* if ($true) {...} else {...}
* white(Test-Something) {...}
@kapilmb kapilmb force-pushed the kapilmb/ignore-format-one-line branch from ca7e67a to 4590f74 Compare February 8, 2017 22:29
@@ -328,6 +328,11 @@ class PSDocumentFormattingEditProvider implements DocumentFormattingEditProvider
case "PSPlaceOpenBrace":
ruleSettings["OnSameLine"] = psSettings.codeFormatting.openBraceOnSameLine;
ruleSettings["NewLineAfter"] = psSettings.codeFormatting.newLineAfterOpenBrace;
ruleSettings["ignoreOneLineBlock"] = psSettings.codeFormatting.ignoreOneLineBlock;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should ignore be capitalized to match the other setting names?

Copy link
Author

Choose a reason for hiding this comment

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

Fixed!

@kapilmb kapilmb merged commit 9eead58 into develop Feb 11, 2017
@kapilmb kapilmb deleted the kapilmb/ignore-format-one-line branch February 13, 2017 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants