1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 11:30:06 +08:00

perf(powershell): fix powershell formatters

This commit is contained in:
Eric Wong 2024-03-13 21:17:50 +08:00
parent c97b857588
commit cf80d38025
2 changed files with 72 additions and 1 deletions

View File

@ -0,0 +1,45 @@
"=============================================================================
" neoformat.vim --- A Neovim plugin for formatting
" Copyright (c) 2016-2021 Steve Dignam
" Copyright (c) 2022 Eric Wong
" Author: Eric Wong < wsdjeg@outlook.com >
" URL: https://spacevim.org
" License: GPLv3
"=============================================================================
""
" @section PowerShell formatters, supported-filetypes-powershell
" @parentsection supported-filetypes
" For PowerShell script, there are two default formatters.
"
" @subsection PowerShellBeautifier
" >
" {
" 'exe' : 'Edit-DTWBeautifyScript',
" 'args' : ["-IndentType FourSpaces", "-StandardOutput"],
" 'stdin' : 0,
" }
" <
" @subsection PSScriptAnalyzer
" >
" {
" 'exe' : 'Invoke-Formatter',
" 'args' : ['-ScriptDefinition (Get-Content ' . expand('%') . ' -Raw)'],
" 'stdin' : 0,
" 'no_append' : 1,
" }
" <
function! neoformat#formatters#powershell#enabled() abort
return neoformat#formatters#ps1#enabled()
endfunction
function! neoformat#formatters#powershell#PowerShellBeautifier() abort
return neoformat#formatters#ps1#PowerShellBeautifier()
endfunction
function! neoformat#formatters#powershell#PSScriptAnalyzer() abort
return neoformat#formatters#ps1#PSScriptAnalyzer()
endfunction

View File

@ -9,7 +9,8 @@ CONTENTS *neoformat-contents*
4. ADDING A NEW FORMATTER...................|neoformat-adding-new-formatter|
5. MANAGING UNDO HISTORY...................|neoformat-managing-undo-history|
6. Supported filetypes.......................|neoformat-supported-filetypes|
1. SQL formatters....................|neoformat-supported-filetypes-sql|
1. PowerShell formatters......|neoformat-supported-filetypes-powershell|
2. SQL formatters....................|neoformat-supported-filetypes-sql|
==============================================================================
INTRODUCTION *neoformat-intro*
@ -227,6 +228,31 @@ SUPPORTED FILETYPES *neoformat-supported-filetypes*
This is a list of default formatters.
==============================================================================
POWERSHELL FORMATTERS *neoformat-supported-filetypes-powershell*
For PowerShell script, there are two default formatters.
POWERSHELLBEAUTIFIER
>
{
'exe' : 'Edit-DTWBeautifyScript',
'args' : ["-IndentType FourSpaces", "-StandardOutput"],
'stdin' : 0,
}
<
PSSCRIPTANALYZER
>
{
'exe' : 'Invoke-Formatter',
'args' : ['-ScriptDefinition (Get-Content ' . expand('%') . ' -Raw)'],
'stdin' : 0,
'no_append' : 1,
}
<
==============================================================================
SQL FORMATTERS *neoformat-supported-filetypes-sql*