onsails / diaglist.nvim Goto Github PK
View Code? Open in Web Editor NEWLive render workspace diagnostics in quickfix with current buf errors on top, buffer diagnostics in loclist
Live render workspace diagnostics in quickfix with current buf errors on top, buffer diagnostics in loclist
As reported here:
Using the latest LSP and Neovim.
Hello. I am always grateful for this plugin. Sorry for my poor English.
Why don't you export the local function populate_qflist()
in lua/diaglist/quickfix.lua
publicly?
In my case, I want to add a diaglist to the quickfix list on LspAttach events (or equivalent timing: e.g. nvim-lspconfig callback function), but I do not want to display the quickfix window at that time.
Excellent plugin!
One small annoyance I've noticed is that when I leave the quickfix window, it no longer maintains the current selection and the top item is selected instead.
Forgive me if I'm missing something obvious, but is there an easy way when using this plugin to have the quickfix list open automatically when there are errors? Something like neomake
's behavior?
$ nvim --version
NVIM v0.6.0-dev+274-g6188926e0
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
After installing diaglist, here's what happens when I enter a buffer with an LSP attached to it:
Basically, the diaglist window appears and steals focus. If I try to go to another buffer, focus immediately goes back to diaglist.
I've set up diaglist with just:
require("diaglist").init({})
On NVIM v0.5.1, diaglist works just fine!
As stated in the title, these lines in loclist.lua
if warnings + errors > 0 then
and quickfix.lua
if #all_diagnostics > 0 then
prevent the lists from updating when there are no errors/warnings left.
Screenshot:
Then I comment the incorrect line and the windows closes, but another :copen
shows the errors still there:
Edit: I have created a PR with a possible simple solution. Let me know what you think.
When I'm using Neovim V0.5, errors show saying that LSP events are not valid events. After switching to Neovim V0.6, deprecation warnings are popping up.
Hi @onsails,
Thank you for your plugin. I use it with the sample config:
lua require("diaglist").init({
debug = false,
debounce_ms = 150,
})
I noticed the quickfix only populated after I call lua require('diaglist').open_all_diagnostics()
which sets the window title and in this way lets the vim.fn.getqflist{ title = 0 }.title ~=
check to pass.
So currently, I always get the print('foreign quickfix, not populating')
message for using :copen
.
I'm wondering why does it work like this? Should the README point it out?
The plugin sets a flag on QuickFixCmdPre
to signify that the quickfix has been populated by something other than the diagnostics. This unfortunatelly conflicts with non-builtin functions utilizing quickfix (like vim.lsp.buf.workspace_symbol()
or vim.lsp.buf.references()
).
Both this and the current issue of not respecting foregin location lists can be fixed using setqflist()
(and getqflist()
, setloclist()
, getloclist()
), perhaps by specifying the lists' ID or even just the title. The lsp_diagnostic_hook
can then check if current quickfix list has a specific title (say "Diagnostics") and only then update. If the user wants to force the update they can do so with open_all_diagnostics()
or open_buffer_diagnostics()
.
I would try making a PR myself, but the above are vimscript functions and I have no clue how to nicely use them from lua.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.