mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-02 21:20:05 +08:00
fix(powershell): fix default powershell formatters
This commit is contained in:
parent
cf80d38025
commit
468322ca4f
@ -12,20 +12,28 @@
|
||||
" @section PowerShell formatters, supported-filetypes-powershell
|
||||
" @parentsection supported-filetypes
|
||||
" For PowerShell script, there are two default formatters.
|
||||
" `Edit-DTWBeautifyScript` and `Invoke-Formatter`.
|
||||
"
|
||||
" Before using these default formatters, you need to install the PowerShell
|
||||
" modules.
|
||||
" >
|
||||
" Install-Module -Name PowerShell-Beautifier -Scope CurrentUser
|
||||
" Install-Module -Name PSScriptAnalyzer -Scope CurrentUser
|
||||
" <
|
||||
"
|
||||
" @subsection PowerShellBeautifier
|
||||
" >
|
||||
" {
|
||||
" 'exe' : 'Edit-DTWBeautifyScript',
|
||||
" 'args' : ["-IndentType FourSpaces", "-StandardOutput"],
|
||||
" 'exe' : 'powershell',
|
||||
" 'args' : ['-noprofile', '-Command', "Edit-DTWBeautifyScript", "-IndentType", "FourSpaces", "-StandardOutput"],
|
||||
" 'stdin' : 0,
|
||||
" }
|
||||
" <
|
||||
" @subsection PSScriptAnalyzer
|
||||
" >
|
||||
" {
|
||||
" 'exe' : 'Invoke-Formatter',
|
||||
" 'args' : ['-ScriptDefinition (Get-Content ' . expand('%') . ' -Raw)'],
|
||||
" 'exe' : 'powershell',
|
||||
" 'args' : ['-noprofile', '-Command', 'Invoke-Formatter', '-ScriptDefinition (Get-Content ' . expand('%') . ' -Raw)'],
|
||||
" 'stdin' : 0,
|
||||
" 'no_append' : 1,
|
||||
" }
|
||||
|
@ -4,16 +4,16 @@ endfunction
|
||||
|
||||
function! neoformat#formatters#ps1#PowerShellBeautifier() abort
|
||||
return {
|
||||
\ 'exe' : 'Edit-DTWBeautifyScript',
|
||||
\ 'args' : ["-IndentType FourSpaces", "-StandardOutput"],
|
||||
\ 'exe' : 'powershell',
|
||||
\ 'args' : ['-noprofile', '-Command', "Edit-DTWBeautifyScript", "-IndentType", "FourSpaces", "-StandardOutput"],
|
||||
\ 'stdin' : 0,
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
function! neoformat#formatters#ps1#PSScriptAnalyzer() abort
|
||||
return {
|
||||
\ 'exe' : 'Invoke-Formatter',
|
||||
\ 'args' : ['-ScriptDefinition (Get-Content ' . expand('%') . ' -Raw)'],
|
||||
\ 'exe' : 'powershell',
|
||||
\ 'args' : ['-noprofile', '-Command', 'Invoke-Formatter', '-ScriptDefinition (Get-Content ' . expand('%') . ' -Raw)'],
|
||||
\ 'stdin' : 0,
|
||||
\ 'no_append' : 1,
|
||||
\ }
|
||||
|
@ -232,13 +232,22 @@ This is a list of default formatters.
|
||||
POWERSHELL FORMATTERS *neoformat-supported-filetypes-powershell*
|
||||
|
||||
For PowerShell script, there are two default formatters.
|
||||
`Edit-DTWBeautifyScript` and `Invoke-Formatter`.
|
||||
|
||||
Before using these default formatters, you need to install the PowerShell
|
||||
modules.
|
||||
>
|
||||
Install-Module -Name PowerShell-Beautifier -Scope CurrentUser
|
||||
Install-Module -Name PSScriptAnalyzer -Scope CurrentUser
|
||||
<
|
||||
|
||||
POWERSHELLBEAUTIFIER
|
||||
|
||||
>
|
||||
{
|
||||
'exe' : 'Edit-DTWBeautifyScript',
|
||||
'args' : ["-IndentType FourSpaces", "-StandardOutput"],
|
||||
'exe' : 'powershell',
|
||||
'args' : ['-noprofile', '-Command', "Edit-DTWBeautifyScript",
|
||||
"-IndentType", "FourSpaces", "-StandardOutput"],
|
||||
'stdin' : 0,
|
||||
}
|
||||
<
|
||||
@ -246,8 +255,9 @@ PSSCRIPTANALYZER
|
||||
|
||||
>
|
||||
{
|
||||
'exe' : 'Invoke-Formatter',
|
||||
'args' : ['-ScriptDefinition (Get-Content ' . expand('%') . ' -Raw)'],
|
||||
'exe' : 'powershell',
|
||||
'args' : ['-noprofile', '-Command', 'Invoke-Formatter', '-ScriptDefinition
|
||||
(Get-Content ' . expand('%') . ' -Raw)'],
|
||||
'stdin' : 0,
|
||||
'no_append' : 1,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user