-
-
Notifications
You must be signed in to change notification settings - Fork 628
feat: Support diagnostics severity #1755
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
Changes from 1 commit
b2b217d
945501a
d718873
fe60b87
996933e
259ec1f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ end | |
local function from_nvim_lsp() | ||
local buffer_severity = {} | ||
|
||
for _, diagnostic in ipairs(vim.diagnostic.get()) do | ||
for _, diagnostic in ipairs(vim.diagnostic.get(nil, { severity = M.severity })) do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is showing only the diagnostics with that exact severity.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's correct I'll the default value to
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could simply make it explicit in the config and pass it directly to diagnostics = {
severity = {
min = vim.diagnostic.severity.HINT,
max = vim.diagnostic.severity.ERROR,
},
} This configuration will be validated at setup time. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perfect ^^ I'll do it like that. Thanks! |
||
local buf = diagnostic.bufnr | ||
if vim.api.nvim_buf_is_valid(buf) then | ||
local bufname = vim.api.nvim_buf_get_name(buf) | ||
|
@@ -140,6 +140,7 @@ local links = { | |
function M.setup(opts) | ||
M.enable = opts.diagnostics.enable | ||
M.debounce_delay = opts.diagnostics.debounce_delay | ||
M.severity = opts.diagnostics.severity | ||
|
||
if M.enable then | ||
log.line("diagnostics", "setup") | ||
|
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.
Please run update-help.sh as per https://github.com/nvim-tree/nvim-tree.lua/blob/master/CONTRIBUTING.md
This will set the default value.
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.
Done