aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorChristopher Johnstone <61227735+ChrisPJohnstone@users.noreply.github.com>2025-08-20 18:58:56 +0100
committerGitHub <noreply@github.com>2025-08-20 10:58:56 -0700
commit592de750bf5b8c45fc48cebfde585721626ffd6d (patch)
treeea6aff221376b0a293f386425f46b6c6fb9d65b6 /doc
parentfix(ts/js): give lockfiles equal priority when finding root #4013 (diff)
downloadnvim-lspconfig-592de750bf5b8c45fc48cebfde585721626ffd6d.tar
nvim-lspconfig-592de750bf5b8c45fc48cebfde585721626ffd6d.tar.gz
nvim-lspconfig-592de750bf5b8c45fc48cebfde585721626ffd6d.tar.bz2
nvim-lspconfig-592de750bf5b8c45fc48cebfde585721626ffd6d.tar.lz
nvim-lspconfig-592de750bf5b8c45fc48cebfde585721626ffd6d.tar.xz
nvim-lspconfig-592de750bf5b8c45fc48cebfde585721626ffd6d.tar.zst
nvim-lspconfig-592de750bf5b8c45fc48cebfde585721626ffd6d.zip
feat(yamlls): force documentFormattingProvider=true #4016
Problem: The current version of the config will let you do formatting manually `:lua vim.lsp.buf.format()` but the lsp doesn't have capabilities registered correctly so if you use auto formatting like outlined in [help pages](https://neovim.io/doc/user/lsp.html#lsp-attach) if not client:supports_method('textDocument/willSaveWaitUntil') and client:supports_method('textDocument/formatting') then vim.api.nvim_create_autocmd('BufWritePre', { group = vim.api.nvim_create_augroup('my.lsp', {clear=false}), buffer = args.buf, callback = function() vim.lsp.buf.format({ bufnr = args.buf, id = client.id, timeout_ms = 1000 }) end, }) end , it won't enable for the yaml lsp because `client:supports_method('textDocument/formatting')` returns false. Solution: The `on_init` hook, while hacky, will mark the capability as true.
Diffstat (limited to 'doc')
0 files changed, 0 insertions, 0 deletions