Skip to content

Commit 625521f

Browse files
committed
chore: Add note to new 0.12 feature
1 parent dded0ff commit 625521f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lua/vnext/plugins/lsp.lua

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,18 @@ return {
141141
map("<leader>la", vim.lsp.buf.code_action, "Code Action", { "n", "x" })
142142
map("<leader>lD", vim.lsp.buf.declaration, "Declaration")
143143

144+
local client = vim.lsp.get_client_by_id(event.data.client_id)
145+
146+
-- TODO: Only works if LSP is available and feature is supported.
147+
-- However, some do not support it and I want to see the color or I have no LSP installed.
148+
-- if client and client:supports_method("textDocument/documentColor") then
149+
-- vim.lsp.document_color.enable(true, event.buf)
150+
-- end
151+
144152
-- The following two autocommands are used to highlight references of the
145153
-- word under your cursor when your cursor rests there for a little while.
146154
-- See `:help CursorHold` for information about when this is executed
147-
--
148155
-- When you move your cursor, the highlights will be cleared (the second autocommand).
149-
local client = vim.lsp.get_client_by_id(event.data.client_id)
150156
if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then
151157
local highlight_augroup = vim.api.nvim_create_augroup("kickstart-lsp-highlight", { clear = false })
152158
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {

0 commit comments

Comments
 (0)