Skip to content

feat: Add Rust, Go, and Ruby language support + runner bug fixes#8

Merged
dj258255 merged 11 commits into
mainfrom
feat/issue-7-rust-go-ruby
Jul 5, 2026
Merged

feat: Add Rust, Go, and Ruby language support + runner bug fixes#8
dj258255 merged 11 commits into
mainfrom
feat/issue-7-rust-go-ruby

Conversation

@dj258255

@dj258255 dj258255 commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Closes #7

Language Support (Issue #7)

  • Added RUST, GO, RUBY to the Language enum with default templates for each platform
  • Local test execution: compile/run support with automatic toolchain detection (~/.cargo/bin, /usr/local/go/bin, rbenv shims, Homebrew paths, etc.). Handles Windows where rustc/go build don't auto-append .exe (unlike MinGW g++)
  • Programmers-style solution wrappers: detects the solution function and converts arguments ([1,2,3]vec![1,2,3] / []int{1,2,3}). Go uses json.Marshal to avoid fmt.Println's [1 2 3] formatting; Rust uses {:?} + whitespace compaction to match the existing output convention. Handles LeetCode's real initial-code shapes (impl Solution + two_sum, twoSum, etc.)
  • Submission mapping: LeetCode (rust/golang/ruby slugs), Codeforces (language dropdown keywords), Programmers (Go/Ruby only — Rust is not supported by the platform and shows a friendly notice), SWEA (not supported, sweaId = -1)

UX Improvements

  • Early warning for unsubmittable combos: selecting a (platform, language) combination that can't be submitted shows an immediate hint next to the combo boxes — users find out before solving, not at submission time. Backed by a new Language.isSubmittable(source) matrix; also covers existing combos like Kotlin/JavaScript × SWEA
  • Problems ↔ Tests language sync: the language selector in the Problems tab and Tests tab are now bidirectionally synchronized

Codeforces: Cloudflare-resistant fetching

Codeforces problem crawling was being blocked by Cloudflare (HTTP 403 — TLS fingerprint detection, confirmed unfixable via cookies/UA alone in real-device testing). Fetching now falls back automatically to an offscreen JCEF (embedded Chromium) fetcher that passes the challenge and feeds the rendered HTML to the same parser (mirrors the existing SweaJcefFetcher pattern). Login cookies are also forwarded to the HTTP attempt.

Bug Fixes (found during this work)

  1. stdin never closed on blank input: child processes reading stdin never received EOF and blocked until timeout, producing false "Time Limit Exceeded" verdicts + pipe FD leaks on every compile → stdin is now always closed
  2. kotlinc missing UTF-8 flag: added -J-Dfile.encoding=UTF-8 (same purpose as the javac -encoding UTF-8 fix from issue Windows 환경에서 Java 코드 컴파일 시 인코딩 오류 발생 (unmappable character) #2)
  3. Duplicate-class highlight filter: didn't handle Windows path separators (\)
  4. EDT keychain access (SlowOperations violations): AuthService cookies and GitHubService token were read/written from the EDT via OS keychain on tool-window creation, combo changes, login, fetch, and submit — caught live during runIde testing. Now served from in-memory caches with ordered background persistence

Documentation

  • Supported-language tables (added JavaScript + the three new languages), exam mode 4→5 restrictions, min IDE 2024.3, JDK 21 build note, fixed folder-structure docs
  • Removed stale Baekjoon screenshots (platform removed in v1.4.0), EN/KO section parity
  • Documented the new features above (fetch.md / test.md / submit.md / READMEs)

Verification

  • 112 tests pass, including per-language wrapper integration tests (auto-skip without toolchain), LeetCode initial-code-shape regression tests, and a stdin-EOF regression test
  • Real-device E2E via runIde sandbox: LeetCode fetch→local test→submit with Rust (initial code, language dropdown auto-switch, code injection all confirmed) and Codeforces fetch (JCEF fallback through Cloudflare)→local test→submit with Rust, both confirmed working by hand
  • Live-network smoke: LeetCode rust/golang/ruby slugs, Programmers search + go filter + fetch, all default templates compile and run (rustc 1.96 / go 1.26 / ruby 2.6)

dj258255 added 3 commits July 6, 2026 00:08
- Language enum에 RUST/GO/RUBY 추가 + 플랫폼별 기본 템플릿
- CodeRunner: 컴파일/실행, 프로그래머스식 solution 래퍼, 툴체인 자동 탐지
  (~/.cargo/bin, /usr/local/go/bin, rbenv 등, Windows .exe 처리)
- 제출 매핑: LeetCode(rust/golang/ruby), Codeforces, 프로그래머스(Go/Ruby)
  Rust는 프로그래머스 미지원 안내 처리, SWEA는 제출 미지원(-1)
- ProblemFileManager 확장자 목록을 Language enum에서 파생하도록 변경

실행기 버그 수정:
- 빈 입력 시 stdin을 닫지 않아 EOF 미전달로 허위 시간 초과 발생 + FD 누수
- kotlinc에 -J-Dfile.encoding=UTF-8 추가 (javac -encoding과 동일 목적, 이슈 #2)
- 중복 클래스 오류 필터가 Windows 경로 구분자(\)를 처리하지 못하던 문제
- 지원 언어 표에 JavaScript 누락 보완 + Rust/Go/Ruby 추가
- 시험 모드 제한 4가지 → 실제 5가지 (Code Vision 끄기 누락 보완)
- 최소 IDE 버전 2024.1 → 2024.3 (sinceBuild=243)
- fetch.md 생성 폴더 구조를 실제 구조로 수정 (problems/{플랫폼}/{난이도}/...)
- 설정 언어 변경 안내문 한·영 동시 표시 문구 제거 (v1.0.8에서 변경됨)
- 소스 빌드 JDK 21 필요 명시, My Solved 기능 표 추가
문제를 다 푼 뒤 제출 시점에야 미지원을 알게 되는 상황 방지.
- Language.isSubmittable(source): 제출 가능 매트릭스 단일 진실 원천
- ProblemPanel: 콤보 변경 즉시 '제출 미지원 (로컬 테스트만 가능)' 경고 라벨
@dj258255 dj258255 changed the title feat: Rust/Go/Ruby 언어 지원 추가 + 실행기 버그 수정 feat: Add Rust, Go, and Ruby language support + runner bug fixes Jul 5, 2026
dj258255 added 8 commits July 6, 2026 00:34
two_sum/twoSum 네이밍, Rust impl Solution(struct 보충), 문자열·2차원 배열
인자 변환을 실제 exampleTestcases 입력 포맷으로 검증. 툴체인 없으면 스킵.
runIde 실사용 테스트 중 SlowOperations SEVERE 다수 발생:
콤보 변경·로그인·가져오기·제출 시 AuthService.readCookies/writeCookies와
GitHubService.readToken이 EDT에서 OS 키체인에 동기 접근.

메모리 캐시로 즉시 응답하고 영속화는 단일 스레드 executor로 백그라운드 처리
(쓰기 순서 보장). 서비스 초기화 시 캐시를 예열해 첫 EDT 읽기도 커버.
- boj-*.png 4장 삭제 (v1.4.0에서 제거된 백준 UI가 그대로 노출되던 문제)
- 가져오기 예시는 problem-view-1.png, 제출 흐름은 fetch-test-submit.gif로 교체
- README EN/KO 섹션 간 이미지 구성 일치화
서비스 캐시 예열(백그라운드)이 끝나기 전에 ProblemPanel 생성자가 EDT에서
버튼 상태를 읽어 폴백 경로로 키체인에 접근하던 문제. 초기 버튼 갱신을
캐시 예열 후 invokeLater로 옮기고, 코드포스 크롤링에 로그인 쿠키 전달 추가
(cf_clearance로 Cloudflare 통과 시도, Chrome UA 정합)
Cloudflare가 Jsoup(Java TLS 지문)을 403으로 차단하는 경우 대응:
로그인 쿠키(cf_clearance) 전달로도 안 뚫리는 것을 실기기에서 확인.
SweaJcefFetcher와 동일 패턴으로 실제 Chromium(JCEF)이 챌린지를 통과한 뒤
렌더링된 HTML을 추출해 기존 파서(parseProblemHtml)로 처리.
HTTP 크롤링 실패 시에만 폴백으로 동작.
한쪽 탭에서 언어를 바꾸면 다른 탭의 언어 콤보도 자동으로 맞춰짐.
setLanguage가 동일 값이면 무시하므로 콜백 순환이 발생하지 않음.
- fetch.md: 코드포스 소절 추가 (Cloudflare 차단 시 JCEF 자동 폴백, 5~20초 소요)
- test.md: Problems ↔ Tests 언어 선택 양방향 동기화 안내
- submit.md: 제출 미지원 조합 선택 시 즉시 경고 표시 설명
- README 3종: 언어 표 각주 및 가져오기 섹션에 요약 반영
- 지원 언어 목록에 Rust/Go/Ruby 추가 (설명 EN/KO + 로컬 테스트 항목)
- 제출 가능 여부 안내 문구 추가 (미지원 조합 선택 시 즉시 경고)
- change-notes에 v1.5.0 항목 작성 (EN/KO)
@dj258255 dj258255 merged commit 058a885 into main Jul 5, 2026
1 of 2 checks passed
@dj258255 dj258255 deleted the feat/issue-7-rust-go-ruby branch July 5, 2026 16:36
@dj258255

dj258255 commented Jul 5, 2026

Copy link
Copy Markdown
Owner Author

Post-merge follow-up: the CI failures on this PR's runs were false "compile timeout" errors — the compile timeout was tied to the test-case run limit (5s × 2), which cold-cache 2-core CI runners exceed for rustc -O / go build.

Fixed in a714575 (compile timeout separated into a dedicated 60s constant). Verify Plugin is now green on both ubuntu and windows: https://github.com/dj258255/codingtestkit/actions/runs/28747918535

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for additional languages

1 participant