-
Notifications
You must be signed in to change notification settings - Fork 19
Ability to use vim.lsp.handlers
for invokation
#16
Comments
Hey. If you have some additional arguments/opinions I would love to hear them. |
What's the issue? It's fine for plugins to call their own request/pass their own handler. |
I think in first place because there can be only one handler. Plugins started to just set a handler, making them incompatible with other plugins, breaking configs etc. pp. |
This makes sense, because the handler is supposed to be the default interaction for a given request/response pair. I'm not sure the scenario in which it makes sense for multiple plugins to control the response. Users are also free to wrap handlers with whatever dispatch logic then way (handlers could forward arguments to other handlers based on anything passed in ctx.
I don't agree with this, I'm not sure in what situations it makes sense for a user to use multiple plugins for the same handler. |
I do really think this is not the place to discuss it. So finally just as an example: diagnostics - do virtual text, do signs, publish location list, status list update, ... This code here: After all I'm fine with it. It is a valid approach and you have arguments for it. And I think for most events this is fine. All good. And if the feature here is desired by multiple users I can restructure some code to make it work within this plugin. I'm also totally fine to accept PRs for it. After all I regret to have published this plugin in the state it is. As my post on Reddit stated it wasn't ready. It probably requires major refactoring. Especially to work with other LSP clients despite the inbuild one. And ofc the diff generation is a nightmare. The code here is not high quality. And it bugs me. Though I struggle to find the time working on it. |
Just as an aside, I'm taken aback by how little there are of publicly re-usable functions for basic tasks for extending LSP behavior. Just in the case of populating a |
I don't use or work on neovim anymore, but it was always the plan to gradually expose internal functions that were required for plugin developers, or alternatively, improve the existing publicly available apis (like we did via the introduction of vim.ui.select) to allow better composition of plugins, and decrease the boiler plate required where applicable. Marking functions private was done because there was a trend of plugins (especially lsp-saga) using functions that were supposed to be internal without communicating that there was a need for a publicly available api, which meant that when we wanted to do any large internal refactors I had to do a multi-week coordination with various plugin authors and still would end up breaking XYZ workflow. |
Is there a reason that this plugin doesn't provide a handler for registration with
vim.lsp.handlers['textDocument/codeAction']
?An example of a plugin that provides this is nvim-lsputils.
The text was updated successfully, but these errors were encountered: