feat(doc): update and remove default contrest mentions
This commit is contained in:
parent
b679e2b932
commit
e1ad439781
2 changed files with 4 additions and 2 deletions
|
|
@ -124,7 +124,6 @@ Optional configuration with lazy.nvim: >
|
||||||
|
|
||||||
Fields: ~
|
Fields: ~
|
||||||
• {contests} (`table<string,ContestConfig>`) Contest configurations.
|
• {contests} (`table<string,ContestConfig>`) Contest configurations.
|
||||||
Each contest inherits from 'default'.
|
|
||||||
• {hooks} (`cp.Hooks`) Hook functions called at various stages.
|
• {hooks} (`cp.Hooks`) Hook functions called at various stages.
|
||||||
• {snippets} (`table[]`) LuaSnip snippet definitions.
|
• {snippets} (`table[]`) LuaSnip snippet definitions.
|
||||||
• {debug} (`boolean`, default: `false`) Show info messages
|
• {debug} (`boolean`, default: `false`) Show info messages
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,6 @@ M.defaults = {
|
||||||
filename = nil,
|
filename = nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
---@param user_config cp.UserConfig|nil
|
---@param user_config cp.UserConfig|nil
|
||||||
---@return cp.Config
|
---@return cp.Config
|
||||||
function M.setup(user_config)
|
function M.setup(user_config)
|
||||||
|
|
@ -153,6 +152,10 @@ local function default_filename(contest, contest_id, problem_id, config, languag
|
||||||
end
|
end
|
||||||
|
|
||||||
local contest_config = config.contests[contest]
|
local contest_config = config.contests[contest]
|
||||||
|
if not contest_config then
|
||||||
|
error(("No contest config found for '%s'"):format(contest))
|
||||||
|
end
|
||||||
|
|
||||||
local target_language = language or contest_config.default_language
|
local target_language = language or contest_config.default_language
|
||||||
local language_config = contest_config[target_language]
|
local language_config = contest_config[target_language]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue