Skip to content

Commit 7875217

Browse files
Marc Jakobimrcjkb
authored andcommitted
fix(dap): autoload new configurations in on_attach
1 parent e539aa2 commit 7875217

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ All notable changes to this project will be documented in this file.
66
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
77
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88

9+
## [5.1.2] - 2024-08-02
10+
11+
### Fixed
12+
13+
- DAP: Autoload new configurations in `on_attach` [[#466](https://github.com/mrcjkb/rustaceanvim/issues/466)].
14+
915
## [5.1.1] - 2024-07-29
1016

1117
### Fixed

lua/rustaceanvim/config/internal.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ local RustaceanDefaultConfig = {
297297
--- @class rustaceanvim.dap.Config
298298
dap = {
299299
--- @type boolean Whether to autoload nvim-dap configurations when rust-analyzer has attached?
300-
autoload_configurations = vim.fn.has('nvim-0.10.0') == 1, -- Compiling the debug build cannot be run asynchronously on Neovim < 0.10
300+
autoload_configurations = true,
301301
--- @type rustaceanvim.dap.executable.Config | rustaceanvim.dap.server.Config | rustaceanvim.disable | fun():(rustaceanvim.dap.executable.Config | rustaceanvim.dap.server.Config | rustaceanvim.disable)
302302
adapter = function()
303303
--- @type rustaceanvim.dap.executable.Config | rustaceanvim.dap.server.Config | rustaceanvim.disable

lua/rustaceanvim/lsp.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ M.start = function(bufnr)
181181
if type(old_on_attach) == 'function' then
182182
old_on_attach(...)
183183
end
184+
if config.dap.autoload_configurations then
185+
-- When switching projects, there might be new debuggables (#466)
186+
require('rustaceanvim.commands.debuggables').add_dap_debuggables()
187+
end
184188
end
185189

186190
local old_on_exit = lsp_start_config.on_exit

0 commit comments

Comments
 (0)