feat(config): add submit_id platform override for language selection

Problem: The submission language ID is hardcoded per platform in
`language_ids.py` (e.g. CF `"89"` = GNU G++17 7.3.0). Users have no
way to select a different version like G++20 or C++23.

Solution: Add `submit_id?: string` to `CpPlatformOverrides` and
`CpLanguage`. When set, `submit.lua` passes the resolved `submit_id`
directly to the scraper instead of the generic language key. The
existing `get_language_id() or args[4]` fallback in `base.py` handles
pre-resolved IDs without any Python changes.
This commit is contained in:
Barrett Ruth 2026-03-06 17:28:04 -05:00
parent 8465e70772
commit e7ebe738a4
2 changed files with 13 additions and 1 deletions

View file

@ -8,6 +8,7 @@
---@field extension string
---@field commands CpLangCommands
---@field template? string
---@field submit_id? string
---@class CpTemplatesConfig
---@field cursor_marker? string
@ -16,6 +17,7 @@
---@field extension? string
---@field commands? CpLangCommands
---@field template? string
---@field submit_id? string
---@class CpPlatform
---@field enabled_languages string[]
@ -293,6 +295,9 @@ local function merge_lang(base, ov)
if ov.template then
out.template = ov.template
end
if ov.submit_id then
out.submit_id = ov.submit_id
end
return out
end