onsails / diaglist.nvim

Live render workspace diagnostics in quickfix with current buf errors on top, buffer diagnostics in loclist
184 stars 5 forks source link

Export `populate_qflist()` publicly #13

Closed gw31415 closed 2 years ago

gw31415 commented 2 years ago

This PR exports the local function populate_qflist() in lua/diaglist/quickfix.lua.

This allows, for example, to start the live-updating on LspAttach event without displaying the quickfix window:

require 'diaglist'.init() -- Initialize
vim.api.nvim_create_autocmd('LspAttach', {
    callback = function()
        require 'diaglist.quickfix'.populate_qflist() -- Starts live-updating
    end
})
use {
    'onsails/diaglist.nvim',
    event = { 'LspAttach' },
    config = function()
        require 'diaglist'.init()
        require 'diaglist.quickfix'.populate_qflist()
    end
}