From 7a7896d2236fc8a0433db6f05013212993eccada Mon Sep 17 00:00:00 2001 From: sachin Date: Mon, 8 Jun 2026 12:46:27 +0530 Subject: [PATCH 1/2] added codeChef button and linked with cph-submit --- src/types.ts | 5 ++++- src/webview/JudgeView.ts | 4 ++++ src/webview/frontend/App.tsx | 20 +++++++++++++++++++- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/types.ts b/src/types.ts index 0f7b4c9..3a30f17 100644 --- a/src/types.ts +++ b/src/types.ts @@ -183,7 +183,9 @@ export type SubmitCf = { export type SubmitCSES = { command: 'submitCSES'; } & WebviewMessageCommon; - +export type SubmitCodeChef = { + command: 'submitCodeChef'; +} & WebviewMessageCommon; export type SubmitKattis = { command: 'submitKattis'; } & WebviewMessageCommon; @@ -229,6 +231,7 @@ export type WebviewToVSEvent = | DeleteTcsCommand | SubmitCf | SubmitCSES + | SubmitCodeChef | OnlineJudgeEnv | SubmitKattis | OpenUrl diff --git a/src/webview/JudgeView.ts b/src/webview/JudgeView.ts index 8fecde8..2c429e0 100644 --- a/src/webview/JudgeView.ts +++ b/src/webview/JudgeView.ts @@ -95,6 +95,10 @@ class JudgeViewProvider implements vscode.WebviewViewProvider { storeSubmitProblem(message.problem); break; } + case 'submitCodeChef': { + storeSubmitProblem(message.problem); + break; + } case 'submitKattis': { submitKattisProblem(message.problem); break; diff --git a/src/webview/frontend/App.tsx b/src/webview/frontend/App.tsx index f0a199a..41fb080 100644 --- a/src/webview/frontend/App.tsx +++ b/src/webview/frontend/App.tsx @@ -422,6 +422,14 @@ function Judge(props: { setWaitingForSubmit(true); }; + const submitCodeChef = () => { + sendMessageToVSCode({ + command: 'submitCodeChef', + problem, + }); + + setWaitingForSubmit(true); + }; const debounceFocusLast = () => { setTimeout(() => { setFocusLast(false); @@ -572,7 +580,8 @@ function Judge(props: { if ( !url.hostname.endsWith('codeforces.com') && url.hostname !== 'open.kattis.com' && - !url.hostname.endsWith('cses.fi') + !url.hostname.endsWith('cses.fi') && + !url.hostname.endsWith('codechef.com') ) { return null; } @@ -622,6 +631,15 @@ function Judge(props: { {t('submit')} ); + } else if (url.hostname.endsWith('codechef.com')) { + return ( + + ); } }; From e8c789df9cc8a6a9b1049634566bae74875945d2 Mon Sep 17 00:00:00 2001 From: sachin Date: Sat, 13 Jun 2026 22:32:06 +0530 Subject: [PATCH 2/2] added atcoder similar to codechef --- src/types.ts | 4 ++++ src/webview/JudgeView.ts | 4 ++++ src/webview/frontend/App.tsx | 20 +++++++++++++++++++- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/types.ts b/src/types.ts index 3a30f17..5ec51bb 100644 --- a/src/types.ts +++ b/src/types.ts @@ -186,6 +186,9 @@ export type SubmitCSES = { export type SubmitCodeChef = { command: 'submitCodeChef'; } & WebviewMessageCommon; +export type SubmitAtcoder = { + command: 'submitAtcoder'; +} & WebviewMessageCommon; export type SubmitKattis = { command: 'submitKattis'; } & WebviewMessageCommon; @@ -232,6 +235,7 @@ export type WebviewToVSEvent = | SubmitCf | SubmitCSES | SubmitCodeChef + | SubmitAtcoder | OnlineJudgeEnv | SubmitKattis | OpenUrl diff --git a/src/webview/JudgeView.ts b/src/webview/JudgeView.ts index 2c429e0..d5af717 100644 --- a/src/webview/JudgeView.ts +++ b/src/webview/JudgeView.ts @@ -99,6 +99,10 @@ class JudgeViewProvider implements vscode.WebviewViewProvider { storeSubmitProblem(message.problem); break; } + case 'submitAtcoder': { + storeSubmitProblem(message.problem); + break; + } case 'submitKattis': { submitKattisProblem(message.problem); break; diff --git a/src/webview/frontend/App.tsx b/src/webview/frontend/App.tsx index 41fb080..fb79acd 100644 --- a/src/webview/frontend/App.tsx +++ b/src/webview/frontend/App.tsx @@ -430,6 +430,14 @@ function Judge(props: { setWaitingForSubmit(true); }; + const submitAtcoder = () => { + sendMessageToVSCode({ + command: 'submitAtcoder', + problem, + }); + + setWaitingForSubmit(true); + }; const debounceFocusLast = () => { setTimeout(() => { setFocusLast(false); @@ -581,7 +589,8 @@ function Judge(props: { !url.hostname.endsWith('codeforces.com') && url.hostname !== 'open.kattis.com' && !url.hostname.endsWith('cses.fi') && - !url.hostname.endsWith('codechef.com') + !url.hostname.endsWith('codechef.com') && + !url.hostname.endsWith('atcoder.jp') ) { return null; } @@ -640,6 +649,15 @@ function Judge(props: { {t('submit')} ); + } else if (url.hostname.endsWith('atcoder.jp')) { + return ( + + ); } };