From 98a1a4028b369686dd01ee6e01580e1c0e7abab3 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Sat, 7 Feb 2026 17:51:47 -0500 Subject: [PATCH] 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. --- lua/diffs/conflict.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/diffs/conflict.lua b/lua/diffs/conflict.lua index 6e88c1c..6e66d39 100644 --- a/lua/diffs/conflict.lua +++ b/lua/diffs/conflict.lua @@ -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