Pure-D / serve-d

D LSP server (dlang language server protocol server)
MIT License
195 stars 48 forks source link

serve-d is too strict in LSP enforcement (crashes) #369

Open gdamore opened 2 months ago

gdamore commented 2 months ago

(The other side of this was reported at https://github.com/zed-industries/zed/issues/11060 )

Serve-d crashes when it gets:

{"jsonrpc":"2.0","id":1,"result":null,"error":null}

Essentially according to Postel's Law, we should be a bit more tolerant of reasonable errors.

Clearly the above message can reasonably be interpreted as intended to be:

{"jsonrpc":"2.0","id":1,"result":null}

(Having a null value for "error" is nonsense per the spec, but having a null value is perfectly reasonable as a result from function that has nothing else to return back.)

gdamore commented 2 months ago

To be clear, I'm suggesting treating any message that contains an error value with "null" as if the error is not present at all.