From 8eb3e42b26ea0da9f8d96ce5953e0a9e7af33595 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Sat, 4 May 2024 15:22:32 +0200 Subject: [PATCH] fix(neotest): remove unsupported `--show-output` flag for cargo-nextest --- CHANGELOG.md | 7 +++++++ lua/rustaceanvim/overrides.lua | 14 ++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4f9414a..dcba7d80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ 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). +## [4.22.10] - 2024-05-04 + +### Fixed + +- Neotest: Remove unsupported `--show-output` flag when running + with cargo-nextest. + ## [4.22.9] - 2024-05-04 ### Changed diff --git a/lua/rustaceanvim/overrides.lua b/lua/rustaceanvim/overrides.lua index d172e440..17521a74 100644 --- a/lua/rustaceanvim/overrides.lua +++ b/lua/rustaceanvim/overrides.lua @@ -50,8 +50,18 @@ function M.try_nextest_transform(args) table.insert(args, 3, '--nocapture') table.remove(args, #args) end - if args[#args] == '--exact' then - table.remove(args, #args) + local nextest_unsupported_flags = { + '--exact', + '--show-output', + } + local indexes_to_remove_reverse_order = {} + for i, arg in ipairs(args) do + if compat.list_contains(nextest_unsupported_flags, arg) then + table.insert(indexes_to_remove_reverse_order, 1, i) + end + end + for _, i in pairs(indexes_to_remove_reverse_order) do + table.remove(args, i) end return args end