Skip to content

Commit eaa3296

Browse files
authored
fix(dap): don't load lldb_commands when using codelldb (#140)
1 parent 9c7e18d commit eaa3296

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818
if they exist, so as not to break compatibility.
1919
Thanks [@saying121](https://github.com/saying121)!
2020

21+
### Fixed
22+
23+
- DAP: Don't load `lldb_commands` when using `codelldb`.
24+
2125
## [3.12.2] - 2024-01-07
2226

2327
### Fixed

lua/rustaceanvim/config/init.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ vim.g.rustaceanvim = vim.g.rustaceanvim
8989
---@field configuration? DapClientConfig | disable | fun():(DapClientConfig | disable) Dap client configuration. Defaults to a function that looks for a `launch.json` file or returns a `DapExecutableConfig` that launches the `rt_lldb` adapter. Set to `false` to disable.
9090
---@field add_dynamic_library_paths? boolean | fun():boolean Accommodate dynamically-linked targets by passing library paths to lldb. Default: `true`.
9191
---@field auto_generate_source_map? fun():boolean | boolean Whether to auto-generate a source map for the standard library.
92-
---@field load_rust_types? fun():boolean | boolean Whether to get Rust types via initCommands (rustlib/etc/lldb_commands). Default: `true`.
92+
---@field load_rust_types? fun():boolean | boolean Whether to get Rust types via initCommands (rustlib/etc/lldb_commands, lldb only). Default: `true`.
9393

9494
---@alias disable false
9595

lua/rustaceanvim/config/internal.lua

+6-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,12 @@ local RustaceanDefaultConfig = {
270270
--- Get Rust types via initCommands (rustlib/etc/lldb_commands).
271271
---@type boolean | fun():boolean
272272
load_rust_types = function()
273-
return should_enable_dap_config_value(RustaceanConfig.dap.adapter)
273+
if not should_enable_dap_config_value(RustaceanConfig.dap.adapter) then
274+
return false
275+
end
276+
local adapter = types.evaluate(RustaceanConfig.dap.adapter)
277+
--- @cast adapter DapExecutableConfig | DapServerConfig | disable
278+
return adapter ~= false and adapter.type == 'executable'
274279
end,
275280
--- @type DapClientConfig | disable | fun():(DapClientConfig | disable)
276281
configuration = function()

lua/rustaceanvim/dap.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ end
227227
---@param args RADebuggableArgs
228228
function M.start(args)
229229
local adapter = types.evaluate(config.dap.adapter)
230-
--- @cast adapter DapExecutableConfig | DapServerConfig | boolean
230+
--- @cast adapter DapExecutableConfig | DapServerConfig | disable
231231

232232
vim.notify('Compiling a debug build for debugging. This might take some time...')
233233
handle_configured_options(adapter, args)

0 commit comments

Comments
 (0)