~srht24


#45 no virtual lines with nvim-lint 5 months ago

Comment by ~srht24 on ~whynothugo/lsp_lines.nvim

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

Sure, any guidance on that please? Thanks.

#44 Neovim .10 error: Invalid 'line': out of range 5 months ago

Comment by ~srht24 on ~whynothugo/lsp_lines.nvim

Also using 0.10, can confirm your patch solves the issue on my end. Thank you.

#45 no virtual lines with nvim-lint 5 months ago

Ticket created by ~srht24 on ~whynothugo/lsp_lines.nvim

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,
}