Skip to content

Commit

Permalink
fix(dap): support lldb-dap
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Nov 17, 2023
1 parent 1e1ebeb commit 7f8feb0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +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).

## [3.6.2] - 2023-11-17

### Fixed

- DAP: Add support for `lldb-dap`,
which has been renamed to `lldb-vscode`, but may still have the
old name on some distributions.

## [3.6.1] - 2023-11-17

### Fixed
Expand Down
19 changes: 12 additions & 7 deletions lua/rustaceanvim/config/internal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ local RustaceanDefaultConfig = {
adapter = function()
--- @type DapExecutableConfig | DapServerConfig | disable
local result = false
---@type DapExecutableConfig
local lldb_vscode = {
type = 'executable',
command = 'lldb-vscode',
name = 'lldb',
}
if vim.fn.executable('codelldb') == 1 then
---@cast result DapServerConfig
result = {
Expand All @@ -205,13 +211,12 @@ local RustaceanDefaultConfig = {
args = { '--port', '${port}' },
},
}
elseif vim.fn.executable('lldb') or vim.fn.executable('lldb-vscode') then
---@cast result DapExecutableConfig
result = {
type = 'executable',
command = 'lldb-vscode',
name = 'lldb',
}
elseif vim.fn.executable('lldb-vscode') then
result = lldb_vscode
elseif vim.fn.executable('lldb-dap') then
-- On some distributions, it may still have the old name
result = lldb_vscode
result.command = 'lldb-dap'
end
return result
end,
Expand Down

0 comments on commit 7f8feb0

Please sign in to comment.