-
Notifications
You must be signed in to change notification settings - Fork 377
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
Take advantage of CodeActionLiteral client capability - Second attempt #1278
Conversation
If client advertises `CodeActionLiteralSupport`, using that for `java.apply.workspaceEdit` would allow clients to use a generic algorithm, instead of being forced to provide a special case for jdt.ls. Fixes #376 Signed-off-by: Boris Staletic <boris.staletic@gmail.com>
Can one of the admins verify this patch? |
test this please |
@fbricon The tests are already there. |
@bstaletic I know, that comment was a trigger for Jenkins to run a build ;-) |
Oh... I thought that was addressed to me, because the last time I saw that comment I really did forget to commit the tests. :) |
@bstaletic thanks for your contribution! |
This PR will always return a WorkspaceEdit instead of command, that brings the same formatting issue as the previous PR #1059. |
@testforstephen Not always, just when the command that would be returned is already a WorkspaceEdit. If I understand #1059 (comment) correctly, the formatting issue that you have pointed out is completely on the client side? |
Not a client issue, the root cause is jdt.ls generates the WorkspaceEdit without regarding the actual indentation used by the client. The fix on client side is a workaround to force reformatting the new changes during applying workspace edit. |
Alright, I get it now. The workaround in the vscode client (obviously) doesn't exist in other clients (like ycmd). Ycmd simply ignores the wrong indentation and lets the users deal with it. So not all clients will notice the regression. That said, I do see the problem. However, I have no idea where to even start looking for a solution to that bug. I do see a way to retain the usefulness of the custom
|
Since vscode is by far the largest consumer of jdt.ls, I think introducing that formatting regression would be detrimental to a too large number of users. |
@bstaletic I'm interested in maintaining a very basic fork of this language server that supports the use of workspace/executeCommand by clients, specifically kak-lsp. I looked at the modifications in your PR here overlaid on the eclipse.jdt.ls 1.19 source but the affected classes have evolved since then. Before I wade in further which will require me developing more code level understanding than I currently have, would you be interested in rebasing this PR on the master branch moving it here (or to a fork of your own)? |
Another attempt at solving #376. Github seems confused about the state of #1256, so I decided to open a new one.
Changes compared to #1256:
isSupportedCodeActionLiteral()
because we should always be checking the code action kind.isSupportedCodeActionLiteral()
was used in Take advantage of CodeActionLiteral client capability #1256, theisSupportedCodeActionKind(kind)
was checked a few lines above, so the actual functional changes of the PR could be slightly simplified (compared to Take advantage of CodeActionLiteral client capability #1256).Command
out ofEither<Command, CodeAction>
.Command
is notnull
to thing A.Fixes #376