type family ServerCapability (m :: Method f t) :: Type
type family ClientCapability (m :: Method f t) :: Type
-- I don't think we can have anything stronger than a Traversal here, since it might be missing and it might be within several nested Maybes, which means we can't get a Prism, I think
serverCapability :: SMethod m -> Traversal' ServerCapabilities (ServerCapability m)
clientCapability :: SMethod m -> Traversal' ClientCapabilities (ClientCapability m)
Sadly I think we need to do this by hand.
Other things to thing about:
Often a bunch of methods are associated with the same capability, but there is one "main" one. Should we just associate them all with the capability. (I think yes)
Sometimes some methods are associated with a subset of the capability, e.g. there is a CompletionOptions.resolveSupport field, so we could say that the capability for completionItemResolve is Bool and have it pick out that boolean field; or we could just say it's the whole capability and let the user pick out the relevant bit. (I think just pick the whole capability)
It would be nice to have something like this:
Sadly I think we need to do this by hand.
Other things to thing about:
CompletionOptions.resolveSupport
field, so we could say that the capability forcompletionItemResolve
isBool
and have it pick out that boolean field; or we could just say it's the whole capability and let the user pick out the relevant bit. (I think just pick the whole capability)