Skip to content

Code actions contribution point #82718

@mjbvz

Description

@mjbvz

Problem

For feature requests such as #52846 or any improved refactoring UX, VS Code needs to know all the code actions that are available for a language. Some information about available code actions is provided by CodeActionProviderMetadata but only if an extension has been activated and the provider has been registered

Proposal

To support this, we likely want a new contribution point that lets extensions statically tell us about the general classes of the code actions that they provide:

{
  "contributions": {
    "codeActions": [
      {
        "languages": [
          "javascript",
          "javascriptreact",
          "typescript",
          "typescriptreact"
        ],
        "actions": [
          {
            "kind": "refactor.extract.constant",
            "title": "Extract constant",
            "description": "Extract expression to a constant."
          }
        ]
      }
    ]
  }
}

Potential use cases for this info

/cc @kieferrm

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions