Skip to content

Commit 8a2f71c

Browse files
Kapil Borledaviwil
Kapil Borle
authored andcommitted
Add code formatting presets
1 parent d987fda commit 8a2f71c

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,17 @@
412412
"default": false,
413413
"description": "Launches the language service with the /waitForDebugger flag to force it to wait for a .NET debugger to attach before proceeding."
414414
},
415+
"powershell.codeFormatting.preset": {
416+
"type":"string",
417+
"enum": [
418+
"Custom",
419+
"KR-Stroustrup",
420+
"KR-OTBS",
421+
"Allman"
422+
],
423+
"default": "KR-Stroustrup",
424+
"description": "Sets the codeformatting options to follow the given indent style in a way that is compatible with PowerShell syntax. For more information about the brace styles please refer to https://github.com/PoshCode/PowerShellPracticeAndStyle/issues/81."
425+
},
415426
"powershell.codeFormatting.openBraceOnSameLine": {
416427
"type": "boolean",
417428
"default": true,

src/settings.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import vscode = require('vscode');
88
import utils = require('./utils');
99

1010
export interface ICodeFormattingSettings {
11+
preset: string;
1112
openBraceOnSameLine: boolean;
1213
newLineAfterOpenBrace: boolean;
1314
newLineAfterCloseBrace: boolean;
@@ -69,6 +70,7 @@ export function load(): ISettings {
6970
};
7071

7172
let defaultCodeFormattingSettings: ICodeFormattingSettings = {
73+
preset: CodeFormattingPreset.
7274
openBraceOnSameLine: true,
7375
newLineAfterOpenBrace: true,
7476
newLineAfterCloseBrace: true,

0 commit comments

Comments
 (0)