vscode-java
vscode-java copied to clipboard
Promote feature discovery of Source Action
Currently, the available source actions are in the editor context menu -> Source Action..., which is a little bit hard to be found. Will investigate a proper way to promote the feature discovery of source actions.
A way to expose source actions is to add them to "Show fixes" (looks like a bulb), like https://github.com/eclipse/eclipse.jdt.ls/pull/1405 did. In this way, I have created https://github.com/eclipse/eclipse.jdt.ls/pull/1842 for hashCode() and equals().
Source Assists:
| Source Action | Type Declaration | Field Declaration | Import Declaration | Method Declaration | multiple selection |
|---|---|---|---|---|---|
| Generate Constructors | ✔️ | ✔️ | ✅ | ||
| Organize Imports | ✔️ | ||||
| Generate Getters and Setters | ✔️ | ✔️ | ✅ | ||
| Generate Getters | ✔️ | ✔️ | ✅ | ||
| Generate Setters | ✔️ | ✔️ | ✅ | ||
| Override/Implement methods | ✔️ | ||||
| Generate hashCode() and equals() | ✔️ | ||||
| Generate toString() | ✔️ | ||||
| Generate Javadoc | ✅ | ✅ | ✅ | ||
| Change modifiers to final | ✅ | ✅ | ✅ | ✅ | |
| Generate Tests | ✔️ | WIP |
@CsCherrYY for getters/setters, besides field declaration, let's add one for class-level too for batch generation. Eg. a class has 5 fields, click on lightbulb to generate setters/getters all at once
@CsCherrYY per user feedback, we should consider adding constructors to class declaration as well
@CsCherrYY per user feedback, we should consider adding constructors to class declaration as well
I have added it to the plan table. Please see the first row.
@CsCherrYY per user feedback, we should consider adding constructors to class declaration as well
I have added it to the plan table. Please see the first row.
awesome!
Per survey feedback, "Attach Source" is another action user has requested
Per survey feedback, "Attach Source" is another action user has requested
@nickzhums this request seems related to Javadoc (linking existing source jar). let's track this in https://github.com/microsoft/vscode-java-pack/issues/1163