validate default_language against enabled_languages in config #327
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
barrettruth/cp.nvim#327
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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'"`.
Resolved by #336.