Add 'hashCode()' and 'equals()' to Show Fixes for type declaration#1842
Conversation
| return JDTUtils.resolveCompilationUnit(params.getTextDocument().getUri()); | ||
| } | ||
|
|
||
| public static Optional<Either<Command, CodeAction>> copySourceActionCommand(Optional<Either<Command, CodeAction>> sourceActionCommand) { |
There was a problem hiding this comment.
Since this utility is not for source action only, i would use a more generic method name such as
public static Optional<Either<Command, CodeAction>> copyCodeActionCommand(Optional<Either<Command, CodeAction>> codeActionCommand)There was a problem hiding this comment.
According to #1842 (comment), I'd like to remove this method since currently we don't need it.
| if (node instanceof SimpleName) { | ||
| ASTNode parent = node.getParent(); | ||
| if (parent instanceof TypeDeclaration) { | ||
| quickAssistHashCodeEquals = getHashCodeEqualsAction(params, JavaCodeActionKind.QUICK_ASSIST); |
There was a problem hiding this comment.
In the above screenshot, we can get the following information, including it's startpotision and length:
@entity,@Table(name = "owners")andpublic: modifiersOwner: Class itselfPerson: extended classSerializable: implemented interface
For extending the place to show the light bulb, I have the following two plans:
- When the covered node or the covering node is one of the above nodes, we offer the light bulb (in the screenshot, the six red squares will be valid)
- calculate the first startpotision and the last endpotision as construct a range. If the covered node or the covering node is in the range, we offer the light bulb (in the screenshot, all parts between line 46 - line 49 will be valid)
@testforstephen which one do you prefer?
There was a problem hiding this comment.
Use 1 to make it consistent with "Move...".
Signed-off-by: Shi Chen <[email protected]>
Signed-off-by: Shi Chen <[email protected]>
e452f1d to
2385b79
Compare
Signed-off-by: Shi Chen <[email protected]>
|
commit 1ed1d87 supports more places to show this light bulb, see the following gif: |
|
test this please |
Signed-off-by: Shi Chen <[email protected]>
Signed-off-by: Shi Chen <[email protected]>
Signed-off-by: Shi Chen <[email protected]>
|
922df18 optimizes the source location, if we use quickfix out of the class body to generate the source, the generated source location will be the end of the class body. see the following gif: |
|
test this please |





Part of redhat-developer/vscode-java#2057
Signed-off-by: Shi Chen [email protected]