0.28.8: malformed JSON response to `initialize` message
See original GitHub issueUsing 0.28.8, the JSON that comes back from an initialize
message looks like this:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"capabilities": {
"textDocumentSync": {
"openClose": true,
"change": 2,
"willSave": false,
"willSaveWaitUntil": false,
"save": true
},
"completionProvider": {
"triggerCharacters": [
".",
"'",
"\""
],
"resolveProvider": true
},
"hoverProvider": true,
"signatureHelpProvider": {
"triggerCharacters": [
"(",
","
]
},
"declarationProvider": null,
"definitionProvider": true,
"typeDefinitionProvider": null,
"implementationProvider": null,
"referencesProvider": true,
"documentHighlightProvider": true,
"documentSymbolProvider": true,
"codeActionProvider": {
"codeActionKinds": [
"refactor.inline",
"refactor.extract"
]
},
"codeLensProvider": null,
"documentLinkProvider": null,
"colorProvider": null,
"documentFormattingProvider": null,
"documentRangeFormattingProvider": null,
"documentOnTypeFormattingProvider": null,
"renameProvider": true,
"foldingRangeProvider": null,
"executeCommandProvider": {
"commands": []
},
"selectionRangeProvider": null,
"workspaceSymbolProvider": true,
"workspace": {
"workspaceFolders": {
"supported": true,
"changeNotifications": true
}
}
}
}
}
The null
values for declarationProvider
and others aren’t correct. According to the spec, those values should be true
or false
, and null
isn’t translatable to a Boolean.
Because those keys are optional, it may be better to omit them entirely rather than reporting null
; but if that’s not an option, false
is probably a better choice.
This appears to be a regression from previous versions, which omitted those keys.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Receiving a Malformed JSON Error When Using API Doc
Cause. The malformed JSON error means that the format of the API call is incorrect.
Read more >Convert invalid json into valid json - Stack Overflow
(This script only works with the invalid JSON described above, otherwise the pattern has to be changed.) === UPDATE === $sInvalidJson = '{preOpen:"900",preClose ......
Read more >Malformed JSON Message | Imperva
Malformed JSON alerts may indicate manual intervention in the request. Most applications and valid communication generate valid JSON text. Thus an occurrence of ......
Read more >Error: Malformed JSON: Expected '{' at the beginning of object
Error: Malformed JSON: Expected '{' at the beginning of object. Any idea to resolve this issue?
Read more >JSON::Parse - Parse JSON - metacpan.org
A function "read_json" reads JSON from a file, and there is a safer version of "parse_json" called "parse_json_safe" which doesn't throw exceptions. For...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
pygls fix is now released in their 0.10.3
@pappasam Yes! It appears to be resolved; I’m not seeing any
null
values coming back.