You've already forked dotfiles
fix: Adding in yamlls setup with the newer lspconfig arrangement
This commit is contained in:
@@ -8,7 +8,7 @@ declare -A lsp_arr=(
|
|||||||
["pylsp"]="Install the pylsp provider: python-language-server or pylsp"
|
["pylsp"]="Install the pylsp provider: python-language-server or pylsp"
|
||||||
["pylint"]="Install the pylint provider: pylint"
|
["pylint"]="Install the pylint provider: pylint"
|
||||||
["rust-analyzer"]="Install the rust-analyzer provider"
|
["rust-analyzer"]="Install the rust-analyzer provider"
|
||||||
["pyright"]="Install the pyright provider"
|
["yaml-language-server"]="Install the yamlls provider: yaml-language-server (via npm globally or system package)"
|
||||||
)
|
)
|
||||||
|
|
||||||
echo '----- Checking for LSP servers...'
|
echo '----- Checking for LSP servers...'
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
-- YAML LSP specific settings with a number of custom tags specifically for use with AWS CloudFormation templates
|
-- YAML LSP specific settings with a number of custom tags specifically for use with AWS CloudFormation templates
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
cmd = function (dispatchers, _)
|
||||||
|
return vim.lsp.rpc.start({'yaml-language-server', '--stdio'}, dispatchers)
|
||||||
|
end,
|
||||||
|
filetypes = { 'yaml', 'yaml.docker-compose', 'yaml.gitlab', 'yaml.helm-values' },
|
||||||
|
root_markers = { '.git' },
|
||||||
settings = {
|
settings = {
|
||||||
redhat = { telemetry = { enabled = false } },
|
redhat = { telemetry = { enabled = false } },
|
||||||
yaml = {
|
yaml = {
|
||||||
@@ -29,5 +34,13 @@ return {
|
|||||||
schemaStore = { enable = true },
|
schemaStore = { enable = true },
|
||||||
validate = true,
|
validate = true,
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
on_init = function(client)
|
||||||
|
-- From nvim-lspconfig's yamlls.lua
|
||||||
|
--- https://github.com/neovim/nvim-lspconfig/pull/4016
|
||||||
|
--- Since formatting is disabled by default if you check `client:supports_method('textDocument/formatting')`
|
||||||
|
--- during `LspAttach` it will return `false`. This hack sets the capability to `true` to facilitate
|
||||||
|
--- autocmd's which check this capability
|
||||||
|
client.server_capabilities.documentFormattingProvider = true
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user