Skip to content

Commit

Permalink
fix nits
Browse files Browse the repository at this point in the history
  • Loading branch information
borngraced committed Oct 16, 2024
1 parent 2803c7c commit 9dcaecb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/rustaceanvim/lsp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ end

---LSP restart ininer implementations
---@param bufnr? number
---@param set_target_callback? function(client) Optional callback to run for each client before restarting.
---@param callback? function(client) Optional callback to run for each client before restarting.
---@return number|nil client_id
local function restart(bufnr, set_target_callback)
local function restart(bufnr, callback)
bufnr = bufnr or vim.api.nvim_get_current_buf()
local clients = M.stop(bufnr)
local timer, _, _ = vim.uv.new_timer()
Expand All @@ -114,8 +114,8 @@ local function restart(bufnr, set_target_callback)
stopped_client_count = stopped_client_count + 1
vim.schedule(function()
-- Execute the callback, if provided, for additional actions before restarting
if set_target_callback then
set_target_callback(client)
if callback then
callback(client)
end
M.start(bufnr)
end)
Expand Down

0 comments on commit 9dcaecb

Please sign in to comment.