mrbjarksen / neo-tree-diagnostics.nvim Goto Github PK
View Code? Open in Web Editor NEWA diagnostics source for neo-tree.nvim
License: MIT License
A diagnostics source for neo-tree.nvim
License: MIT License
Every time I move the focus from the diagnostics window to a non-neo-tree window, this error message will show:
"[Neo-tree ERROR] debounce neo-tree-diagnostics-follow error: .../packer/start/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:554: attempt to index local 'tree' (a nil value)"
My neovim version is 0.8.2
neo-tree is the latest version on the branch v2.x
neo-tree-diagnostics is the latest version
This continued #14.
@mrbjarksen Yes, I just tried the mapping
['<cr>'] = 'preview'
and it works like myno_open
above. Could you elaborate more on how to make this "preview" mode behavior enabled by default, so I don't have to use a mapping to enable it? (link to it)
Now I can preview entries from the diagnostics list with <CR>
, but a new problem appeared: the word (ex. the NOREF_NOERR
in the image below) still got highlighted after calling :noh
, which I consider as a bug. What's the problem in this case?
I made a customized renderer for myself that I wanted to share. I was wondering if you wanted to use the wiki for this sort of thing or if you had any other plans.
and here's the code:
require("neo-tree").setup({
sources = {
"filesystem",
"buffers",
"git_status",
"diagnostics",
},
diagnostics = {
components = {
linenr = function(config, node)
local lnum = tostring(node.extra.diag_struct.lnum + 1)
local pad = string.rep(" ", 4 - #lnum)
return {
{
text = pad .. lnum,
highlight = "LineNr",
},
{
text = "▕ ",
highlight = "NeoTreeDimText",
}
}
end
},
renderers = {
diagnostic = {
{ "indent" },
{ "icon" },
{ "linenr" },
{ "name" },
--{ "source" },
--{ "code" },
},
},
},
})
I have the following warning from neo-tree every time I open diagnostics:
It doesn't happen when I open other sources, like filesystem.
Minimal config to reproduce:
local config = {
sources = {
'filesystem',
'diagnostics',
},
filesystem = {
commands = {
copy_file_name = function(state)
local node = state.tree:get_node()
vim.fn.setreg('+', node.name, 'c')
end,
},
},
window = {
mappings = {
['Y'] = 'copy_file_name',
},
},
}
require('neo-tree').setup(config)
Recently came across your plugin, and neo-tree as a whole, and am really thinking of making the switch. One thing that is kind of holding me back though is the lack of TODO comment support compared to Trouble with folke/todo-comments.nvim
.
While that plugin does both highlighting and aggregation of todos, the aggregation is what I really use. That being said, I could totally understand if that isn't within the scope of this project.
Either way, I am looing forward to probably including this plugin and neo-tree in my config rewrite.
Using :Neotree diagnostics reveal
always focuses the file, for example, even if follow_behavior.always_follow_file
is false
. This should be a simple fix, but maybe reveal behavior should be separate from follow behavior?
This would, for example, be useful for Haskell diagnostics. A mapping to open the message in a floating window would also be good to have.
I noticed you have a branch with a preview command. This has been requested many times for Neo-tree but I never gave it a high priority because I didn't need it. Well, just now I had a situation where I wanted to quickly scan the contents off all of my config files and I realized a preview command would be awesome for that!
So the question is, does your preview code work? If not, what is needed to bring it over the finish line? Can we add it directly to Neo-tree?
The commit seems to cause an error. The error is shown on both diagnostics list and neotree filesystem filetree.
Error in event handler for event neo_tree_buffer_enter[diagnostics.neo_tree_buffer_enter]: > ...im/site/pack/packer/start/nui.nvim/lua/nui/tree/init.lua:254: Expected Lua number
Originally posted by @nyngwang in #14 (comment)
I just tested and found that either true or false on the option autopreview = ...
, the same error was shown.
As title. Is this because I have some customization on the config of neo-tree
plugin? Now I use an alternative as follow (with this, I still need to press <CR>
, while what I expect from "follow" is that the function
will be executed on cursor hold.)
commands = {
no_open = function (...)
local cur_win = vim.api.nvim_get_current_win()
require('neo-tree.sources.diagnostics.commands').open(...)
vim.api.nvim_set_current_win(cur_win)
end,
},
I have had some issues with neovim freezing when I do something to produce a lot of errors while the diagnostics source is open. I think I can fix that by adjusting the debounce time, or even just disabling the auto refresh completely.
I can submit a PR if that sounds like a good idea to you. I'm not sure yet what the option would be called, maybe one of:
That option can either be set to false
or -1
to disable it entirely, or there can be another option to auto_refresh
which can default to true
.
as title.
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.