You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some, but not all, of the server capability fields in the initialize response allow providing the corresponding registration options. It's helpful to be able to do so, since the registration options type usually includes additional fields, such as the documentSelector.
Examples:
completionProvider has type CompletionOptions and doesn't allow CompletionRegistrationOptions
typeDefinitionProvider has type TypeDefinitionOptions | TypeDefinitionRegistrationOptions
Is this just for backwards compatibility? Is there a way we could migrate the protocol to be more consistent here? It would make things simpler. For example, if you want to make use of the documentSelector capability, you can have many cases:
Yes, it is only for backwards compatibility. There could be old clients which don't support options. I tired to be consistent for all new requests I introduce.
The only solution that came to my mind when doing this was adding a client capability to inform the server. But it felt a little bit like overhead. If someone has an idea I am happy to look into this again.
Yes, I agree that you would probably need a capability (dynamicRegistrationDuringInitialize?). You can't just say the client can ignore the excess fields, since the server might prefer to dynamically register in order to make the settings have effect.
I agree it's some overhead, but it might be worth it. In particular, I don't know whether you have any plan to eventually mark some capability settings as deprecated, so as to push implementors towards the "recommended" way of doing things? If there's a path towards one day making the more sensible behaviour the default then it seems worth taking a step down that path.
Some, but not all, of the server capability fields in the
initialize
response allow providing the corresponding registration options. It's helpful to be able to do so, since the registration options type usually includes additional fields, such as thedocumentSelector
.Examples:
completionProvider
has typeCompletionOptions
and doesn't allowCompletionRegistrationOptions
typeDefinitionProvider
has typeTypeDefinitionOptions | TypeDefinitionRegistrationOptions
Is this just for backwards compatibility? Is there a way we could migrate the protocol to be more consistent here? It would make things simpler. For example, if you want to make use of the
documentSelector
capability, you can have many cases:It's quite fiddly.
The text was updated successfully, but these errors were encountered: