@@ -36,7 +36,7 @@ function M.open_floating_window(buf)
3636 col = 0 ,
3737 minwidth = width ,
3838 minheight = height ,
39- border = {} ,
39+ border = false ,
4040 padding = { 2 , 2 , 2 , 2 },
4141 zindex = 10 ,
4242 })
@@ -218,7 +218,33 @@ local function install_elixir_ls(opts)
218218 Compile .compile (
219219 download_dir :joinpath (source_path ):absolute (),
220220 opts .install_path :absolute (),
221- vim .tbl_extend (" force" , opts , { bufnr = bufnr })
221+ vim .tbl_extend (" force" , opts , {
222+ bufnr = bufnr ,
223+ on_exit = function (_ , compile_code )
224+ if compile_code == 0 then
225+ if bufnr then
226+ vim .api .nvim_buf_call (bufnr , function ()
227+ vim .api .nvim_command (" quit" )
228+ end )
229+ end
230+
231+ vim .notify (" Finished compiling ElixirLS!" )
232+ vim .notify (" Reloading buffer" )
233+ vim .api .nvim_command (" edit" )
234+ vim .notify (" Restarting LSP client" )
235+ vim .api .nvim_command (" LspRestart" )
236+ vim .fn .jobstart ({ " rm" , " -rf" , download_dir :absolute () }, {
237+ on_exit = vim .schedule_wrap (function (_ , rm_code )
238+ if rm_code == 0 then
239+ vim .notify (" Cleaned up elixir.nvim download directory" )
240+ else
241+ vim .api .nvim_err_writeln (" Failed to clean up elixir.nivm download directory" )
242+ end
243+ end ),
244+ })
245+ end
246+ end ,
247+ })
222248 )
223249end
224250
0 commit comments