-
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
Source Action: Override/Implement Methods with prompt #910
Source Action: Override/Implement Methods with prompt #910
Conversation
Peer PR on vscode-java side: redhat-developer/vscode-java#749 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's very promising! But I still need to review in more details. So far one problem I found was that the code action was returned for module-info.java and package-info.java files. It should only be returned for actual types.
....jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/text/correction/SourceAssistProcessor.java
Show resolved
Hide resolved
....jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/text/correction/SourceAssistProcessor.java
Outdated
Show resolved
Hide resolved
....ls.tests/src/org/eclipse/jdt/ls/core/internal/codemanipulation/OverrideMethodsTestCase.java
Outdated
Show resolved
Hide resolved
....ls.core/src/org/eclipse/jdt/ls/core/internal/codemanipulation/OverrideMethodsOperation.java
Outdated
Show resolved
Hide resolved
return overridables; | ||
} | ||
|
||
public static TextEdit addOverridableMethods(IType type, OverridableMethod[] overridableMethods) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if overridableMethods are actually already overridden (eg. call addOverridableMethods twice)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generate duplicated code. Here i just take it as an utility method, and need the client to avoid calling the same code multiple times.
fe81b6c
to
51428ea
Compare
Try to resolve this PR since @testforstephen is still on leave. But there is ip validation issue, wait for @testforstephen to come back and resolve this issue. |
Signed-off-by: Jinbo Wang <[email protected]>
51428ea
to
b0d84e5
Compare
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/JDTLanguageServer.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/lsp/JavaProtocolExtensions.java
Outdated
Show resolved
Hide resolved
....ls.tests/src/org/eclipse/jdt/ls/core/internal/codemanipulation/OverrideMethodsTestCase.java
Outdated
Show resolved
Hide resolved
...clipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/CodeActionHandlerTest.java
Outdated
Show resolved
Hide resolved
...clipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/CodeActionHandlerTest.java
Outdated
Show resolved
Hide resolved
...clipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/CodeActionHandlerTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jinbo Wang <[email protected]>
Nice work @testforstephen ! |
Signed-off-by: Jinbo Wang [email protected]
It implements the source action
Override/Implement Methods
with prompt ui.Closes #900