Open sdankel opened 1 year ago
I found a workaround for this particular example, but I still think this would be useful to have. Happy to submit a PR if you agree.
I think this might be useful in certain cases! Although this would technically make the server not compliant with the LSP specification, and so not a recommended practice, I don't see a reason to explicitly disallow this. I think the core design of the library would likely need to shift from the current LanguageServer
trait based design, though. Thanks for the suggestion! Also, I'm glad you managed to find a workaround for your specific use case in the meantime.
There are some cases where we want to implement features that are not yet added to the LSP spec. For example, for
hover
requests, some editors like VSCode support extraactions
in the hover docs.Unfortunately, it's not possible to just write a
custom_method
with the new response type. When I try this fortextDocument/hover
, I get:Even with the same method signature, I get this error. It seems to me that any custom methods should override the default error implementation, regardless of their method signature (or at least, regardless of the contents of the response type). This would give users a lot more control and flexibility with this framework.
Here's exactly what I'm trying to do:
@ebkalderon What do you think?