Skip to content

Commit a62e86b

Browse files
fix(frames): use session's frames
See #303 Closes #307 Co-authored-by: przepompownia <przepompownia@users.noreply.github.com>
1 parent 0b4816e commit a62e86b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lua/dapui/client/init.lua

+2
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ local DAPUIClient = {}
1919
---@field _frame_set fun(frame: dapui.types.StackFrame)
2020
---@field stopped_thread_id integer
2121
---@field capabilities dapui.types.Capabilities
22+
---@field threads table<integer, dapui.types.Thread>
2223

2324
local proxied_session_keys = {}
2425
for _, key in ipairs({
2526
"current_frame",
2627
"_frame_set",
2728
"stopped_thread_id",
2829
"capabilities",
30+
"threads",
2931
}) do
3032
proxied_session_keys[key] = true
3133
end

lua/dapui/components/frames.lua

+6-3
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@ return function(client, send_ready)
1212
---@async
1313
---@param canvas dapui.Canvas
1414
render = function(canvas, thread_id, show_subtle, indent)
15-
local success, response = pcall(client.request.stackTrace, { threadId = thread_id })
15+
if not client.session then
16+
return
17+
end
18+
1619
local current_frame_id = nil
1720

18-
if not success then
21+
local frames = client.session.threads[thread_id].frames
22+
if not frames then
1923
return
2024
end
21-
local frames = response.stackFrames
2225

2326
if not show_subtle then
2427
frames = vim.tbl_filter(function(frame)

0 commit comments

Comments
 (0)