Skip to content
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

Support a mix of edit and command in the code action response #1692

Open
testforstephen opened this issue May 5, 2023 · 1 comment · May be fixed by #1760
Open

Support a mix of edit and command in the code action response #1692

testforstephen opened this issue May 5, 2023 · 1 comment · May be fixed by #1760

Comments

@testforstephen
Copy link

The current ycmd implementation expects the code action response to have either edit or command, but not both. This is inconsistent with the LSP spec that allows both edit and command in the response. If both are supplied, the edit is applied first, then the command is executed.

for code_action in code_actions:
if 'edit' in code_action:
# TODO: Start supporting a mix of WorkspaceEdits and Commands
# once there's a need for such
assert 'command' not in code_action
# This is a WorkspaceEdit literal
fixits.append( self.CodeActionLiteralToFixIt( request_data,
code_action ) )
continue
# Either a CodeAction or a Command
assert 'command' in code_action

@bstaletic
Copy link
Collaborator

How could I make jdt produce such a code action in order to test the implementation? I have tried a few things, but I could not trigger that assertion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants