pwsh & rustfmt

This commit is contained in:
2026-05-22 10:11:25 +02:00
parent ee4515da26
commit 91773e0a00
7 changed files with 59 additions and 8 deletions
+25
View File
@@ -0,0 +1,25 @@
function! neoformat#formatters#pwsh#enabled() abort
return ['pwshfmt']
endfunction
function! neoformat#formatters#pwsh#pwshfmt() abort
if has('win32') || has('win64')
let l:args = [
\ '-NoProfile',
\ '-Command',
\ 'Invoke-Formatter',
\ ]
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': l:args,
\ 'stdin': 1,
\ }
endfunction