~whynothugo/lsp_lines.nvim#45: 
no virtual lines with nvim-lint

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.

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,
}
Status
REPORTED
Submitter
~srht24
Assigned to
No-one
Submitted
1 year, 4 months ago
Updated
1 year, 4 months ago
Labels
No labels applied.

~whynothugo 1 year, 4 months ago

This plugin uses the vim.diagnostics API to fetch diagnostics. The README for nvim-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.

~srht24 1 year, 4 months ago

Can you print the diagnostic objects as generated by both nvim-lint and efmls-configs-nvim?

Sure, any guidance on that please? Thanks.

Register here or Log in to comment, or comment via email.