Unless I'm missing something, virtual lines aren't displayed with linters configured via nvim-lint
. No issue if using efmls-configs-nvim
instead with same linters.
with nvim-lint
:
with efmls-configs-nvim
:
My config (I'm using lazy.nvim as my plugins manager):
return {
url = "https://git.sr.ht/~whynothugo/lsp_lines.nvim",
event = "LspAttach",
name = "lsp_lines.nvim",
config = true,
}
return {
"mfussenegger/nvim-lint",
event = "BufReadPre",
opts = {
events = { "BufEnter", "BufWritePost", "TextChanged", "InsertLeave" },
linters_by_ft = {
javascript = { "eslint_d" },
["sh.chezmoitmpl"] = { "shellcheck" },
zsh = { "shellcheck" },
["zsh.chezmoitmpl"] = { "shellcheck" },
},
},
config = function(_, opts)
require("lint").linters_by_ft = opts.linters_by_ft
vim.api.nvim_create_autocmd(opts.events, {
callback = function()
require("lint").try_lint()
end,
})
end,
}
return {
"creativenull/efmls-configs-nvim",
dependencies = "neovim/nvim-lspconfig",
event = { "BufReadPost", "BufNewFile" },
config = function()
local eslint_d = require("efmls-configs.linters.eslint_d")
local shellcheck = require("efmls-configs.linters.shellcheck")
local languages = {
javascript = { eslint_d },
["sh.chezmoitmpl"] = { shellcheck },
zsh = { shellcheck },
["zsh.chezmoitmpl"] = { shellcheck },
}
local efmls_config = {
filetypes = vim.tbl_keys(languages),
settings = {
rootMarkers = { ".git/" },
languages = languages,
},
init_options = {
documentFormatting = true,
documentRangeFormatting = true,
},
}
require("lspconfig").efm.setup(vim.tbl_extend("force", efmls_config, {}))
end,
}
This plugin uses the
vim.diagnostics
API to fetch diagnostics. The README fornvim-lint
uses the same, so I'm not sure what might be wrong here.I checked lsp_lines' handling of diagnostics, and I think the only path that would lead to a diagnostic not rendering is if it's missing a line number (which is a required field anyway), but given the icon on the gutter, it seems that your diagnostic does have a line number.
Can you print the the diagnostic objects as generated by both nvim-lint and efmls-configs-nvim? Comparing if either is missing any field might be useful to see if the issue is in the diagnostic data itself or elsewhere.
Can you print the diagnostic objects as generated by both nvim-lint and efmls-configs-nvim?
Sure, any guidance on that please? Thanks.