Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CodeActionKind

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.

Hierarchy

  • CodeActionKind

Index

Constructors

Private constructor

Properties

Optional value

value: string

String value of the kind, e.g. "refactor.extract.function".

Static Empty

Empty kind.

Static QuickFix

QuickFix: CodeActionKind

Base 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 Refactor

Refactor: CodeActionKind

Base kind for refactoring actions: refactor

Refactoring actions are shown in the refactoring context menu.

Static RefactorExtract

RefactorExtract: CodeActionKind

Base kind for refactoring extraction actions: refactor.extract

Example extract actions:

  • Extract method
  • Extract function
  • Extract variable
  • Extract interface from class
  • ...

Static RefactorInline

RefactorInline: CodeActionKind

Base kind for refactoring inline actions: refactor.inline

Example inline actions:

  • Inline function
  • Inline variable
  • Inline constant
  • ...

Static RefactorRewrite

RefactorRewrite: CodeActionKind

Base kind for refactoring rewrite actions: refactor.rewrite

Example rewrite actions:

  • Convert JavaScript function to class
  • Add or remove parameter
  • Encapsulate field
  • Make method static
  • Move method to base class
  • ...

Static Source

Base 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 SourceOrganizeImports

SourceOrganizeImports: CodeActionKind

Base kind for an organize imports source action: source.organizeImports.

Methods

append

  • Create a new kind by appending a more specific selector to the current kind.

    Does not modify the current kind.

    Parameters

    • parts: string

    Returns CodeActionKind

contains

  • 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"`

    Parameters

    Returns boolean