diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2024-04-30 22:32:02 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2024-04-30 22:32:02 +0200 |
| commit | 05feb47b380d38d20af824ede7b43d0e2d1f9ecb (patch) | |
| tree | 0ea013d13d90b28455c8c940f89f4bb68bd78c76 /init.lua | |
| parent | e505535d40d44a0bda341b37a5611663ef9815fe (diff) | |
| download | vis-lspc-05feb47b380d38d20af824ede7b43d0e2d1f9ecb.tar.gz vis-lspc-05feb47b380d38d20af824ede7b43d0e2d1f9ecb.zip | |
use vis' event system instead of custom language server hooks
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 12 |
1 files changed, 2 insertions, 10 deletions
@@ -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 |
