fix(ansi): annotate highlights too

This commit is contained in:
Barrett Ruth 2025-10-02 14:20:26 -04:00
parent 1974addbd2
commit db98153b11
4 changed files with 10 additions and 4 deletions

View file

@ -4,7 +4,7 @@
---@field expected string ---@field expected string
---@field status "pending"|"pass"|"fail"|"running"|"timeout" ---@field status "pending"|"pass"|"fail"|"running"|"timeout"
---@field actual string? ---@field actual string?
---@field actual_highlights? any[] ---@field actual_highlights? Highlight[]
---@field time_ms number? ---@field time_ms number?
---@field error string? ---@field error string?
---@field stderr string? ---@field stderr string?

View file

@ -278,7 +278,7 @@ local function data_row(c, idx, tc, is_current, test_state)
end end
---@param test_state RunPanelState ---@param test_state RunPanelState
---@return string[], any[] lines and highlight positions ---@return string[], Highlight[] lines and highlight positions
function M.render_test_list(test_state) function M.render_test_list(test_state)
local lines, highlights = {}, {} local lines, highlights = {}, {}
local c = compute_cols(test_state) local c = compute_cols(test_state)

View file

@ -1,6 +1,12 @@
---@class AnsiParseResult ---@class AnsiParseResult
---@field lines string[] ---@field lines string[]
---@field highlights any[] ---@field highlights Highlight[]
---@class Highlight
---@field line number
---@field col_start number
---@field col_end number
---@field highlight_group string
local M = {} local M = {}

View file

@ -1,6 +1,6 @@
---@class DiffResult ---@class DiffResult
---@field content string[] ---@field content string[]
---@field highlights any[]? ---@field highlights Highlight[]?
---@field raw_diff string? ---@field raw_diff string?
---@class DiffBackend ---@class DiffBackend