Method

LspCodeActionset_disabled_reason

Declaration

void
lsp_code_action_set_disabled_reason (
  LspCodeAction* self,
  const gchar* value
)

Description

Sets the value of disabled_reason.

Human readable description of why the code action is currently disabled, if it is disabled.

This is displayed in the code actions UI. When non-null, this indicates that the code action cannot currently be applied.

Clients should follow the following guidelines regarding disabled code actions:

  • Disabled code actions are not shown in automatic lightbulbs code action menus.

  • Disabled actions are shown as faded out in the code action menu when the user request a more specific type of code action, such as refactorings.

  • If the user has a keybinding that auto applies a code action and only a disabled code actions are returned, the client should show the user an error message with reason in the editor.

Since:

3.16.0.

Parameters

value

Type: const gchar*

The new value of disabled_reason.

The argument can be NULL.
The data is owned by the caller of the method.
The value is a NUL terminated UTF-8 string.