Skip to content

Commit

Permalink
refactor: start using get_active_clients
Browse files Browse the repository at this point in the history
  • Loading branch information
ckipp01 committed Jan 3, 2023
1 parent abdf67b commit 2e9b104
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lua/metals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,10 @@ end
local function get_metals_and_stop()
for _, buf in pairs(fn.getbufinfo({ bufloaded = true })) do
if vim.tbl_contains(conf.scala_file_types, api.nvim_buf_get_option(buf.bufnr, "filetype")) then
local clients = lsp.buf_get_clients(buf.bufnr)
local clients = lsp.get_active_clients({ buffer = buf.bufnr, name = "metals" })
for _, client in ipairs(clients) do
if client.config.name == "metals" then
client.stop()
end
vim.notify("Found and stopping")
client.stop()
end
end
end
Expand Down

0 comments on commit 2e9b104

Please sign in to comment.