diff options
Diffstat (limited to 'lsp')
| -rw-r--r-- | lsp/yamlls.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lsp/yamlls.lua b/lsp/yamlls.lua index 586745a7..04e837e1 100644 --- a/lsp/yamlls.lua +++ b/lsp/yamlls.lua @@ -70,4 +70,11 @@ return { -- formatting disabled by default in yaml-language-server; enable it yaml = { format = { enable = true } }, }, + on_init = function(client) + --- 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, } |
