Add code actions contributon point

For #82718
Fixes #52846

This adds a newly proposed codeActions contribution point. For details, see #82718

This change also makes the intellisense for the `editor.codeActionsOnSave` property dynamic by using the new contribution point
This commit is contained in:
Matt Bierner
2019-11-05 23:59:44 -08:00
parent 5ed6a46d84
commit c8d64b13e5
8 changed files with 228 additions and 24 deletions

View File

@@ -866,6 +866,44 @@
}
}
}
],
"codeActions": [
{
"kind": "refactor.extract.constant",
"title": "%codeActions.refactor.extract.constant%",
"selector": [
{
"language": "javascript"
},
{
"language": "javascriptreact"
},
{
"language": "typescript"
},
{
"language": "typescriptreact"
}
]
},
{
"kind": "source.organizeImports",
"title": "%codeActions.source.organizeImports%",
"selector": [
{
"language": "javascript"
},
{
"language": "javascriptreact"
},
{
"language": "typescript"
},
{
"language": "typescriptreact"
}
]
}
]
}
}

View File

@@ -75,5 +75,7 @@
"typescript.suggest.enabled": "Enabled/disable autocomplete suggestions.",
"configuration.surveys.enabled": "Enabled/disable occasional surveys that help us improve VS Code's JavaScript and TypeScript support.",
"configuration.suggest.completeJSDocs": "Enable/disable suggestion to complete JSDoc comments.",
"typescript.preferences.renameShorthandProperties": "Enable/disable introducing aliases for object shorthand properties during renames. Requires using TypeScript 3.4 or newer in the workspace."
"typescript.preferences.renameShorthandProperties": "Enable/disable introducing aliases for object shorthand properties during renames. Requires using TypeScript 3.4 or newer in the workspace.",
"codeActions.refactor.extract.constant": "Extract constant",
"codeActions.source.organizeImports": "Organize imports"
}