fix(scrapers): cses interactive problems
This commit is contained in:
parent
78c4cc779e
commit
d4df57bd05
3 changed files with 14 additions and 20 deletions
|
|
@ -153,9 +153,7 @@ function M.handle_command(opts)
|
|||
cache_commands.handle_cache_command(cmd)
|
||||
elseif cmd.type == 'contest_setup' then
|
||||
local setup = require('cp.setup')
|
||||
if setup.set_platform(cmd.platform) then
|
||||
setup.setup_contest(cmd.platform, cmd.contest, nil)
|
||||
end
|
||||
setup.setup_contest(cmd.platform, cmd.contest, nil)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -7,16 +7,6 @@ local scraper = require('cp.scraper')
|
|||
local state = require('cp.state')
|
||||
|
||||
local constants = require('cp.constants')
|
||||
local platforms = constants.PLATFORMS
|
||||
|
||||
function M.set_platform(platform)
|
||||
if not vim.tbl_contains(platforms, platform) then
|
||||
logger.log(("Unknown platform '%s'"):format(platform), vim.log.levels.ERROR)
|
||||
return false
|
||||
end
|
||||
state.set_platform(platform)
|
||||
return true
|
||||
end
|
||||
|
||||
---@class TestCaseLite
|
||||
---@field input string
|
||||
|
|
@ -35,9 +25,10 @@ end
|
|||
|
||||
---@param platform string
|
||||
---@param contest_id string
|
||||
---@param problem_id string|nil
|
||||
---@param language? string|nil
|
||||
---@param problem_id? string
|
||||
---@param language? string
|
||||
function M.setup_contest(platform, contest_id, problem_id, language)
|
||||
state.set_platform(platform)
|
||||
state.set_contest_id(contest_id)
|
||||
cache.load()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue