abzcoding / lvim

🧑‍🚀 Bloated LunarVim 🚀
MIT License
472 stars 65 forks source link

Neotest run all issue #96

Closed crisidev closed 2 years ago

crisidev commented 2 years ago

Hello, I took the configuration for neotest from your repository (thanks for it!!!).

I am having some issue with this function

https://github.com/abzcoding/lvim/blob/7695615ccb39cf60a8e656d3463d162e0344b351/lua/user/ntest.lua#L91-L96

It is always returning

Error  01:43:00 PM msg_show.lua_error E5108: Error executing lua ...config/lvim/lua/user/ntest.lua:90: attempt to call field 'adapters' (a nil value)
stack traceback:
    ...config/lvim/lua/user/ntest.lua:90: in function 'run_all'
    [string ":lua"]:1: in main chunk

I am wondering if the same happens to you or it is something related to config..

abzcoding commented 2 years ago

that is a bit weird, i just ran it in a rust lib.rs file and I have no issues

Screenshot 2022-10-27 at 4 59 31 PM (2)

maybe you can change this line

local neotest = require "neotest"

to

  local found, neotest = pcall(require, "neotest")
  if not found then
    vim.notify("neotest is not loaded yet", vim.log.levels.ERROR)
    return
  end

if see if the issue is the lazy loading of neotest

crisidev commented 2 years ago

Thanks for double checking. It's probably something in my configuration as neotest.run exist, but the adapters() method is never attached to the struct:

print(vim.inspect(require("neotest").run))
{
  rerun_task_group = <function 1>,
  run = <function 2>,
  run_last = <function 3>,
  <metatable> = {
    __call = <function 4>
  }
}
crisidev commented 2 years ago

I have tracked it down to the integration with "overseer". If I disable it, adapters() works as expected.

abzcoding commented 2 years ago

should be fixed via https://github.com/abzcoding/lvim/commit/0791beb618a33254a2d3ae2d2aec3d649781f6d5

crisidev commented 2 years ago

Nice! Thanks a lot.