Powershell_es is so perfect rn
This commit is contained in:
@@ -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
|
||||
@@ -27,7 +27,6 @@ require("mason-lspconfig").setup {
|
||||
"lua_ls",
|
||||
"qmlls",
|
||||
"rust_analyzer",
|
||||
"powershell_es",
|
||||
},
|
||||
handlers = {
|
||||
function(server_name) -- default handler (optional)
|
||||
@@ -50,13 +49,6 @@ require("mason-lspconfig").setup {
|
||||
}
|
||||
end,
|
||||
|
||||
["powershell_es"] = function()
|
||||
local lspconfig = require "lspconfig"
|
||||
lspconfig.powershell_es.setup {
|
||||
capabilities = capabilities,
|
||||
}
|
||||
end,
|
||||
|
||||
["rust_analyzer"] = function()
|
||||
local lspconfig = require "lspconfig"
|
||||
lspconfig.rust_analyzer.setup {
|
||||
@@ -263,6 +255,25 @@ lspconfig("jsonls", {
|
||||
},
|
||||
})
|
||||
|
||||
lspconfig("powershell_es", {
|
||||
settings = {
|
||||
powershell = {
|
||||
codeFormatting = {
|
||||
preset = "Custom",
|
||||
openBraceOnSameLine = true,
|
||||
newLineAfterOpenBrace = false,
|
||||
newLineAfterCloseBrace = true,
|
||||
whitespaceBeforeOpenBrace = true,
|
||||
whitespaceBeforeOpenParen = true,
|
||||
whitespaceAroundOperator = true,
|
||||
whitespaceAfterSeparator = true,
|
||||
ignoreOneLineBlock = true,
|
||||
pipelineIndentationStyle = "NoIndentation",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
lspconfig("yamlls", {
|
||||
settings = {
|
||||
yaml = {
|
||||
@@ -285,7 +296,7 @@ local servers = {
|
||||
"sourcekit",
|
||||
"qmlls",
|
||||
"tailwindcss",
|
||||
-- "systemd-lsp",
|
||||
"systemd-lsp",
|
||||
require("mason-lspconfig").get_installed_servers(),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user