Skip to content

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

@testforstephen

Description

@testforstephen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions