nvim_runtime_lua

vim.lsp.document_color

Methods3

function M.color_presentation() -> nil

Select from a list of presentations for the color under the cursor.

function M.is_enabled(filter: vim.lsp.capability.enable.Filter | nil) -> boolean

Query whether document colors are enabled in the {filter}ed scope.

function M.enable(enable: nil | boolean, filter: vim.lsp.capability.enable.Filter | nil, opts: vim.lsp.document_color.Opts | nil) -> nil

Enables or disables document color highlighting for the {filter}ed scope.

To "toggle", pass the inverse of is_enabled():

vim.lsp.document_color.enable(not vim.lsp.document_color.is_enabled())
Parameters
enablenil | boolean

True to enable, false to disable. (default: true)

Returns
nil