Skip to content

Commit

Permalink
chore(testables): default to termopen test executor if not using `n…
Browse files Browse the repository at this point in the history
…eotest` (#434)
  • Loading branch information
mrcjkb committed Jun 21, 2024
1 parent 14a5a4b commit d6d7620
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
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

0 comments on commit d6d7620

Please sign in to comment.