haskell / lsp

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

Separate lens module, Have ResponseErrors also take LSPResponseErrors, and standardize SemanticToken fields #480

Closed joyfulmantis closed 1 year ago

joyfulmantis commented 1 year ago

This pull request includes three separate changes. The first is to separate the lens module into a separate exported module. Currently, this only includes the lens for the generated modules. The second change is to allow (T)ResponseErrors to take both a ResponseError and a LSPResponseError. To do this I used custom fromJSON code that will first convert the JSON to a ResponseError and then convert any CustomResponseError results to corresponding LSPResponseError types. Finally, I standardized the fields for SemanticToken.

joyfulmantis commented 1 year ago

The last commit was to unify both the generated and custom lens classes, so now there are no namespace clashes between them and they are all exported from the same module.