From 05feb47b380d38d20af824ede7b43d0e2d1f9ecb Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 30 Apr 2024 22:32:02 +0200 Subject: use vis' event system instead of custom language server hooks --- init.lua | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 4f34741..95d280d 100644 --- a/init.lua +++ b/init.lua @@ -965,10 +965,7 @@ local function lspc_handle_initialize_response(ls, result) setmetatable(params, {__jsontype = 'object'}) ls_send_notification(ls, 'initialized', params) - if ls.initialized_hook then - lspc.log('executing initialize hook of ' .. ls.name) - ls:initialized_hook() - end + vis.events.emit(lspc.events.LS_INITIALIZED, ls) -- According to nvim-lspconfig sendig the lsp server settings shortly after -- initialization is a undocumented convention. @@ -978,8 +975,6 @@ local function lspc_handle_initialize_response(ls, result) settings = ls.settings, }) end - - vis.events.emit(lspc.events.LS_INITIALIZED, ls) end -- method response dispatcher @@ -1255,10 +1250,7 @@ local function lspc_open(ls, win, file) end) end - if ls.file_open_hook then - lspc.log('Executing file_open_hook of' .. ls.name .. ' and ' .. file.path) - ls:file_open_hook(file) - end + vis.events.emit(lspc.events.LS_DID_OPEN, ls) end -- Initiate the shutdown of a language server -- cgit v1.2.3