feat: improve autocomplete

This commit is contained in:
Barrett Ruth 2025-10-24 01:44:06 -04:00
parent f52244c534
commit 9d848eba22
3 changed files with 119 additions and 27 deletions

View file

@ -92,6 +92,26 @@ function M.get_contest_data(platform, contest_id)
return cache_data[platform][contest_id]
end
---Get all cached contest IDs for a platform
---@param platform string
---@return string[]
function M.get_cached_contest_ids(platform)
vim.validate({
platform = { platform, 'string' },
})
if not cache_data[platform] then
return {}
end
local contest_ids = {}
for contest_id, _ in pairs(cache_data[platform]) do
table.insert(contest_ids, contest_id)
end
table.sort(contest_ids)
return contest_ids
end
---@param platform string
---@param contest_id string
---@param problems Problem[]