nvim-neotest / neotest

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

[BUG] project root get set to wrong directory #237

Closed momrak closed 1 year ago

momrak commented 1 year ago

NeoVim Version

NVIM v0.9.0
Build type: Release
LuaJIT 2.1.0-beta3

Describe the bug When running lua require'neotest'.summary.open() the tab with the summary opens and starts parsing tests. The problem is that it does not parse from that file only or the project files. It jumps quite a few folder out and starts parsing from that.

Running :lua print(vim.fn.getwd()) gives the correct working dir.

Are there any likely causes for this, or is it hard to say without more info? I am debugging Dart code. How does neoest choose what it sets as the root project dir?

neotest
rcarriga commented 1 year ago

Project roots are determined by the adapter. neotest-dart looks for a dart folder https://github.com/sidlatau/neotest-dart/blob/43a61b8aab7908799d58369ba15dc4cd381d46ff/lua/neotest-dart/init.lua#L11. I'm not sure what the correct behaviour should be here, I'd recommend opening an issue in the adapter repo

momrak commented 1 year ago

Ah, I see. Thank you for the reply