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
Bug: Source Action -> "Generate Constructors..." only available after at least one class member was added #1352
Hi Eduard Gopp (@Eden33), I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.
It looks like the JDT LS only offers “Generate Constructors…” when there are fields to initialize—because an empty (no-arg) constructor is implicit, the action isn’t shown for a totally empty class.
The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!
Thanks for reporting the missing Generate Constructors… action on an empty class. We didn’t find a matching duplicate.
The Java Pack bundles the Java language support that provides this source action; the Pack does not declare the action itself. A likely explanation is that Java already gives an empty class an implicit no-argument constructor, so—with no fields or explicit superclass-constructor choices—the generator has nothing to select. We have not confirmed that rationale in the upstream implementation.
As a workaround, you can add the explicit constructor manually, for example:
publicMyClass() {
super();
}
Because the reported VS Code and extension versions are older, could you retest with current VS Code and redhat.java? If it still occurs, please share the smallest class that reproduces it and the exact current extension versions.
Activity
github-actions commentedon Nov 4, 2025
Hi Eduard Gopp (@Eden33), I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.
It looks like the JDT LS only offers “Generate Constructors…” when there are fields to initialize—because an empty (no-arg) constructor is implicit, the action isn’t shown for a totally empty class.
Workarounds & suggestions:
https://github.com/eclipse/eclipse.jdt.ls/issues/new?template=feature_request.md
Other references worth checking:
Other references with low confidence
Add "Generate constructor" option in "Show Fixes" options for fields
Discusses surfacing the Generate Constructors action in the general code-action menu: Add "Generate constructor" option in "Show Fixes" options for fields redhat-developer/vscode-java#1358
Duplicate code actions (but with different kind)
Mentions how code-actions are filtered and surfaced by kind—might be informative for how actions appear/disappear: Duplicate code actions (but with different kind) eclipse-jdtls/eclipse.jdt.ls#2177
The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!
issuelens commentedon Nov 26, 2026
Thanks for reporting the missing Generate Constructors… action on an empty class. We didn’t find a matching duplicate.
The Java Pack bundles the Java language support that provides this source action; the Pack does not declare the action itself. A likely explanation is that Java already gives an empty class an implicit no-argument constructor, so—with no fields or explicit superclass-constructor choices—the generator has nothing to select. We have not confirmed that rationale in the upstream implementation.
As a workaround, you can add the explicit constructor manually, for example:
Because the reported VS Code and extension versions are older, could you retest with current VS Code and
redhat.java? If it still occurs, please share the smallest class that reproduces it and the exact current extension versions.