You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error on hover: lllegal argument, contents must be defined #214
at new e (/usr/share/code-insiders/resources/app/out/vs/workbench/node/extensionHostProcess.js:4:227228)
at asHover (/home/aeschli/.vscode-insiders/extensions/redhat.java-0.4.0/node_modules/vscode-languageclient/lib/protocolConverter.js:63:16)
e.onUnexpectedError @ workbench.main.js:29
The problem seems to be that the hover object sent across the line doesn't contain a 'contents' field.
I think it's a bug on the Java language server side. If a location doesn't have any hover to show, send 'null' as result, not a hover without contents.
@aeschli it's actually VS Code that doesn't like null results:
[Error - 10:49:50 AM] Request textDocument/hover failed.
Error: The received response has neither a result nor an error property.
at handleInvalidMessage (/Users/fbricon/Dev/projects/vscode-java/node_modules/vscode-jsonrpc/lib/main.js:381:40)
at StreamMessageReader.callback (/Users/fbricon/Dev/projects/vscode-java/node_modules/vscode-jsonrpc/lib/main.js:492:13)
at StreamMessageReader.onData (/Users/fbricon/Dev/projects/vscode-java/node_modules/vscode-jsonrpc/lib/messageReader.js:199:18)
at Socket.<anonymous> (/Users/fbricon/Dev/projects/vscode-java/node_modules/vscode-jsonrpc/lib/messageReader.js:166:19)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at Pipe.onread (net.js:551:20)
Yes, it can be discussed where the bug is. From how I understand the spec, 'contents' is a required field for hover.
That said, I created microsoft/vscode-languageserver-node#207 to be tolerant in the language client.
Activity
[-]llegal argument, contents must be defined[/-][+]Error on hover: lllegal argument, contents must be defined[/+]fbricon commentedon May 16, 2017
You created the project before or after opening vscode?
aeschli commentedon May 16, 2017
I created it while it was open, but in the meantime also started VSCode again on the project.
aeschli commentedon May 16, 2017
I think it's a bug on the Java language server side. If a location doesn't have any hover to show, send 'null' as result, not a hover without contents.
fbricon commentedon May 16, 2017
Ok I can reproduce the issue.
I think we send a non null Hover because lsp4j would crap out otherwise, but I need to check
fbricon commentedon May 16, 2017
@aeschli it's actually VS Code that doesn't like null results:
aeschli commentedon May 16, 2017
Yes, it can be discussed where the bug is. From how I understand the spec, 'contents' is a required field for hover.
That said, I created microsoft/vscode-languageserver-node#207 to be tolerant in the language client.
aeschli commentedon May 16, 2017
#214 (comment)
I guess you didn't pass in a result at all. The code there checks for undefined. I think it should be at least 'null'.
fbricon commentedon May 16, 2017
Yes it was when I sent a null Hover result instead of an Hover result with null content (your initial report)
Don't send hover with null content
Don't send hover with null content