aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2021-08-12 22:36:23 +0200
committerWilliam Boman <william@redwill.se>2021-08-12 22:40:24 +0200
commit86423357aecf77069e5544ce613dbe0925cabce4 (patch)
treee362c62e54be5fc864bee3a60d911306f1d56f89 /lua/nvim-lsp-installer.lua
parentuse vim.notify (diff)
downloadmason-86423357aecf77069e5544ce613dbe0925cabce4.tar
mason-86423357aecf77069e5544ce613dbe0925cabce4.tar.gz
mason-86423357aecf77069e5544ce613dbe0925cabce4.tar.bz2
mason-86423357aecf77069e5544ce613dbe0925cabce4.tar.lz
mason-86423357aecf77069e5544ce613dbe0925cabce4.tar.xz
mason-86423357aecf77069e5544ce613dbe0925cabce4.tar.zst
mason-86423357aecf77069e5544ce613dbe0925cabce4.zip
vim.notify: provide extra options for better interop with nvim-notify
Diffstat (limited to 'lua/nvim-lsp-installer.lua')
-rw-r--r--lua/nvim-lsp-installer.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/lua/nvim-lsp-installer.lua b/lua/nvim-lsp-installer.lua
index 96e53fa9..a9ed77f2 100644
--- a/lua/nvim-lsp-installer.lua
+++ b/lua/nvim-lsp-installer.lua
@@ -1,3 +1,5 @@
+local notify = require("nvim-lsp-installer.notify")
+
local M = {}
-- :'<,'>!sort | column -t
@@ -78,26 +80,26 @@ end
function M.install(server_name)
local ok, server = M.get_server(server_name)
if not ok then
- return vim.notify(("Unable to find LSP server %s. Error=%s"):format(server_name, server), vim.log.levels.ERROR)
+ return notify(("Unable to find LSP server %s. Error=%s"):format(server_name, server), vim.log.levels.ERROR)
end
local success, error = pcall(server.install, server)
if not success then
pcall(server.uninstall, server)
- return vim.notify(("Failed to install %s. Error=%s"):format(server_name, vim.inspect(error)), vim.log.levels.ERROR)
+ return notify(("Failed to install %s. Error=%s"):format(server_name, vim.inspect(error)), vim.log.levels.ERROR)
end
end
function M.uninstall(server_name)
local ok, server = M.get_server(server_name)
if not ok then
- return vim.notify(("Unable to find LSP server %s. Error=%s"):format(server_name, server), vim.log.levels.ERROR)
+ return notify(("Unable to find LSP server %s. Error=%s"):format(server_name, server), vim.log.levels.ERROR)
end
local success, error = pcall(server.uninstall, server)
if not success then
- vim.notify(("Unable to uninstall %s. Error=%s"):format(server_name, vim.inspect(error)), vim.log.levels.ERROR)
+ notify(("Unable to uninstall %s. Error=%s"):format(server_name, vim.inspect(error)), vim.log.levels.ERROR)
return success
end
- vim.notify(("Successfully uninstalled %s"):format(server_name))
+ notify(("Successfully uninstalled %s"):format(server_name))
end
return M