Replies: 3 comments 1 reply
-
See #230 for a more extreme idea inspired by this question. |
Beta Was this translation helpful? Give feedback.
-
This seems like a good idea. Took me a good 30 minutes to wrap my head around dynamic registration. Just so we're on the same page, can you give me an example of a use case for this? Further, what parts of the none-ls codebase would have to change? I'm guessing we have some real-world servers we could parrot the dynamic code from? |
Beta Was this translation helpful? Give feedback.
-
Caveat: I'm not entirely sure I have my head wrapped around what none-ls is doing, but I believe the idea is for it to only advertise itself as capable of certain things (formatting, for example), if there's a none-ls builtin enabled that knows how to format the given file. |
Beta Was this translation helpful? Give feedback.
-
See
none-ls.nvim/lua/null-ls/client.lua
Lines 78 to 84 in caf8556
IIUC, we're monkeypatching
supports_method
so we can dynamically respond to capabilities (as documented here). This works, but feels brittle to me (we recently had to change this to a class method).It seems to me that we could we rid of this monkeypatching if we instead leveraged LSP's support for dynamic capabilities. See:
Perhaps we aren't doing that just because none-ls predates this functionality? Is there some other reason not to use this?
Beta Was this translation helpful? Give feedback.
All reactions