haskell / lsp

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

Handle clients sending "null" instead of a missing field #543

Closed michaelpj closed 5 months ago

michaelpj commented 5 months ago

This is a relatively common client error, so it's nice of us to follow the principle of robustness and accept it instead of failing.

It's a little bit complicated because in some case the optional field also has null as a valid value, so we have to make sure we parse that correctly. I added some more tests so I'm pretty confident it's okay, though.