diff --git a/lua/metals.lua b/lua/metals.lua index 857dd21..62b0903 100644 --- a/lua/metals.lua +++ b/lua/metals.lua @@ -306,7 +306,7 @@ M.find_in_dependency_jars = function() end M.organize_imports = function() - local lsp_clients = lsp.get_active_clients({ bufnr = 0, name = "metals" }) + local lsp_clients = lsp.get_clients({ bufnr = 0, name = "metals" }) if not lsp_clients or vim.tbl_isempty(lsp_clients) then log.warn_and_show("Metals is not attatched to this buffer, so unable to organize imports.") return @@ -335,7 +335,7 @@ end M.restart_metals = function() for _, buf in pairs(fn.getbufinfo({ bufloaded = true })) do if vim.tbl_contains(conf.scala_file_types, api.nvim_get_option_value("filetype", { buf = buf.bufnr })) then - local clients = lsp.get_active_clients({ buffer = buf.bufnr, name = "metals" }) + local clients = lsp.get_clients({ buffer = buf.bufnr, name = "metals" }) for _, client in ipairs(clients) do client.stop() end diff --git a/lua/metals/util.lua b/lua/metals/util.lua index 180dbbe..cd8194c 100644 --- a/lua/metals/util.lua +++ b/lua/metals/util.lua @@ -105,7 +105,7 @@ M.find_metals_buffer = function() for _, buf in pairs(bufs) do if api.nvim_buf_is_loaded(buf) then - local buf_clients = vim.lsp.get_active_clients({ buffer = buf, name = "metals" }) + local buf_clients = vim.lsp.get_clients({ buffer = buf, name = "metals" }) if #buf_clients > 0 then metals_buf = buf break