-
Notifications
You must be signed in to change notification settings - Fork 408
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
[Feature request] Add a codeAction
to generate the serialVersionUID field
#1892
Comments
A related issue - redhat-developer/vscode-java#401 |
Hi @mfussenegger , would you please take a look at that issue, it seems like already been implemented. Thank you. |
You should set the following JDT preference:
to <your_project>/.settings/org.eclipse.jdt.core.prefs See also Settings Global Preferences |
One improvement is to show this quick fix suggestion at the light bulb regardless of whether the "missingSerialVersion" flag is enabled or not. |
Hi @snjeza, Your solution on I have researched and found this redhat-developer/vscode-java#1939. I'm using:
The Would you please check if I doing some things wrong? Thank you so much. |
@baobaoit Could you try https://github.com/snjeza/vscode-test/raw/master/jdt-language-server-1.5.0-202109292033.tar.gz ? |
I have tried and the same result with the JDT.LS downloaded from your link: When open a class implements Serializable interface: This is when I put it in my project setting |
@baobaoit Could you try the following:
|
@snjeza I applied your patch and these are some test cases: Build jdt.ls with Java 11: ./mvnw clean verify -DskipTests Case 1: settings.prefs with Eclipse IDE export format Case 2: settings.prefs with JDT.LS format Updated (Sep 30, 2021 - 5:19 PM)I found this article https://dzone.com/articles/eclipse-global-preferences I follow it guide but still no hope. |
@mfussenegger Does nvim-jdtls support the java.settings.url preference? |
@snjeza today, I make it works with a little tweak like the picture below (includes your patch or without it): So this issue is resolved. I want to give to you huge respect. A ridiculous that, when I test in Lua demo the format: local settings = {
java = {
settings = {
url = "/path"
}
}
}
print(settings.java.settings.url)
-- Output: /path But with that format in local settings = {
["java.settings.url"] = "/path"
} |
That the nested setting definition doesn't work is odd. It works for all other settings I've tried so far. Is the |
Hi @mfussenegger, reference to my comment: #1892 (comment) The property local settings = {
["java.settings.url"] = "/path"
} It doesn't work with this format, although other settings work with this format: local settings = {
java = {
settings = {
url = "/path"
}
}
} Would you please check this, thank you. |
Excuse me, can this preference or |
If you mean as an environment variable or system property, we don't do this since the purpose of the language server protocol is to set it via |
Problem Statement
As the Eclipse IDE:
Which class
implements
theSerializable
, we need to put a field:private static final long serialVersionUID = X;
.Where
X
is a number typelong
be generated by the toolserialver
of Java.Ideas or possible solutions
Reference: Java – How to generate serialVersionUID
Conclusion
Thank you for the hard-working to make this LS for Java, I really appreciate it.
The text was updated successfully, but these errors were encountered: