Comments (2)
To expand on this: neovim 0.6 nightly fetaures a handy setqflist
in addition to the already available setloclist
, which adds workspace diagnostics to the quickfix list (similar to what this plugin does).
I am currently using something like this in my personal config:
function update_diagnostics(global_too)
if not vim.lsp.buf.server_ready() then
return
end
if vim.fn.getloclist(vim.fn.winnr(), { title = 0 }).title == 'Buffer diagnostics' then
vim.diagnostic.setloclist{ open = false, title = 'Buffer diagnostics' }
end
if global_too and vim.fn.getqflist{ title = 0 }.title == 'Workspace diagnostics' then
vim.diagnostic.setqflist{ open = false, title = 'Workspace diagnostics' }
end
end
and in my setup.on_attach
callback I have
vim.api.nvim_command('autocmd BufWinEnter * lua update_diagnostics(false)')
vim.api.nvim_command('autocmd User DiagnosticsChanged lua update_diagnostics(true)')
vim.api.nvim_buf_set_keymap(0, 'n', '<C-k>k','<CMD>silent! lua vim.diagnostic.setloclist{ title = "Buffer diagnostics" }<CR>', {noremap=true})
vim.api.nvim_buf_set_keymap(0, 'n', '<C-k><C-k>','<CMD>silent! lua vim.diagnostic.setqflist{ title = "Workspace diagnostics" }<CR>', {noremap=true})
This allows me to use all kinds of non-standard quickfix/location lists (references, implementations, symbols etc.) and populate them with auto-updating diagnostics using a keymap.
Something similar (but much more polished) could be integrated into this plugin (although the "release" neovim 0.5.1 does not have setqflist
yet).
from diaglist.nvim.
Hi @piotr-machura , I finally found time to fully adapt plugin to 0.6.x and test your idea. Apparently it works well so master now uses title to identify foreign quickfix! Thank you for the great idea and wonderful examples.
Foreign loclist is still to be done.
from diaglist.nvim.
Related Issues (10)
- The lists do not update when there are no warnings/errors
- `vim.lsp.util.set_qflist is deprecated`
- diaglist.nvim does not populate :copen only after open_all_diagnostics
- Export `populate_qflist()` publicly HOT 2
- [Bug] Incompatibility with the `trailblazer.nvim` plugin
- Auto-open quickfix list on errors?
- Maintain current selection after leaving quickfix window HOT 1
- [NVIM v0.6.0-dev] Diaglist does not let go of cursor focus and makes nvim unusable HOT 2
- Better support for different neovim versions HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from diaglist.nvim.