nvimtools / none-ls.nvim

null-ls.nvim reloaded / Use Neovim as a language server to inject LSP diagnostics, code actions, and more via Lua.
The Unlicense
2.39k stars 69 forks source link

fix: replace tbl_flatten to flatten():totable() if using nvim-0.10 #131

Closed pablobfonseca closed 3 months ago

pablobfonseca commented 3 months ago

Keeps support for nvim < 0.10

mochaaP commented 3 months ago

Tests failed, please check. https://github.com/nvimtools/none-ls.nvim/actions/runs/9166231657/job/25204751007?pr=131#step:5:470

pablobfonseca commented 3 months ago

@mochaaP I've been trying to debug the tests, and this seems to be an issue only with the terraform_validate spec, here:

-- null-ls/builtins/diagnostics/terraform_validate.lua:64
rewritten_diagnostic.filename = u.path.join(params.cwd, new_diagnostic.range.filename)

params.cwd returns a dict-like table:

{
  [2] = "main.tf"
}

and vim.iter(...):flatten() only works with list-like tables I've tried to use the terraform_validate manually and it seems to be working fine, could it be something specific for the terraform_validate spec?

pablobfonseca commented 3 months ago

@mochaaP the tests are passing now, can we merge it?

mochaaP commented 3 months ago

Thanks!