-
Notifications
You must be signed in to change notification settings - Fork 148
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
Invalid generation of @JsonRpcData when using lsp4j 0.21 and xtend 2.31.0 #742
Comments
how does your manifest look like? package import (org.eclipse.lsp4j.util)? require bundle? |
(The example project is joined if you want to try) this is using require bundle |
you dont have a dependency to lsp4j itself? is this intentional? @jonahgraham maybe we should move the ToStringBuilder class to jsonrpc module? the problem is this is not a runtime dependency |
I mainly need to use the same approach as lsp4j in order to generate similar protocols. JSONRPC based but neither DAP nor LSP. (your jsonrpc lib is cool ;-) ) I added several of the other bundles in the dependencies, without better result on this example. |
simply copy the ToStringBuilder class to xxx.util package |
Thanks, it works I'll update my projects with that |
BTW, I second your proposal about moving the ToStringBuilder class since I haven't seen any differences between |
yes it is the same, but we dont have a util place that is available from both |
Yes that makes sense. The generator makes code that works with jsonrpc, so having the ToStringBuilder in (e.g.) new
Sorry, I don't know what you mean here? Does this mean that |
@jonahgraham no its not a (runtime) dependency of org.eclipse.lsp4j itself. so it wont work at runtime |
* use xtend 2.27 in order to compile with java 17 * use tycho 3.0.4 * adapt pom form tycho 3.0.4 * enforce java 17 * pomfirst use xtend 2.31 * add ToStringBuilder required by lsp4j 0.21 cf. eclipse-lsp4j/lsp4j#742 * use lsp4j 0.21 * use newer version of the MergeableManifest from xtext
When the dependency on xbase.lib was removed in #529 it put the implicit requirement that there is a class called ToStringBuilder in a sub-package of the xtend class called `util`. This change provides the ToStringBuilder in an util package in the org.eclipse.lsp4j.jsonrpc bundle so that consumers of LSP4J do not need to copy ToStringBuilder into their own source code. Fixes #742
The same problem occurs with the less often used reference to Preconditions. |
Looks like it would make sense to handle it in the same way, after #798 is merged. |
When the dependency on xbase.lib was removed in eclipse-lsp4j#529 it put the implicit requirement that there is a class called ToStringBuilder in a sub-package of the xtend class called `util`. This change provides the ToStringBuilder in an util package in the org.eclipse.lsp4j.jsonrpc bundle so that consumers of LSP4J do not need to copy ToStringBuilder into their own source code. Fixes eclipse-lsp4j#742
When the dependency on xbase.lib was removed in #529 it put the implicit requirement that there is a class called ToStringBuilder in a sub-package of the xtend class called `util`. This change provides the ToStringBuilder in an util package in the org.eclipse.lsp4j.jsonrpc bundle so that consumers of LSP4J do not need to copy ToStringBuilder into their own source code. Fixes #742
When the dependency on xbase.lib was removed in #529 it put the implicit requirement that there is a class called ToStringBuilder in a sub-package of the xtend class called `util`. This change provides the ToStringBuilder in an util package in the org.eclipse.lsp4j.jsonrpc bundle so that consumers of LSP4J do not need to copy ToStringBuilder into their own source code. Fixes #742
This change provides the Preconditions in an util package in the org.eclipse.lsp4j.jsonrpc bundle so that consumers of LSP4J do not need to copy Preconditions into their own source code. Related to #742
When installing lsp4j and xtend from the current Eclipse release update site (2023-06) It installs lspj4 0.21.0 and xtend 2.31.0
(I started from Eclipse Modeling 2023-06 and then installed lsp4j using the updatesite https://download.eclipse.org/releases/2023-06/ )
A simple project using @JsonRpcData from lsp4j.generator will now fail. The generated java class is incorrect. (the toString
will generate a code that doesn't compile
![image](https://private-user-images.githubusercontent.com/661468/246757060-2a077e84-215c-4e4f-9e80-74098a11c19e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4MjQ4MTEsIm5iZiI6MTczOTgyNDUxMSwicGF0aCI6Ii82NjE0NjgvMjQ2NzU3MDYwLTJhMDc3ZTg0LTIxNWMtNGU0Zi05ZTgwLTc0MDk4YTExYzE5ZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxN1QyMDM1MTFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04ZTAyYmRhYjFkZmIxZmFhZDJkMzIyN2ZjNGQwMzgzMjlkNDdjNTE2NmQ5YjViMDEwNDZjNGE2NTc2ZWQxNGY5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.pPlVVsNUp4FW47uwN90hEleurLYDC8RrCKEVlvNxpOU)
An equivalent code was working in the previous release I tried (xtend 2.25.0 + lsp4j 0.14.0) (I haven't tried yet to find the exact last working version ...)
project showing the issue joined
bug_lsp4j_xtend_2023-06.zip
The text was updated successfully, but these errors were encountered: