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:
parent
7ae867c413
commit
98a1a4028b
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue