romgrk / barbar.nvim

The neovim tabline plugin.
2.23k stars 83 forks source link

how can i get coc diagnostic? #392

Closed BingCoke closed 1 year ago

BingCoke commented 1 year ago

image As you can see, there is some error in this file, but barbar show nothting.by the way,I use nvim.coc.

  -- Enables / disables diagnostic symbols
  diagnostics = {
    -- you can use a list
    { enabled = true,  icon = 'ff' }, -- ERROR
    { enabled = true }, -- WARN
    { enabled = true }, -- INFO
    { enabled = true }, -- HINT
    [vim.diagnostic.severity.ERROR] = { enabled = false, icon = 'Ⓧ ' },
    [vim.diagnostic.severity.HINT] = { enabled = false, icon = '💡' },
    [vim.diagnostic.severity.INFO] = { enabled = false, icon = 'ⓘ ' },
  },
Iron-E commented 1 year ago

This plugin uses the vim.diagnostic module, which uses the built-in LSP client to source diagnostics.

I recommend using nvim-lspconfig instead of coc.nvim, but if you wish to continue using coc.nvim you can overwrite the vim.diagnostic.get function to use b:coc_diagnostic_info (though I don't necessarily recommend that):

vim.diagnostic.get = function(bufnr, opts)
  local diagnostics = vim.b.coc_diagnostic_info
  -- etc. read the docs for info about the return value
end