validate default_language against enabled_languages in config #327

Closed
opened 2026-03-06 16:47:28 +00:00 by barrettruth · 1 comment
barrettruth commented 2026-03-06 16:47:28 +00:00

Problem

If `enabled_languages` is a table, `default_language` should be one of its entries — otherwise the plugin silently uses a language that isn't in the enabled set. There is currently no validation or warning for this mismatch.

Also tracked here: should `default_language` be renamed to something clearer (e.g. `language`)? That can be a separate follow-up issue.

Solution

During config validation / `setup()`, if `enabled_languages` is a non-empty table and `default_language` is set, verify `default_language` is a member of `enabled_languages`. Emit a `WARN`-level notification if not, e.g. `"default_language 'cpp' is not in enabled_languages for platform 'kattis'"`.

## Problem If \`enabled_languages\` is a table, \`default_language\` should be one of its entries — otherwise the plugin silently uses a language that isn't in the enabled set. There is currently no validation or warning for this mismatch. Also tracked here: should \`default_language\` be renamed to something clearer (e.g. \`language\`)? That can be a separate follow-up issue. ## Solution During config validation / \`setup()\`, if \`enabled_languages\` is a non-empty table and \`default_language\` is set, verify \`default_language\` is a member of \`enabled_languages\`. Emit a \`WARN\`-level notification if not, e.g. \`"default_language 'cpp' is not in enabled_languages for platform 'kattis'"\`.
barrettruth commented 2026-03-06 21:20:26 +00:00

Resolved by #336.

Resolved by #336.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
barrettruth/cp.nvim#327
No description provided.