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 --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 994eb13..0f43711 100644 --- a/README.md +++ b/README.md @@ -161,8 +161,6 @@ Additional fields are: * `settings` - a table of arbitrary possibly nested data. It is sent in a `workspace/didChangeConfiguration` to the language server after initialization. It is also used to lookup configuration for the `workspace/configuratio` method call. * `init_options` - table of arbitrary possibly nested data. It will be sent to the server as `initializationOptions` in the parameters of the `initialize` method call. * `formatting_options` - table of configuration data as found in [the LSP specification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_formatting). `tabSize` and `insertSpaces` are required. -* `initialized_hook` - function called after sending the `initialized` notification. The first parameter is the language server. -* `file_open_hook` - function called after sending the `textDocument/didOpen` notification. The first parameter is the language server. **Example:** The language server configuration entry in the `ls_map` for `lua-language-server` @@ -179,6 +177,15 @@ ls_map.lua = { Language servers configured in `vis-lspc` can be found in `supported_servers.lua`. +### Events + +vis-lspc extends vis' event system with its own set of events: + +* `lspc.event.LS_INITIALIZED` - emitted after sending the `initialized` notification +* `lspc.event.LS_DID_OPEN` - emitted after sending the `textDocument/didOpen` notification + +All events receive the language server as first argument. + ### Extensibility The returned module table also includes functions you can use in your own `vis` -- cgit v1.2.3