question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Code actions contribution point

See original GitHub issue

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

  • Show on the extension’s contribution page #84091
  • IntelliSense for codeActionsOnSave (c8d64b13e5585476bedcb0b34314329c2d75d88b)
  • IntelliSense for configuring refactors in the keybinding json editor #84033
  • IntelliSense for configuring refactors in UI keybinding editor #84072
  • Improving the refactor context menu in VS Code

/cc @kieferrm

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:9
  • Comments:20 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
mjbvzcommented, Nov 7, 2019

This proposal does not effect the existing CodeActionProvider api (which lets your extension control which actual code actions are shown to the user in the editor). The static contribution point proposed here aims to supports some of the use cases outlined above without needing to activate any extensions

0reactions
heejaechangcommented, Jul 25, 2022

Pylance team wants to expose all individuals fix all code actions to users so they can configure which fix all code actions run on file save. currently there seems no way to add those individual action names in editor.codeActionsOnSave schema. and no way to provide default value for code actions on save for each fix all code actions.

I think that makes it very hard for users to discover each fix all actions and make default such as source.fixAll: true very intrusive since updating extension without knowing that it just added new fix all code action can change users code unexpectedly. furthermore, in current design, it will be very hard to find out which extension actually did it.

Please, provide a way to configure this by each fix all code action provider

Read more comments on GitHub >

github_iconTop Results From Across the Web

Contribution Points | Visual Studio Code Extension API
Contribution Points are a set of JSON declarations that you make in the contributes field of the package.json Extension Manifest. Your extension registers ......
Read more >
Contribution Point Mechanism | OpenSumi
The concept of contribution point comes from a design philosophy in VS Code. By defining a basic contribution point, we can fully implement...
Read more >
Measuring Developer Contribution from Software Repository ...
the measurement of the contribution of a person in terms of lines of code (LOC) or function points towards the final development of...
Read more >
Extension points - vscode-docs
This document covers the various contribution points that are defined in the ... This ensures the user gets great tooling support when authoring...
Read more >
[Adventurer's Guide] Contribution | Black Desert NA/EU/OC
This is represented in the game as contribution points, a single number that ... When you're carrying out certain life skill activities, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found