Skip to content

Commit 7c05358

Browse files
cameronrsudo-tee
authored andcommitted
chore(formatter): clean up part.file type diags
1 parent 92ec8f6 commit 7c05358

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lua/opencode/ui/formatter.lua

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -698,12 +698,11 @@ function M.format_part(part, message)
698698
content_added = true
699699
end
700700
elseif part.type == 'file' then
701-
--- FIXME: find right type of part with filename
702-
---@diagnostic disable-next-line: undefined-field
703701
local file_line = M._format_context_file(output, part.filename)
704-
---@diagnostic disable-next-line: param-type-mismatch
705-
M._add_vertical_border(output, file_line - 1, file_line, 'OpencodeMessageRoleUser', -3)
706-
content_added = true
702+
if file_line then
703+
M._add_vertical_border(output, file_line - 1, file_line, 'OpencodeMessageRoleUser', -3)
704+
content_added = true
705+
end
707706
end
708707
elseif role == 'assistant' then
709708
if part.type == 'text' and part.text then

0 commit comments

Comments
 (0)