haskell / lsp

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

Get rid of 'CustomMethod' #592

Open michaelpj opened 2 weeks ago

michaelpj commented 2 weeks ago

CustomMethod is a bit of a hack to squeeze in an open set of additional methods into our otherwise closed set of methods. It adds a lot of difficulty for this reason: it's not typed in the same way, it can be used as anything, and it generally prevents us from doing anything that relies on knowing all the methods.

I think it would be better to rather also expose an untyped interface to the JSONRPC server. That is, be able to say something like:

addRequestHandler SMethod_TextDocumentCompletion $ \typedParams -> ...
Untyped.addRequestHandler "myMethod" $ \untypedParams -> ...