feat: flesh out language support

This commit is contained in:
Barrett Ruth 2025-09-15 11:35:22 -04:00
parent e806b23020
commit 4aa16d2858
7 changed files with 254 additions and 99 deletions

View file

@ -15,10 +15,11 @@ local M = {}
---@param contest_id string
---@param problem_id? string
---@param config cp.Config
---@param language? string
---@return ProblemContext
function M.create_context(contest, contest_id, problem_id, config)
function M.create_context(contest, contest_id, problem_id, config, language)
local filename_fn = config.filename or require("cp.config").default_filename
local source_file = filename_fn(contest, contest_id, problem_id)
local source_file = filename_fn(contest, contest_id, problem_id, config, language)
local base_name = vim.fn.fnamemodify(source_file, ":t:r")
return {