Skip to content

Commit a8d396f

Browse files
committed
chore(render_state): fix get_part_by_call_id docs
1 parent afaae90 commit a8d396f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lua/opencode/ui/render_state.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,14 @@ function RenderState:get_part(part_id)
5353
return self._parts[part_id]
5454
end
5555

56-
---Get part ID by call ID
56+
---Get part ID by call ID and message ID
5757
---@param call_id string Call ID
58-
---@param message_id? string Optional message ID to limit search scope
58+
---@param message_id string Message ID to check the parts of
5959
---@return string? part_id Part ID if found
6060
function RenderState:get_part_by_call_id(call_id, message_id)
6161
local rendered_message = self._messages[message_id]
62+
-- There aren't a lot of parts per message and call_id lookups aren't very common so
63+
-- a little iteration is fine
6264
if rendered_message and rendered_message.message and rendered_message.message.parts then
6365
for _, part in ipairs(rendered_message.message.parts) do
6466
if part.callID == call_id then

0 commit comments

Comments
 (0)