Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(testables): default to termopen test executor if not using neotest #434

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [4.25.1] - 2024-06-21

### Changed

- Testables: Default to `termopen` test executor if not using `neotest`

### Fixed

Expand Down
13 changes: 2 additions & 11 deletions lua/rustaceanvim/config/internal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,13 @@ local function load_dap_configuration(type)
return dap_config
end

---@return RustaceanExecutor
local function get_crate_test_executor()
if vim.fn.has('nvim-0.10.0') == 1 then
return executors.background
else
return executors.termopen
end
end

---@return RustaceanExecutor
local function get_test_executor()
if package.loaded['rustaceanvim.neotest'] ~= nil then
-- neotest has been set up with rustaceanvim as an adapter
return executors.neotest
end
return get_crate_test_executor()
return executors.termopen
end

---@class RustaceanConfig
Expand All @@ -98,7 +89,7 @@ local RustaceanDefaultConfig = {
test_executor = get_test_executor(),

---@type RustaceanExecutor
crate_test_executor = get_crate_test_executor(),
crate_test_executor = executors.termopen,

---@type string | nil
cargo_override = nil,
Expand Down
Loading