mirror of
https://github.com/neovim/neovim.git
synced 2025-12-18 20:35:41 +00:00
feat(lsp): enable document_color by default #35086
This commit is contained in:
committed by
GitHub
parent
628d569a59
commit
d08b265111
@@ -119,6 +119,8 @@ To remove or override BUFFER-LOCAL defaults, define a |LspAttach| handler: >lua
|
|||||||
vim.bo[args.buf].omnifunc = nil
|
vim.bo[args.buf].omnifunc = nil
|
||||||
-- Unmap K
|
-- Unmap K
|
||||||
vim.keymap.del('n', 'K', { buffer = args.buf })
|
vim.keymap.del('n', 'K', { buffer = args.buf })
|
||||||
|
-- Disable document colors
|
||||||
|
vim.lsp.buf.document_color.enable(false, args.buf)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
<
|
<
|
||||||
@@ -2242,6 +2244,10 @@ is_enabled({filter}) *vim.lsp.semantic_tokens.is_enabled()*
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
Lua module: vim.lsp.document_color *lsp-document_color*
|
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()*
|
color_presentation() *vim.lsp.document_color.color_presentation()*
|
||||||
Select from a list of presentations for the color under the cursor.
|
Select from a list of presentations for the color under the cursor.
|
||||||
|
|
||||||
|
|||||||
@@ -779,6 +779,7 @@ function lsp._set_defaults(client, bufnr)
|
|||||||
if client:supports_method(ms.textDocument_diagnostic) then
|
if client:supports_method(ms.textDocument_diagnostic) then
|
||||||
lsp.diagnostic._enable(bufnr)
|
lsp.diagnostic._enable(bufnr)
|
||||||
end
|
end
|
||||||
|
lsp.document_color.enable(true, bufnr)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @deprecated
|
--- @deprecated
|
||||||
|
|||||||
@@ -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 api = vim.api
|
||||||
local lsp = vim.lsp
|
local lsp = vim.lsp
|
||||||
local util = lsp.util
|
local util = lsp.util
|
||||||
|
|||||||
Reference in New Issue
Block a user