feat(lsp): enable document_color by default #35086

This commit is contained in:
Maria José Solano
2025-07-27 17:11:28 -07:00
committed by GitHub
parent 628d569a59
commit d08b265111
3 changed files with 10 additions and 0 deletions

View File

@@ -119,6 +119,8 @@ To remove or override BUFFER-LOCAL defaults, define a |LspAttach| handler: >lua
vim.bo[args.buf].omnifunc = nil
-- Unmap K
vim.keymap.del('n', 'K', { buffer = args.buf })
-- Disable document colors
vim.lsp.buf.document_color.enable(false, args.buf)
end,
})
<
@@ -2242,6 +2244,10 @@ is_enabled({filter}) *vim.lsp.semantic_tokens.is_enabled()*
==============================================================================
Lua module: vim.lsp.document_color *lsp-document_color*
This module provides LSP support for highlighting color references in a
document. Highlighting is enabled by default.
color_presentation() *vim.lsp.document_color.color_presentation()*
Select from a list of presentations for the color under the cursor.

View File

@@ -779,6 +779,7 @@ function lsp._set_defaults(client, bufnr)
if client:supports_method(ms.textDocument_diagnostic) then
lsp.diagnostic._enable(bufnr)
end
lsp.document_color.enable(true, bufnr)
end
--- @deprecated

View File

@@ -1,3 +1,6 @@
--- @brief This module provides LSP support for highlighting color references in a document.
--- Highlighting is enabled by default.
local api = vim.api
local lsp = vim.lsp
local util = lsp.util