Closed alcarney closed 2 years ago
Aha. I agree, exclude_none
was an overshoot, because there are times when you do explicitly want to set a value to None
.
In that case I think that we're going to want to come full circle and
exclude_unset=True
during serialization(where that latter bit of code says: if a field has a default that is not None
, then act as if we set it explicitly. This has the effect that not-None
defaults are serialized even though exclude_unset=True
is set)
@alcarney perhaps you'd like to submit an MR along those lines
Sure I'll take a look :)
Unfortunately, it looks like #236 breaks
shutdown
requests.I have a command in Esbonio's VSCode extension that restarts the language server which sends a
shutdown
request to the server resulting in the following errorWith VSCode's devtools open I can see the response received from the server and the
result
field is in fact missing.Changing
exclude_none
back toexclude_unset
fixes this issue.I'm not entirely sure what to suggest as a fix as while I didn't follow the discussion around #236 that closely I'm aware it was to resolve some other issues.
Edit: Actually it looks like this is an issue for any request where
"result": null
is a valid response which includes completions, goto definition and others