diff --git a/package.json b/package.json index 8ffd640bff..1708f51dc7 100644 --- a/package.json +++ b/package.json @@ -412,6 +412,16 @@ "default": false, "description": "Launches the language service with the /waitForDebugger flag to force it to wait for a .NET debugger to attach before proceeding." }, + "powershell.codeFormatting.preset": { + "type":"string", + "enum": [ + "Custom", + "OTBS", + "Allman" + ], + "default": "Custom", + "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." + }, "powershell.codeFormatting.openBraceOnSameLine": { "type": "boolean", "default": true, diff --git a/src/settings.ts b/src/settings.ts index ec81ff4a57..13d9e814ad 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -7,7 +7,14 @@ import vscode = require('vscode'); import utils = require('./utils'); +enum CodeFormattingPreset { + Custom, + OTBS, + Allman +} + export interface ICodeFormattingSettings { + preset: CodeFormattingPreset; openBraceOnSameLine: boolean; newLineAfterOpenBrace: boolean; newLineAfterCloseBrace: boolean; @@ -69,6 +76,7 @@ export function load(): ISettings { }; let defaultCodeFormattingSettings: ICodeFormattingSettings = { + preset: CodeFormattingPreset.Custom, openBraceOnSameLine: true, newLineAfterOpenBrace: true, newLineAfterCloseBrace: true,