Skip to content

codeAction and executeCommand #394

Closed
@willt

Description

@willt

I'm trying to figure out how textDocument/codeAction and workspace/executeCommand
are supposed to work together.
I think what should happen when code is selected and a command is ran like extractMethod is as follows:

  1. Client sends a codeAction request to the server when text is selected. It contains the start/end range of the code selected. (I believe the server needs to store this information somewhere and update it whenever changed.)
  2. The users uses a command like extractMethod. The client would send a executeCommand to the server that contains the command name and some arguments. (Still haven't figured out if you can add your own arguments to this request)
  3. The server would run the command and send a workspace/applyEdit to the client to finalize the changes.

Is this correct so far? Does anything further need to happen? Document Syncing or anything ?
Thanks

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions