Skip to content

Commit

Permalink
fix(lsp): nil error on RustLsp! testables if no previous testable
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Jan 30, 2024
1 parent 259dbb7 commit e99d5b9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ 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.2.1] - 2024-01-30

### Fixed

- LSP: Only advertise `rust-analyzer.debugSingle` command capability
if nvim-dap is installed.
- LSP: `nil` error if running `:RustLsp! testables` and there is no
previous testable.

## [4.2.0] - 2024-01-30

Expand Down
2 changes: 1 addition & 1 deletion lua/rustaceanvim/cached_commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ M.execute_last_testable = function()
if action then
runnables.run_command(action.choice, action.runnables)
else
runnables.runnables()
runnables.runnables { tests_only = true }
end
end

Expand Down
2 changes: 1 addition & 1 deletion lua/rustaceanvim/runnables.lua
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ end
---@param opts? RunnablesOpts
function M.runnables(executableArgsOverride, opts)
---@type RunnablesOpts
opts = vim.tbl_deep_extend('force', { tests_only = false }, opts)
opts = vim.tbl_deep_extend('force', { tests_only = false }, opts or {})
vim.lsp.buf_request(0, 'experimental/runnables', get_params(), mk_handler(executableArgsOverride, opts))
end

Expand Down

0 comments on commit e99d5b9

Please sign in to comment.