intellij-powershell
intellij-powershell copied to clipboard
Don't indent functions unless "Function" keyword is present
It looks like by virtue of including the [CmdletBinding()] attribute before a Param block, the pretty-printer assumes that we're inside a function block, even without the Function keywork being present in the file. In these cases, the file is the function, and so the entire file should not be indented one level.
Reproduction:
Formatting the below in a file by itself results in the entire file being indented.
[CmdletBinding()]
Param(
)
Write-Output "Hello world!"