How do you setup lsp quickfix functionality?

Hi everyone.
The documentation of vim.lsp.buf.code_action says I can pass a {only=“quickfix”} to it to get quickfix options and rust_analyzer do support quickfix but in nvim lsp I always get an empty result.

Is there anyone who got quickfix working ?

PS. quickfix used to work with coc-nvim

1 Like

I believe the correct argument for only is a list of strings, not a single string, eg.

vim.lsp.buf.code_action({
    only = {"quickfix"},
})

Perhaps you get an empty result because you pass something unexpected?

I know that the documentation for vim.lsp.buf.code_action makes it look like you can pass just a string though, would be good to update that documentation.

the docs say String|nil that seems to be just wrong :slight_smile:

I made a PR: neovim#18492.