-
-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Describe the bug
Using the latest flatten.nvim (b17a3e6) causes neotest to hang.
When running tests written in Go with neotest, the process hangs.
After performing a git bisect, I identified that the issue occurs from commit ffb2979 onward.
Commits before this do not exhibit the issue.
Expected behavior
neotest should not hang.
To Reproduce
Steps to reproduce the behavior:
- Install the latest
flatten.nvim(HEAD). - Use
neotestto run the provided Go test file. - Execute
lua require('neotest').run.run()on the test file. - Observe that
neotesthangs.
package main
import (
"fmt"
"testing"
)
func TestHoge(t *testing.T) {
t.Run("hoge", func(t *testing.T) {
x := 123
x++
fmt.Println(x)
})
t.Run("piyo", func(t *testing.T) {
x := 123
x++
fmt.Println(x)
})
}Expected behavior
neotest should execute the tests without hanging.
Screenshots
N/A
Minimal Init
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"--branch=stable",
lazyrepo,
lazypath,
})
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Setup lazy.nvim
require("lazy").setup({
spec = {
{
"nvim-neotest/neotest",
version = "v5.7.0",
dependencies = {
"nvim-neotest/nvim-nio",
"nvim-lua/plenary.nvim",
"antoinemadec/FixCursorHold.nvim",
"nvim-treesitter/nvim-treesitter",
{ "fredrikaverpil/neotest-golang", version = "v1.7.1" }, -- Installation
},
config = function()
require("neotest").setup({
adapters = {
require("neotest-golang"), -- Registration
},
})
end,
},
{
"willothy/flatten.nvim",
opts = {},
lazy = false,
},
{
"nvim-treesitter/nvim-treesitter",
version = "*",
event = "VeryLazy",
dependencies = {
"nvim-treesitter/nvim-treesitter-textobjects",
},
build = ":TSUpdate",
config = function()
vim.defer_fn(function()
require("nvim-treesitter.configs").setup({
ensure_installed = { "go" },
auto_install = true,
sync_install = false,
ignore_install = {},
modules = {},
highlight = { enable = true },
indent = { enable = true },
})
end, 0)
end,
},
},
checker = { enabled = true },
})Desktop (please complete the following information):
- OS: Ubuntu 24.04 and 24.10
- Terminal emulator: Alacritty
- Neovim version: 0.10.3
Additional context
The issue might be related to the recent major refactoring, so this behavior could be intentional. However, I am reporting it in case it is not expected.
I have only tested this issue with Go and have not investigated its behavior with other programming languages.
The investigation was conducted in a devcontainer environment. The full configuration of the environment can be found at the following link:
https://github.com/goropikari/flatten.nvim/tree/neotest/.devcontainer