Private
constructorReadonly
valueString value of the kind, e.g. "refactor.extract.function"
.
Static
Readonly
EmptyEmpty kind.
Static
Readonly
NotebookBase kind for all code actions applying to the entire notebook's scope. CodeActionKinds using
this should always begin with notebook.
This requires that new CodeActions be created for it and contributed via extensions.
Pre-existing kinds can not just have the new notebook.
prefix added to them, as the functionality
is unique to the full-notebook scope.
Notebook CodeActionKinds can be initialized as either of the following (both resulting in notebook.source.xyz
):
const newKind = CodeActionKind.Notebook.append(CodeActionKind.Source.append('xyz').value)
const newKind = CodeActionKind.Notebook.append('source.xyz')
Example Kinds/Actions:
notebook.source.organizeImports
(might move all imports to a new top cell)notebook.source.normalizeVariableNames
(might rename all variables to a standardized casing format)Static
Readonly
QuickBase kind for quickfix actions: quickfix
.
Quick fix actions address a problem in the code and are shown in the normal code action context menu.
Static
Readonly
RefactorBase kind for refactoring actions: refactor
Refactoring actions are shown in the refactoring context menu.
Static
Readonly
RefactorBase kind for refactoring extraction actions: refactor.extract
Example extract actions:
Static
Readonly
RefactorBase kind for refactoring inline actions: refactor.inline
Example inline actions:
Static
Readonly
RefactorBase kind for refactoring inline actions: refactor.move
Example move actions:
Static
Readonly
RefactorBase kind for refactoring rewrite actions: refactor.rewrite
Example rewrite actions:
Static
Readonly
SourceBase kind for source actions: source
Source code actions apply to the entire file and can be run on save
using editor.codeActionsOnSave
. They also are shown in source
context menu.
Static
Readonly
SourceBase kind for auto-fix source actions: source.fixAll
.
Fix all actions automatically fix errors that have a clear fix that do not require user input. They should not suppress errors or perform unsafe fixes such as generating new types or classes.
Static
Readonly
SourceBase kind for an organize imports source action: source.organizeImports
.
Create a new kind by appending a more specific selector to the current kind.
Does not modify the current kind.
Does this kind contain other
?
The kind "refactor"
for example contains "refactor.extract"
and ``"refactor.extract.function", but not
"unicorn.refactor.extract"or
"refactory.extract"`
Kind to check.
Check if this code action kind intersects other
.
The kind "refactor.extract" for example intersects refactor, "refactor.extract" and
`"refactor.extract.function", but not "unicorn.refactor.extract", or "refactor.extractAll".
Kind to check.
Kind of a code action.
Kinds are a hierarchical list of identifiers separated by
.
, e.g."refactor.extract.function"
.Code action kinds are used by VS Code for UI elements such as the refactoring context menu. Users can also trigger code actions with a specific kind with the
editor.action.codeAction
command.