From b86e01bd1c6af1b1a9eddde9e1922c93137acba9 Mon Sep 17 00:00:00 2001 From: Matthew Leong Date: Fri, 6 Jan 2023 09:30:52 -0800 Subject: [PATCH] feat(lsp): clean up commands and formatting --- lua/cosmic/lsp/providers/defaults.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/cosmic/lsp/providers/defaults.lua b/lua/cosmic/lsp/providers/defaults.lua index 337e0cd..c90a8f8 100644 --- a/lua/cosmic/lsp/providers/defaults.lua +++ b/lua/cosmic/lsp/providers/defaults.lua @@ -12,7 +12,7 @@ function M.on_attach(client, bufnr) -- Enable completion triggered by buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') - if client.server_capabilities.documentFormattingProvider then + if client.supports_method('textDocument/formatting') then -- set up :LspFormat for clients that are capable vim.cmd(string.format("command! LspFormat lua require('cosmic.lsp.utils').format(%s)", bufnr))