-
-
Notifications
You must be signed in to change notification settings - Fork 625
feat: add renderer.icons.diagnostic_placement #2152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Similar to the other icons there's now an option `diagnostic_placement` that can either be "signcolumn" (default), "before" or "after".
Unfortunately we cannot afford that expensive operation. Diagnostic changes must be updated in the debounced "thread" Edit: to be clear: we can draw, just not reload the tree. |
|
Please retain the logging and profiling, in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great - thanks for your work.
Also make sure the diagnostics are cleared correctly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good except for sign column folders.
Test case nvim-tree/dev/lua/nvim-tree/actions/finders/find-file.lua
view = {
width = {
min = 20,
max = 50,
},
},
OK:
show_on_dirs = false,
show_on_open_dirs = false,
diagnostic_placement = "before",
diagnostic_placement = "signcolumn",
diagnostic_placement = "after",
diagnostic_placement = nil
,
show_on_dirs = true,
show_on_open_dirs = false,
diagnostic_placement = "before",
diagnostic_placement = "signcolumn",
diagnostic_placement = "after",
diagnostic_placement = nil
,
show_on_dirs = false,
show_on_open_dirs = true,
diagnostic_placement = "before",
diagnostic_placement = "signcolumn",
diagnostic_placement = "after",
diagnostic_placement = nil
,
show_on_dirs = true,
show_on_open_dirs = true,
diagnostic_placement = "before",
diagnostic_placement = "after",
FAIL:
show_on_dirs = true,
show_on_open_dirs = true,
diagnostic_placement = "signcolumn",
diagnostic_placement = nil
,
Same results with group_empty = true,
in an empty directory tree.
Please wrap the profile / logging around the |
@@ -364,13 +406,44 @@ end | |||
|
|||
function Builder:build(tree, unloaded_bufnr) | |||
local num_children = self:_get_nodes_number(tree.nodes) | |||
local diagnostic_severities_by_path = diagnostics.get_diagnostics() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't fit in here; it should go back in diagnostics.lua.
I like _get_diagnostic_icon
- nice and consistent.
Proposal:
- Move this back into
diagnostics.update
diagnostics.update
records the diagnostic state of the node. Something likegit_status
- call draw following
diagnostics.update
_get_diagnostic_icon
calls something likelocal diagnostic_icon = diagnostics.get_icon(node)
Any updates on this one @baahrens ? This would be a great addition... I will be using it... |
I will look into this shortly, sorry for the delay |
There is no hurry; just checking whether you still intend to work on this one. |
superseded by #2396 |
Attempts to close #1510
This is my first proper PR in this project, so please let me know if this is the wrong approach/direction or if I broke any styling guidelines.
There's a few things I'm unsure about:
DiagnosticChanged
or should we aim for a more finegrained approach?config.renderer.icons.diagnostic_placement
orconfig.diagnostics.placement
(this was proposed in Add nvim-tree.diagnostics.placement config option #1510)?diagnostics.update
function. Should this be replicated somewhere in the new implementation? If yes, where?TODO: