Skip to content

Commit

Permalink
feat(lsp): use snacks notifier for lsp progress
Browse files Browse the repository at this point in the history
  • Loading branch information
pwnwriter committed Dec 19, 2024
1 parent eb2e9cb commit 46d7e1c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
35 changes: 24 additions & 11 deletions lua/modules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,29 @@ function M.toggle_flow()
end

-- Autocommands
function M.autocmds()
local autocmd = vim.api.nvim_create_autocmd
vim.b.miniindentscope_disable = true
autocmd("FileType", {
pattern = "help",
desc = "Disable 'mini.indentscope' help page",
callback = function(data)
vim.b[data.buf].miniindentscope_disable = true
end
})
end
local autocmd = vim.api.nvim_create_autocmd
vim.b.miniindentscope_disable = true
autocmd("FileType", {
pattern = "help",
desc = "Disable 'mini.indentscope' help page",
callback = function(data)
vim.b[data.buf].miniindentscope_disable = true
end
})

autocmd("LspProgress", {
---@param ev {data: {client_id: integer, params: lsp.ProgressParams}}
callback = function(ev)
local spinner = { "", "", "", "", "", "", "", "", "", "" }
vim.notify(vim.lsp.status(), "info", {
id = "lsp_progress",
title = "LSP Progress",
opts = function(notif)
notif.icon = ev.data.params.value.kind == "end" and ""
or spinner[math.floor(vim.uv.hrtime() / (1e6 * 80)) % #spinner + 1]
end,
})
end,
})

return M
1 change: 0 additions & 1 deletion lua/plugins/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ local plugins = {
require("opts").final()
require("mappings").general()
require("mappings").misc()
require("modules").autocmds()
end,
},

Expand Down

0 comments on commit 46d7e1c

Please sign in to comment.