Skip to content
Discussion options

You must be logged in to vote

rust-analyzer.files.exclude will not filter what vim.diagnostic.setqflist() shows. That setting affects files rust-analyzer watches/loads; the quickfix list is built by Neovim from diagnostics it has already received.

So the practical fix is to filter diagnostics on the Neovim side before converting them to quickfix items.

Example:

local function rust_workspace_diagnostics_qf()
  local cargo_registry = vim.fs.normalize(vim.fn.expand("~/.cargo/registry/src"))

  local diagnostics = vim.tbl_filter(function(diagnostic)
    local name = vim.api.nvim_buf_get_name(diagnostic.bufnr)
    if name == "" then
      return true
    end

    local path = vim.fs.normalize(name)
    return not vim.start…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@chardskarth
Comment options

Answer selected by chardskarth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants