Code actions contribution point
See original GitHub issueProblem
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:
- Created 4 years ago
- Reactions:9
- Comments:20 (19 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 extensionsPylance team wants to expose all individuals
fix all code actions
to users so they can configure whichfix all code actions
run on file save. currently there seems no way to add those individual action names ineditor.codeActionsOnSave
schema. and no way to providedefault value
forcode actions on save
for eachfix all code actions
.I think that makes it very hard for users to discover each
fix all actions
and make default such assource.fixAll: true
very intrusive since updating extension without knowing that it just added newfix 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