eclipse-lsp4j / lsp4j

A Java implementation of the language server protocol intended to be consumed by tools and language servers implemented in Java.
https://eclipse.org/lsp4j
Other
599 stars 143 forks source link

Void return types need to always be null value #728

Closed jonahgraham closed 1 year ago

jonahgraham commented 1 year ago

Void type in Java cannot be instantiated, therefore if a type is declared as Void the fromJson should always set that value to null.

If you want to have a generic return type that allows non-null and null results, use a type other than Void as the return type.

Fixes #721

jonahgraham commented 1 year ago

@mickaelistria @sebthom I would appreciate your input/review on this PR.

mickaelistria commented 1 year ago

I tried it with vscode-js-debug dapDebugAdapter and it now works (while previously I had to tweak the debug adapter).

jonahgraham commented 1 year ago

Thanks for the testing @mickaelistria - this will be included in the 0.21.0 release in a couple of weeks.

I will wait to give @sebthom a chance to review before I merge though.

sebthom commented 1 year ago

@jonahgraham could you provide an update site to try like last time? https://download.eclipse.org/lsp4j/builds/jonah/dap_return_void/

cdietrich commented 1 year ago

@eclipse-lsp4j-bot run tests

cdietrich commented 1 year ago

@jonahgraham as we dont build prs at https://ci.eclipse.org/lsp4j/job/lsp4j-multi-build/ anymore we dont seem to have easily consumable repos

jonahgraham commented 1 year ago

We never published PRs to download.eclipse.org as PRs could come from untrusted people. Only branches on this repo get to download.eclipse.org with lsp4j-multi-build/ - I am closing this PR in preference to #729 which should get a download soon.

Longer term we can add saving the artifacts to the github actions so it can be used in this way (PRs welcome on that!)