File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,13 @@ All notable changes to this project will be documented in this file.
66The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
77and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
88
9+ ## [ 4.22.2] - 2024-04-14
10+
11+ ### Fixed
12+
13+ - Neotest/DAP: Undo sanitize command for debugging when running with
14+ a non-dap strategy, in case it was sanitized during a dap strategy run.
15+
916## [ 4.22.1] - 2024-04-14
1017
1118### Fixed
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ local lib = require('neotest.lib')
3131local nio = require (' nio' )
3232local trans = require (' rustaceanvim.neotest.trans' )
3333local cargo = require (' rustaceanvim.cargo' )
34+ local overrides = require (' rustaceanvim.overrides' )
3435
3536--- @package
3637--- @type neotest.Adapter
@@ -239,7 +240,6 @@ function NeotestAdapter.build_spec(run_args)
239240 local exe , args , cwd = require (' rustaceanvim.runnables' ).get_command (runnable )
240241 if run_args .strategy == ' dap' then
241242 local dap = require (' rustaceanvim.dap' )
242- local overrides = require (' rustaceanvim.overrides' )
243243 overrides .sanitize_command_for_debugging (runnable .args .cargoArgs )
244244 local future = nio .control .future ()
245245 dap .start (runnable .args , false , function (strategy )
@@ -260,6 +260,8 @@ function NeotestAdapter.build_spec(run_args)
260260 strategy = strategy ,
261261 }
262262 return run_spec
263+ else
264+ overrides .undo_debug_sanitize (runnable .args .cargoArgs )
263265 end
264266 --- @type rustaceanvim.neotest.RunSpec
265267 --- @diagnostic disable-next-line : missing-fields
Original file line number Diff line number Diff line change @@ -71,4 +71,14 @@ function M.sanitize_command_for_debugging(command)
7171 end
7272end
7373
74+ --- Undo sanitize_command_for_debugging.
75+ --- @param command string[]
76+ function M .undo_debug_sanitize (command )
77+ if command [1 ] == ' build' then
78+ command [1 ] = ' run'
79+ elseif command [1 ] == ' test' and command [2 ] == ' --no-run' then
80+ table.remove (command , 2 )
81+ end
82+ end
83+
7484return M
You can’t perform that action at this time.
0 commit comments