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 Dec 27, 2022
1 parent 79b3dec commit 0eff5ba
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 @@ -312,11 +312,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 0eff5ba

Please sign in to comment.