nvim-neotest / neotest

An extensible framework for interacting with tests within NeoVim.
MIT License
2.13k stars 105 forks source link

[feature request] re-attach to last attach #344

Closed otavioschwanck closed 6 months ago

otavioschwanck commented 6 months ago

Sometimes when i am debugging with Rails, i want to close the attach to see something and come back again. To do this, i need to go back to test to it.

I tried:

    local nt = require("neotest")

    nt.run.attach(nt.run.get_last_run())

it throws and errors:

Error executing luv callback: .../otavio/.local/share/nvim/lazy/neotest/lua/nio/tasks.lua:100: attempt to call upvalue 'cb' (a table value) stack traceback: .../otavio/.local/share/nvim/lazy/neotest/lua/nio/tasks.lua:100: in function 'close_task' .../otavio/.local/share/nvim/lazy/neotest/lua/nio/tasks.lua:122: in function 'cb' .../otavio/.local/share/nvim/lazy/neotest/lua/nio/tasks.lua:181: in function <.../otavio/.local/share/nvim/lazy/neotest/lua/nio/tasks.lua:180>

otavioschwanck commented 6 months ago

i managed to do it this way:

        local nt = require("neotest")

        pcall(nt.run.attach, { nt.run.get_last_run(), 0, interactive = false })

Closing