fix(conflict): resolve LuaLS missing-fields diagnostics

Problem: LuaLS reports missing-fields errors because the parser builds
ConflictRegion tables incrementally, but the variable is typed as
diffs.ConflictRegion? which expects all required fields at construction.

Solution: type the work-in-progress variable as table? and cast to
diffs.ConflictRegion on insertion into the results array.
This commit is contained in:
Barrett Ruth 2026-02-07 17:51:47 -05:00
parent 7ae867c413
commit 98a1a4028b

View file

@ -27,7 +27,7 @@ local PRIORITY_LINE_BG = 200
function M.parse(lines)
local regions = {}
local state = 'idle'
---@type diffs.ConflictRegion?
---@type table?
local current = nil
for i, line in ipairs(lines) do
@ -72,7 +72,7 @@ function M.parse(lines)
if line:match('^>>>>>>>') then
current.theirs_end = idx
current.marker_theirs = idx
table.insert(regions, current)
table.insert(regions, current --[[@as diffs.ConflictRegion]])
current = nil
state = 'idle'
elseif line:match('^<<<<<<<') then