diff options
| author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-10-11 22:03:16 +0200 |
|---|---|---|
| committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-10-11 22:03:16 +0200 |
| commit | df66b461596d351367f90d41a0fabffb873de4be (patch) | |
| tree | 711b15790bb97ba0bfa57e1e863fe9a521d55bec /.config/nvim/lua/lsp/utils.lua | |
| parent | 611b15e94dadc7351d5ff67f268791d5269ea112 (diff) | |
Merge updates from lunarvim
Diffstat (limited to '.config/nvim/lua/lsp/utils.lua')
| -rw-r--r-- | .config/nvim/lua/lsp/utils.lua | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/.config/nvim/lua/lsp/utils.lua b/.config/nvim/lua/lsp/utils.lua index e0046db..5900340 100644 --- a/.config/nvim/lua/lsp/utils.lua +++ b/.config/nvim/lua/lsp/utils.lua @@ -1,27 +1,15 @@ local M = {} +local tbl = require "utils.table" + function M.is_client_active(name) local clients = vim.lsp.get_active_clients() - for _, client in pairs(clients) do - if client.name == name then - return true, client - end - end - return false -end - -function M.disable_formatting_capability(client) - -- FIXME: figure out a reasonable way to do this - client.resolved_capabilities.document_formatting = false - require("core.log"):debug( - string.format( - "Turning off formatting capability for language server [%s] ", - client.name - ) - ) + return tbl.find_first(clients, function(client) + return client.name == name + end) end -function M.get_active_client_by_ft(filetype) +function M.get_active_clients_by_ft(filetype) local matches = {} local clients = vim.lsp.get_active_clients() for _, client in pairs(clients) do @@ -33,7 +21,7 @@ function M.get_active_client_by_ft(filetype) return matches end -function M.get_ls_capabilities(client_id) +function M.get_client_capabilities(client_id) if not client_id then local buf_clients = vim.lsp.buf_get_clients() for _, buf_client in ipairs(buf_clients) do |