Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle methods with Void return types properly #675

Merged
merged 1 commit into from Oct 20, 2022

Conversation

jonahgraham
Copy link
Contributor

The DAP part of LSP4J was being too strict and failing to parse response objects for methods with Void return type. With Java 17 (or some version since Java 11) turning on more strict reflection rules, the "An illegal reflective access operation has occurred" that used to be a warning is now an exception like "Failed making constructor 'java.lang.Void#Void()' accessible"

This change makes the code work and compatible with how LSP4J handles LSP Void return types.

Fixes #674

The DAP part of LSP4J was being too strict and failing to parse
response objects for methods with Void return type. With
Java 17 (or some version since Java 11) turning on more strict
reflection rules, the "An illegal reflective access operation
has occurred" that used to be a warning is now an exception
like "Failed making constructor 'java.lang.Void#Void()' accessible"

This change makes the code work and compatible with how LSP4J
handles LSP Void return types.

Fixes #674
@jonahgraham jonahgraham added this to the 0.18.0 milestone Oct 18, 2022
@jonahgraham
Copy link
Contributor Author

@sebthom it would be very helpful if you can test your failing case in #674 with this fix. You can pick up a p2 repo here: https://download.eclipse.org/lsp4j/builds/jonah/dap_return_void/

@sebthom
Copy link
Contributor

sebthom commented Oct 20, 2022

I somehow cannot use the update site, I am getting:
image

I get the same error if I try to use https://download.eclipse.org/lsp4j/updates/releases/0.17.0/ instead of https://download.eclipse.org/lsp4j/updates/releases/0.16.0/

Apparently as of lsp4j 0.17.0 the org.eclipse.xtext.xbase.lib plugin is not part of the update site anymore. Is that on purpose?

@cdietrich
Copy link
Contributor

We do not package it
https://github.com/eclipse/lsp4j/blob/main/releng/p2/category.xml
you can consume it from the 2022-09
Or the Xtext 2.28 update site

https://download.eclipse.org/modeling/tmf/xtext/updates/releases/2.28.0/

@sebthom
Copy link
Contributor

sebthom commented Oct 20, 2022

That's odd, I am seeing this:
image

Maybe it's a UI bug in the Target Editor.

@cdietrich
Copy link
Contributor

There was some back and forth in tycho how to deal with imports , maybe thus it got packaged in 15

@sebthom
Copy link
Contributor

sebthom commented Oct 20, 2022

@cdietrich I added the xtext update site and now it works. thanks!

@jonahgraham I can confirm, that the change of this PR works as expected. Thanks for the quick resolution!

@jonahgraham jonahgraham merged commit a8153a4 into main Oct 20, 2022
@jonahgraham jonahgraham deleted the jonah/dap_return_void branch October 20, 2022 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JsonIOException when trying to launch debug session
3 participants