From 545793df39710857a096cdc5dcfdde2278dc6969 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 23 Sep 2025 09:43:21 -0400 Subject: [PATCH] remove ai comments --- lua/cp/pickers/init.lua | 3 --- lua/cp/scraper.lua | 2 -- lua/cp/setup.lua | 6 ------ 3 files changed, 11 deletions(-) diff --git a/lua/cp/pickers/init.lua b/lua/cp/pickers/init.lua index d358137..91fd2b5 100644 --- a/lua/cp/pickers/init.lua +++ b/lua/cp/pickers/init.lua @@ -41,7 +41,6 @@ local function get_contests_for_platform(platform) return cached_contests end - -- No cache: start background scraping, return empty for now local constants = require('cp.constants') local platform_display_name = constants.PLATFORM_DISPLAY_NAMES[platform] or platform logger.log(('Loading %s contests...'):format(platform_display_name), vim.log.levels.INFO, true) @@ -64,7 +63,6 @@ local function get_contests_for_platform(platform) return {} end ----Get list of problems for a specific contest ---@param platform string Platform identifier ---@param contest_id string Contest identifier ---@return cp.ProblemItem[] @@ -115,7 +113,6 @@ local function get_problems_for_contest(platform, contest_id) return problems end ----Set up a specific problem by calling the main CP handler ---@param platform string Platform identifier ---@param contest_id string Contest identifier ---@param problem_id string Problem identifier diff --git a/lua/cp/scraper.lua b/lua/cp/scraper.lua index e8d708f..5819478 100644 --- a/lua/cp/scraper.lua +++ b/lua/cp/scraper.lua @@ -86,7 +86,6 @@ end function M.scrape_problem_tests(platform, contest_id, problem_id, callback) run_scraper(platform, 'tests', { contest_id, problem_id }, function(result) if result.success and result.tests then - -- Write test files vim.schedule(function() local mkdir_ok = pcall(vim.fn.mkdir, 'io', 'p') if mkdir_ok then @@ -125,7 +124,6 @@ function M.scrape_problem_tests(platform, contest_id, problem_id, callback) end end) - -- Cache test cases local cached_tests = {} for i, test_case in ipairs(result.tests) do table.insert(cached_tests, { diff --git a/lua/cp/setup.lua b/lua/cp/setup.lua index b38249b..82bd6a4 100644 --- a/lua/cp/setup.lua +++ b/lua/cp/setup.lua @@ -61,11 +61,9 @@ function M.setup_contest(platform, contest_id, problem_id, language) logger.log(('found %d problems'):format(#problems)) - -- Set up specified problem or first problem state.set_contest_id(contest_id) local target_problem = problem_id or problems[1].id - -- Validate problem exists if specified if problem_id then local problem_exists = false for _, prob in ipairs(problems) do @@ -85,7 +83,6 @@ function M.setup_contest(platform, contest_id, problem_id, language) M.setup_problem(contest_id, target_problem, language) - -- Scrape remaining problems in background M.scrape_remaining_problems(platform, contest_id, problems) end) end @@ -103,7 +100,6 @@ function M.setup_problem(contest_id, problem_id, language) local ctx = problem.create_context(platform, contest_id, problem_id, config, language) - -- Load test cases for current problem local cached_tests = cache.get_test_cases(platform, contest_id, problem_id) if cached_tests then state.set_test_cases(cached_tests) @@ -134,12 +130,10 @@ function M.setup_problem(contest_id, problem_id, language) state.set_test_cases({}) end - -- Update state immediately (safe in fast event) state.set_contest_id(contest_id) state.set_problem_id(problem_id) state.set_run_panel_active(false) - -- Schedule vim commands (required for fast event context) vim.schedule(function() local ok, err = pcall(function() vim.cmd.only({ mods = { silent = true } })