Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Support for custom invocation of code actions' Commands #183

Open
@deankevorkian

Description

@deankevorkian

Currently, the default client's flow of using code action works as follows -

  1. Client requests server for available code actions according to file & location
  2. Client receives the actions and shows them (and every action is associated with a Command object)
  3. Client chooses one of the code actions in the UI
  4. Client calls workspace/executeCommand for the Command associated with the code action.

IMO the LSP specs state pretty clearly here that the response for code actions should return an array of Commands that the Server is capable of running - the client should contact the server again with the associated Command to executeCommand.

However, not all servers work that way - for example eclipses' java server returns Commands it expects the calling client to understand, analyze and act to. (So obviously, non-standard/custom commands).

Since in our default implementation, in step 4 mentioned above, If I understand correctly, executeCommand is called automatically for Commands the server can't handle,' there's a need to override that behavior (which includes copying redundant code to packages, like ide-java, to implement a custom behavior).

Can the atom language client provide some hooks to registering custom commands (some Map object that maps a Command to a callback function can do) for ide-* packages? the way I see it, the client can expose functions to register a custom Command callback (without exposing the Map itself) and everytime a CodeAction is executed, it will first check if the Map contains custom implementation, and if it doesn't - it'll call workspace/executeCommand on the server.

thoughts? is this something you think we should support? (if so, i'd like to start working on a PR for this matter)

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