From 291de4e1371eed7703c15098eb6a4b31a7815ded Mon Sep 17 00:00:00 2001 From: Barrett Ruth <62671086+barrettruth@users.noreply.github.com> Date: Fri, 6 Mar 2026 21:35:13 -0500 Subject: [PATCH] fix: expand language IDs, fix AtCoder submit, normalize logging (#353) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Problem Language version coverage was incomplete across all platforms, AtCoder submit used a stale cookie fast-path that caused silent failures, and raw `vim.notify` calls throughout the codebase produced inconsistent or missing `[cp.nvim]:` prefixes. ## Solution Remove cookie persistence from AtCoder login/submit (always fresh login), increase the submit nav timeout to 40s, and switch to in-memory buffer upload with the correct per-language extension from a full `_LANGUAGE_ID_EXTENSION` map covering all 116 AtCoder languages. Expand `LANGUAGE_VERSIONS` in `constants.lua` with all AtCoder languages, 15 new CF languages with full version variants, and 50+ Kattis languages. Fix AtCoder `prolog` ID (`6079`→`6081`, was Pony) and remove the non-existent `racket` entry. Replace all raw `vim.notify` calls with `logger.log`. Simplify the submit language doc to point at `constants.lua` rather than maintaining a static table. --- doc/cp.nvim.txt | 21 ++-- lua/cp/config.lua | 11 +-- lua/cp/constants.lua | 112 +++++++++++++++++++++- lua/cp/init.lua | 2 +- lua/cp/pickers/fzf_lua.lua | 5 +- lua/cp/pickers/telescope.lua | 5 +- lua/cp/race.lua | 6 +- lua/cp/submit.lua | 7 +- lua/cp/utils.lua | 15 ++- scrapers/atcoder.py | 179 +++++++++++++++++++++-------------- scrapers/kattis.py | 7 +- scrapers/language_ids.py | 99 +++++++++++++++++++ scrapers/timeouts.py | 1 + 13 files changed, 356 insertions(+), 114 deletions(-) diff --git a/doc/cp.nvim.txt b/doc/cp.nvim.txt index 544923b..4fc684c 100644 --- a/doc/cp.nvim.txt +++ b/doc/cp.nvim.txt @@ -1054,20 +1054,14 @@ Set {version} globally or per-platform: }, }, < -Available versions per platform ~ +Available versions ~ - Platform cpp python java rust - AtCoder c++20/23 python3, pypy3 java rust - Codeforces c++17/20/23 python3, pypy3 - - - CSES c++11/17/20 python3, pypy3 java rust2018/2021 - Kattis c++17/20/23 python3 java rust - USACO c++11/17 python3 java - - CodeChef c++20 python3, pypy3 java rust +Each platform supports all of its own languages and compiler versions. +The full list of version keys is in `lua/cp/constants.lua` under +`LANGUAGE_VERSIONS`. Use any key from that table as the {version} value. -Using a raw platform ID ~ - -If your preferred version is not listed, you can bypass version -lookup by setting {submit_id} to the raw platform language ID: +To bypass version lookup entirely, set {submit_id} to the raw platform +language ID (the value from the platform's submit page dropdown): >lua platforms = { codeforces = { @@ -1075,9 +1069,6 @@ lookup by setting {submit_id} to the raw platform language ID: }, }, < -To find the raw ID, open the platform's submit page in your browser, -inspect the language dropdown, and copy the