-
Notifications
You must be signed in to change notification settings - Fork 29
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
WIP Java CodeAction stub and resolve #298
WIP Java CodeAction stub and resolve #298
Conversation
Signed-off-by: David Thompson <davthomp@redhat.com>
Signed-off-by: David Thompson <davthomp@redhat.com>
Signed-off-by: David Thompson <davthomp@redhat.com>
Signed-off-by: David Thompson <davthomp@redhat.com>
Signed-off-by: David Thompson <davthomp@redhat.com>
@@ -31,6 +31,8 @@ | |||
<delegateCommandHandler class="org.eclipse.lsp4mp.jdt.internal.core.ls.MicroProfileDelegateCommandHandlerForJava"> | |||
<command id="microprofile/java/fileInfo"/> | |||
<command id="microprofile/java/codeAction"/> | |||
<command id="microprofile/java/codeActionStub"/> |
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.
I wonder if we could remove this codeActionStub by adding in JavaCodeActionContext
a method like isResolveSupport
that MicroProfile LS could fill by using the CodeActionResolveSupportCapabilities. It will give the capability to have just a method getCodeActions and according to isResolveSupport
the TextEdit should be computed or not at this step.
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.
Please let me know if I understood what you are suggesting correctly: we add a parameter isResolveSupport
to "microprofile/java/codeAction"
. If isResolveSupport
is false, we return the resolved CodeActions (like we are currently doing), and if isResolveSupport
is true, then we return the unresolved CodeActions (everything is filled in except the TextEdit).
If we do it this way, then we still need to contact the JDT component every time CodeActions are requested in a Java file, which if I understand correctly, is what we are trying to avoid and is the motivation behind adding resolve support.
See #299 |
This is a POC for #171 (CodeAction resolve)
There are a few design decisions that make resolve implementation difficult:
Taking these into account, here is what I came up with (if there is a better way to get around this issue, please let me know):
I'm currently a bit stuck with writing the stubs and codeaction resolve logic, since some of the code action participants generate (as an example) one code action for each config properties file in the project, and I need to figure out those cases.