haskell / lsp

Haskell library for the Microsoft Language Server Protocol
359 stars 89 forks source link

Add mappings to capabilities for methods #580

Closed michaelpj closed 1 month ago

michaelpj commented 1 month ago

It would be nice to have something like this:

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: