aboutsummaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-11-21 20:12:17 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2024-04-30 21:46:55 +0200
commite0a66ca4c541a72b24c6fb5ad9d55be79ce1bc93 (patch)
tree7ed308474577655466c5faa5c02871d902a5f7db /init.lua
parent93c83bacac840bca48237c77a9e9378edc71b818 (diff)
downloadvis-lspc-e0a66ca4c541a72b24c6fb5ad9d55be79ce1bc93.tar.gz
vis-lspc-e0a66ca4c541a72b24c6fb5ad9d55be79ce1bc93.zip
call the new hooks
The two new hooks allow to execute user code after certain events. They are called with the language server table as first argument. * initialized_hook is called after the initialized notification was sent. * file_open_hook is called after sending a textDocument/didOpen notification.
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index ee86489..015ae60 100644
--- a/init.lua
+++ b/init.lua
@@ -965,6 +965,11 @@ 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
+
-- According to nvim-lspconfig sendig the lsp server settings shortly after
-- initialization is a undocumented convention.
-- See https://github.com/neovim/nvim-lspconfig/blob/ed88435764d8b00442e66d39ec3d9c360e560783/CONTRIBUTING.md
@@ -1248,6 +1253,10 @@ 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
end
-- Initiate the shutdown of a language server