File tree Expand file tree Collapse file tree 4 files changed +20
-9
lines changed Expand file tree Collapse file tree 4 files changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,12 @@ 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+ ## [ 3.17.0] - 2024-01-20
10+
11+ ### Added
12+
13+ - Cache runnables and debuggables run with commands/code lenses.
14+
915## [ 3.16.3] - 2024-01-20
1016
1117### Changed
Original file line number Diff line number Diff line change 1010
1111vim .lsp .commands [' rust-analyzer.runSingle' ] = function (command )
1212 local runnables = require (' rustaceanvim.runnables' )
13+ local cached_commands = require (' rustaceanvim.cached_commands' )
14+ cached_commands .set_last_runnable (1 , command .arguments )
1315 runnables .run_command (1 , command .arguments )
1416end
1517
2628
2729vim .lsp .commands [' rust-analyzer.debugSingle' ] = function (command )
2830 local overrides = require (' rustaceanvim.overrides' )
29- overrides .sanitize_command_for_debugging (command .arguments [1 ].args .cargoArgs )
31+ local args = command .arguments [1 ].args
32+ overrides .sanitize_command_for_debugging (args )
33+ local cached_commands = require (' rustaceanvim.cached_commands' )
34+ cached_commands .set_last_debuggable (args )
3035 local rt_dap = require (' rustaceanvim.dap' )
31- rt_dap .start (command . arguments [ 1 ]. args )
36+ rt_dap .start (args )
3237end
3338
3439lsp .start ()
Original file line number Diff line number Diff line change @@ -4,16 +4,16 @@ local M = {}
44local cache = {
55 --- @type RADebuggableArgs | nil
66 last_debuggable = nil ,
7- --- @type { choice : integer , runnable : RARunnable }
7+ --- @type { choice : integer , runnables : RARunnable[] }
88 last_runnable = nil ,
99}
1010
1111--- @param choice integer
12- --- @param runnable RARunnable
13- M .set_last_runnable = function (choice , runnable )
12+ --- @param runnables RARunnable[]
13+ M .set_last_runnable = function (choice , runnables )
1414 cache .last_runnable = {
1515 choice = choice ,
16- runnable = runnable ,
16+ runnables = runnables ,
1717 }
1818end
1919
@@ -37,7 +37,7 @@ M.execute_last_runnable = function()
3737 local action = cache .last_runnable
3838 local runnables = require (' rustaceanvim.runnables' )
3939 if action then
40- runnables .run_command (action .choice , action .runnable )
40+ runnables .run_command (action .choice , action .runnables )
4141 else
4242 runnables .runnables ()
4343 end
Original file line number Diff line number Diff line change 2020--- @field cargoExtraArgs string[]
2121--- @field executableArgs string[]
2222
23- --- @param result RARunnable
23+ --- @param result RARunnable[]
2424local function get_options (result )
2525 local option_strings = {}
2626
@@ -70,7 +70,7 @@ function M.run_command(choice, runnables)
7070 opts .executor .execute_command (command , args , cwd )
7171end
7272
73- --- @param result RARunnable
73+ --- @param result RARunnable[]
7474local function handler (_ , result )
7575 if result == nil then
7676 return
You can’t perform that action at this time.
0 commit comments