The kind of a code action.

Kinds are a hierarchical list of identifiers separated by ., e.g. "refactor.extract.function".

The set of kinds is open and client needs to announce the kinds it supports to the server during initialization.

This enum has a set of predefined code action kinds.

Variables

@:value(cast "")@:impl@:enuminlineread onlyEmpty:CodeActionKind = ""

Empty kind.

@:value(cast "quickfix")@:impl@:enuminlineread onlyQuickFix:CodeActionKind = "quickfix"

Base kind for quickfix actions: 'quickfix'

@:value(cast "refactor")@:impl@:enuminlineread onlyRefactor:CodeActionKind = "refactor"

Base kind for refactoring actions: 'refactor'

@:value(cast "refactor.extract")@:impl@:enuminlineread onlyRefactorExtract:CodeActionKind = "refactor.extract"

Base kind for refactoring extraction actions: 'refactor.extract'

Example extract actions:

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

@:value(cast "refactor.inline")@:impl@:enuminlineread onlyRefactorInline:CodeActionKind = "refactor.inline"

Base kind for refactoring inline actions: 'refactor.inline'

Example inline actions:

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

@:value(cast "refactor.rewrite")@:impl@:enuminlineread onlyRefactorRewrite:CodeActionKind = "refactor.rewrite"

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
  • ...

@:value(cast "source")@:impl@:enuminlineread onlySource:CodeActionKind = "source"

Base kind for source actions: source

Source code actions apply to the entire file.

@:value(cast "source.fixAll")@:impl@:enuminlineread onlySourceFixAll:CodeActionKind = "source.fixAll"

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

Available since

3.15.0

.

@:value(cast "source.organizeImports")@:impl@:enuminlineread onlySourceOrganizeImports:CodeActionKind = "source.organizeImports"

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