I was wondering if it would be feasible to support ftplugin workflows.
Specifically, I'd like to be able to add adapters to neotest using files in, e.g.
user_config = vim.tbl_deep_extend("force", user_config or default_config, config)
Taking this a step further, adapters could potentially self-register themselves in an ftplugin script, if the file that triggered the script to be sourced is a test file.
The caveat to the above approach is that vim.tbl_deep_extend doesn't merge lists,
so the user_config.adapters list would be overwritten.
This could be mitigated either by inserting into the existing table, or by providing a separate register_adapter API.
Hey :wave:
I was wondering if it would be feasible to support
ftplugin
workflows. Specifically, I'd like to be able to add adapters to neotest using files in, e.g.ftplugin/haskell.lua
ftplugin/rust.lua
ftplugin/java.lua
etc.
At a first glance, it looks like, this could easily be achieved by changing https://github.com/nvim-neotest/neotest/blob/73043d666780e35185a77589e01bec96a52db910/lua/neotest/config/init.lua#L370
to
Taking this a step further, adapters could potentially self-register themselves in an
ftplugin
script, if the file that triggered the script to be sourced is a test file.The caveat to the above approach is that
vim.tbl_deep_extend
doesn't merge lists, so theuser_config.adapters
list would be overwritten. This could be mitigated either by inserting into the existing table, or by providing a separateregister_adapter
API.@rcarriga what are your thoughts?