0

I found out that my lsp servers is somehow adding this ugly highlighting to my code (this happened after I updated my Homebrew for some reason), here are before and after pics:

enter image description here enter image description here

Here is my lsp server setup:

  local lspconfig = require('lspconfig')
  local navbuddy = require('nvim-navbuddy')
  local servers = { 'tsserver', 'eslint', 'bashls','jsonls'} 

  for _, lsp in ipairs(servers) do
      lspconfig[lsp].setup {
          capabilities = capabilities,
          -- on_attach = on_attach,
          flags = lsp_flags,
          on_attach = function(client, bufnr)
            navbuddy.attach(client, bufnr)
            vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
            vim.keymap.set('n', 'gv', function() 
                    vim.cmd([[
                        vsplit
                        ]])
                        vim.lsp.buf.definition()
            end, bufopts)
            vim.keymap.set('n', 'gl', vim.diagnostic.open_float, opts)
          end
      }
  end

How do I prevent it from doing this?

What I have already tried but didn't work:

  • disabling diagnostics: vim.diagnostic.disable()
  • disabling syntax higlight: client.server_capabilities.semanticTokensProvider = nil
1

1 Answer 1

0

got solved by putting this in my .config/nvim/init.vim

  vim.api.nvim_create_autocmd("LspAttach", {
  callback = function(args)
    local client = vim.lsp.get_client_by_id(args.data.client_id)
    client.server_capabilities.semanticTokensProvider = nil
  end,
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.