Skip to content

Request: add option to configure lsp highlighting #116

@megapixel-code

Description

@megapixel-code

I use lsp document highlighting and the colorscheme displays them with a underline, would it be possible to have a option to have highlighting similar to the search highlighting ?

The piece of code I use to highlight:

-- [[ document-higligting ]]
local hover_highlight_group = vim.api.nvim_create_augroup( "hover-highlight", { clear = false } )
local no_highlight_table = { "json" }

vim.api.nvim_create_autocmd( { "CursorHold", "CursorHoldI" }, {
   group = hover_highlight_group,
   callback = function()
      for _, v in pairs( no_highlight_table ) do
         if vim.bo.filetype == v then
            return
         end
      end
      vim.lsp.buf.document_highlight()
   end,
} )

vim.api.nvim_create_autocmd( { "CursorMoved", "CursorMovedI" }, {
   group = hover_highlight_group,
   callback = function()
      for _, v in pairs( no_highlight_table ) do
         if vim.bo.filetype == v then
            return
         end
      end
      vim.lsp.buf.clear_references()
   end,
} )

The important function is the vim.lsp.buf.document_highlight()

What I would love to have (from another colorscheme) :

Image

What the colorscheme currentely looks like:

Image

Thanks in advance !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions