Skip to content

Commit

Permalink
Merge pull request #675 from ckipp01/activeClients
Browse files Browse the repository at this point in the history
fix: remove deprecated `find_active_client` calls
  • Loading branch information
ckipp01 authored May 24, 2024
2 parents 0ee2dc9 + 91944f7 commit db53eb0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lua/metals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lua/metals/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit db53eb0

Please sign in to comment.