mirror of
https://github.com/maxmx03/solarized.nvim.git
synced 2026-09-10 07:26:26 -04:00
test: advanced hl
This commit is contained in:
parent
de9d185c5c
commit
315a61db21
|
|
@ -93,6 +93,21 @@ function Colorscheme.load()
|
|||
end
|
||||
|
||||
function Colorscheme:apply_semantic_hl()
|
||||
local function show_unconst_caps(args)
|
||||
local token = args.data.token
|
||||
if token.type ~= 'variable' or token.modifiers.readonly then
|
||||
return
|
||||
end
|
||||
|
||||
local text = vim.api.nvim_buf_get_text(args.buf, token.line, token.start_col, token.line, token.end_col, {})[1]
|
||||
|
||||
if text ~= string.upper(text) then
|
||||
return
|
||||
end
|
||||
|
||||
vim.lsp.semantic_tokens.highlight_token(token, args.buf, args.data.client_id, 'Error')
|
||||
end
|
||||
|
||||
local set_hl = function(name, val)
|
||||
vim.api.nvim_set_hl(0, name, val)
|
||||
end
|
||||
|
|
@ -103,10 +118,12 @@ function Colorscheme:apply_semantic_hl()
|
|||
set_hl('@lsp.typemod.parameter.readyonly', { italic = true })
|
||||
set_hl('@lsp.typemod.variable.readonly', { link = '@variable.builtin' })
|
||||
set_hl('@lsp.typemod.variable.defaultLibrary.typescript', { link = '@variable.builtin' })
|
||||
set_hl('@lsp.typemod.variable.declaration', { fg = self.colors.comment })
|
||||
-- set_hl('@lsp.typemod.variable.local', { fg = self.colors.blue })
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd('LspTokenUpdate', {
|
||||
callback = show_unconst_caps,
|
||||
})
|
||||
end
|
||||
|
||||
function Colorscheme:setup(t)
|
||||
|
|
|
|||
Loading…
Reference in a new issue