fix: remove version

This commit is contained in:
Barrett Ruth 2025-09-24 18:28:41 -04:00
parent 9e84d57b8a
commit 975e829f78
4 changed files with 8 additions and 9 deletions

View file

@ -11,7 +11,6 @@
---@field test? string[] Test execution command template
---@field debug? string[] Debug command template
---@field executable? string Executable name
---@field version? number Language version
---@field extension? string File extension
---@class ContestConfig

View file

@ -230,7 +230,6 @@ function M.compile_problem(contest_config, is_debug)
local substitutions = {
source = source_file,
binary = binary_file,
version = tostring(language_config.version),
}
local compile_cmd = (is_debug and language_config.debug) and language_config.debug
@ -279,7 +278,6 @@ function M.run_problem(contest_config, is_debug)
local substitutions = {
source = source_file,
binary = binary_file,
version = tostring(language_config.version),
}
local compile_cmd = is_debug and language_config.debug or language_config.compile
@ -302,6 +300,11 @@ function M.run_problem(contest_config, is_debug)
local platform = state.get_platform()
local contest_id = state.get_contest_id()
local problem_id = state.get_problem_id()
if not platform or not contest_id then
logger.log('configure a contest before running a problem', vim.log.levels.ERROR)
return
end
local timeout_ms, _ = cache.get_constraints(platform, contest_id, problem_id)
timeout_ms = timeout_ms or 2000

View file

@ -182,10 +182,9 @@ local function run_single_test_case(contest_config, cp_config, test_case)
local substitutions = {
source = source_file,
binary = binary_file,
version = tostring(language_config.version or ''),
}
if language_config.compile and vim.fn.filereadable(binary_file) == 0 then
if language_config.compile and binary_file and vim.fn.filereadable(binary_file) == 0 then
logger.log('binary not found, compiling first...')
local compile_cmd = substitute_template(language_config.compile, substitutions)
local redirected_cmd = vim.deepcopy(compile_cmd)