Skip to content

Commit 7c1a0e4

Browse files
committed
chore(formatter): clean up part.file type diags
1 parent b882a01 commit 7c1a0e4

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
@@ -697,12 +697,11 @@ function M.format_part(part, message)
697697
content_added = true
698698
end
699699
elseif part.type == 'file' then
700-
--- FIXME: find right type of part with filename
701-
---@diagnostic disable-next-line: undefined-field
702700
local file_line = M._format_context_file(output, part.filename)
703-
---@diagnostic disable-next-line: param-type-mismatch
704-
M._add_vertical_border(output, file_line - 1, file_line, 'OpencodeMessageRoleUser', -3)
705-
content_added = true
701+
if file_line then
702+
M._add_vertical_border(output, file_line - 1, file_line, 'OpencodeMessageRoleUser', -3)
703+
content_added = true
704+
end
706705
end
707706
elseif role == 'assistant' then
708707
if part.type == 'text' and part.text then

0 commit comments

Comments
 (0)