Powershell_es is so perfect rn

This commit is contained in:
2026-08-31 11:28:41 +02:00
parent 5b0b6f32c5
commit f4ad52f1b1
4 changed files with 538 additions and 498 deletions
@@ -0,0 +1,29 @@
function! neoformat#formatters#powershell#enabled() abort
return ['pwshfmt']
endfunction
function! neoformat#formatters#powershell#pwshfmt() abort
"if has('win32') || has('win64')
" let l:args = [
" \ '-NoProfile',
" \ '-Command',
" \ 'Import-Module PSScriptAnalyzer; Invoke-Formatter -ScriptDefinition (\$input | Out-String)',
" \ ]
"else
" let l:args = [
" \ '-NoProfile',
" \ '-Command',
" \ '"Import-Module (Resolve-Path \"/opt/powershell-editor-services/PSScriptAnalyzer/*/PSScriptAnalyzer.psd1\" | Select-Object -ExpandProperty Path); Invoke-Formatter -ScriptDefinition (\$input | Out-String)"'
" \ ]
"endif
"
return {
\ 'exe': 'pwsh',
\ 'args': [
\ '-NoProfile',
\ '-Command',
\ 'Import-Module PSScriptAnalyzer; Invoke-Formatter -ScriptDefinition ($input | Out-String)'
\ ],
\ 'stdin': 1,
\ }
endfunction